So you’ve already setup a VPN connection to your home or office, but then you realize that you either can’t connect to your VPN network, or you can’t connect to the internet. If you want to have access to both, you’ll need to setup a split-tunnel. On a Mac this is a bit more frustrating than on a Windows machine, so I’ve used some script-foo to make it easier.
Tag Archives: Mac OS
Mac OS: Port Forwarding
I use a Mac and I’ve been working in virtual machines (VirtualBox) to learn more about Linux as a server environment. It’s great, to say the least. Knowing you can revert back to a previous “system snapshot” is a wonderful assurance for when you know you’re going to mess thing up.
With all this greatness, I was unfortunately having a lot of trouble getting the VM server to connect to other computers. Actually, it was very easy with using a bridged ethernet connection, with the Ubuntu server getting a unique IP address. However, a bridged connection is not always available, so I was determined to get it to work with a NAT connection with port forwarding. I needed port 80 to be forwarded to port 8080, and it was a pain but I finally got port forwarding to work. Here’s how:
Mac OS: Kill an App with Terminal
You can quit applications by using the Force Quit menu (⌘⌥ESC) but sometimes we need to quite a background application or the application on a remote machine. In Terminal we can do this using the top and kill commands.
Mac OS: Useful Unicode Symbols
Here’s a list of some useful commonly seen Mac symbols, great for when you have to write documentation:
First, pressing ⌘⌥T (Cmd + Opt + T ) will bring up the special characters menu.
To give us access to these technical codes, we’ll need to add them.
Continue reading
Twitter & Python: Tutorial to using the Twitter API to find tweets
In this beginner’s tutorial I’ll walk through the steps to making your first Python program that works with the Twitter API. This will allow you to perform actions with Twitter’s code without being on the website, and also open up other options that are not readily available to normal users.
For this tutorial we’re first going to need a Twitter dev account. Don’t worry, this is a very simple step.
Mac OS & Python: An introduction for the Applescripter
Applescript is a great tool for us Mac users. It’s a scripting language that’s easy and simple enough to not scare away true beginners. A fun feature of Applescript is how to write code, since almost looks like regular English sentences. Applescript was the first scripting language I felt comfortable using. However, its ceiling of limits is pretty low. For some tasks it’s better to turn to other tools.
When jumping from the Applescript ship to Python, the water seems mighty cold. There is a lot more ‘computer code’ and all the commands are new and foreign. Plus, the language’s name is a type of snake! You’ll be feeling homesick for the ease of Applescript, but these feelings will pass.
Python’s developers wanted to create a language that was fun to learn and use, that’s why they named it after the British comedic troupe, Monty Python. And when compared to other languages, like C and Pearl, it is easy to pickup and learn. Continue reading
Terminal: Compressing multiple folders
You have a directory full of important folders, and you want each one compressed separately. Doing this by hand would take waaay to much time. Of course, we can do this in terminal, and with one line of code (sweet!) so it’s easy to use.
For this we use the “Find” command built in into our computer. From there we’ll have two choices, to use compress it to a zip file for a dmg file.
Mac OS: Zipping with your terminal
The basic command structure for compressing a file into the zip format with the terminal is:
zip -r <destination> <source>
If you want to compress more than one folder or item:
zip -r <destination> <source1> <source2>...
The source can be a file or folder.
Unfortunately zip is not very smart when it comes to folders and it will save not only the file, but the path to the file as well. We can fix this behavior by adding just a little bit to the original command.
Mac OS: Command basics – “cd” and “ls”
For those out there that are new to using Terminal, or need a quick review, this is a quick overview of the “cd” and “ls” commands. These two commands are the basic tools for navigating the file structure “inside” of your Mac. Once these two are mastered, you will be able to comfortably move onto doing cooler, more complicated commands that can be run in Terminal. Continue reading