Linux Blog

Tether iPhone through the cable, on Linux

Filed under: General Linux — at 10:02 am on Thursday, August 20, 2009

So you got an iPhone huh? perhaps you’ve got an SSH client and maybe you jailbroke your iPhone and have done some iPhone wifi tethering (That’s not the best way, and not free), but have you been able to use SSH through the cable? Me neither until a little while ago.

The benefits of connecting by the cable are slightly obvious to anyone who wants to do it:

With your phone plugged in, you’ll get better battery life, or perhaps just prevent the battery from getting discharged any further.

No Wifi Setup
This was really the biggest problem for me, having to reconfigure wifi on my laptop then getting the laptop and phone to talk. Some times wireless connections mysteriously dropped or just acted plain funky. Any one who’s ever typed in a WEP key on the iPhone also knows what a pain it is, so not having to use Wifi is a plus.

Since the cable is used, there should be no wireless network for others to fool around with.

Data Transfer Rates
I have not yet confirmed this, mostly because I’m lazy, partly because I don’t have the time to produce any stats but, 480Mbps with USB2.0 Vs. a theoretical 54Mbps on 802.11G

Enough already, how do I do it?
Thanks to Jing Su there is a LGPL’d piece of software called itunnel that can be found here. Installing itunnel will vary by distribution. It’s fairly straight forward on Fedora, provided you have the library libiphone installed you should be able to download, untar, make, and run.

Once you’ve installed itunnel, you run it by using:

sudo itunnel <port>

If you don’t specify a port it listens on port 3023.

Connect to localhost using your normal SSH Socks proxy method -D <port> and your username, default being mobile with your new port.

 ssh -D <yourport> -p 3023 mobile@localhost

Type “Yes” to accept the fingerprint (you may need to eventually change your fingerprint when you upgrade your phone) and then type in your password which should NOT be “alpine”, because you did change it right?

Once you’re SSH’d in, you can set up your browser to use the socks proxy as you would with Wifi tether version on the port you specified with -D.

There you have it, a way to Tether your iPhone through the cable on Linux! Rumor, (well not really a rumor, since I’ve used itunnel.exe) has it that this also works with a Windows box, just try to find a non-virus infected version of the iTunnel suite.

Happy Hacking!

CPU Flags and Meanings

Filed under: General Linux — at 11:38 pm on Tuesday, August 11, 2009

Having a brain that is somewhat comparable to a sift for remembering acronym’s, I’m always asking a friend which (I, probably incorrectly call) CPU extension is for virtualization. So I figured I’d blog about this topic. This page CPU feature flags and their meanings clearly explains each of the flags that may be on your machine, which you can check what your CPU supports by typing:

cat /proc/cpuinfo | grep flags

Secure Virtual Machine. (AMD’s virtualization extensions to the 64-bit x86 architecture, equivalent to Intel’s VMX, both are also known as HVM in the Xen hypervisor.)

So to answer my own question SVM and VMX are what to look for when considering a CPU for virtualization. My laptop supports VMX, but my desktop doesn’t. Considering I’d rather do my virtualization on my desktop, I’ll have to upgrade my CPU. Now all I need to do is find out where to find this information for AMD processors and hope I can get a CPU for my outdated socket type. I don’t even think that it is AM2 :(

Throw a rave when you work too hard

Filed under: Linux Software — at 7:36 pm on Wednesday, December 3, 2008


Workrave is an awesome little utility that I just found out about almost a week ago now. Basically what it does is sits in your tray and bugs you when you should take breaks. Its really simple to use, and is in the Fedora repositories. Since, my Open SUSE laptop is at home and off, I can’t tell you if it is in there but my guess is that Debian / Ubuntu also have this package. Once you’ve got it installed by whatever means possible, run it. Its very easy to use, but I would advise setting up your defaults. If you don’t you’ll be taking a short rest break once every 3 minutes, which I find to be a bit excessive. You also get rest breaks, which advise you to stand up and walk around, and do stretches. It has some great statistics such as how many keystrokes you make, how many breaks you’ve taken. It also accounts for “natural” rest breaks, so if there is no activity on your computer, it thinks you are idle. Although I have not tried it there is network support for Workrave. Perhaps one day I will try it. If you spend a long time in front of the computer at home or work (like I’m doing today) then this may be the application for you, especially if you are trying to avoid doing work. getting fatigued. Talking of work, I had better get back to what I was doing; oh yea, taking a break.

New Laptop

Filed under: Linux Hardware — at 10:06 am on Friday, October 10, 2008

I’m excited because this weekend I’m getting another laptop. I’ve gone through quite a few laptops some of which have been more Linux friendly than others. I have been happy with my last two Toshiba laptops (Portege 4010 and Tecra M2) but this time I am buying a used Lenovo Thinkpad.

I was very happy with my last upgrade, from a 933MHz with 512MB of ram, to a 1.7GHz with 768MB ram that was recently upgraded to 1GB. The performance increase was phenomenal. Now moving from a 1.7GHz to am Intel Core 2 Duo should provide another greatly needed performance increase.

Command of the day: chvt

Filed under: Linux Software — at 1:07 pm on Monday, July 14, 2008

Changing virtual terminals is almost essential for the Linux system administrator. If you don’t know what I mean by this then try pressing CTRL+ALT+F5 once you are there press CTRL+RIGHT ARROW until you get back to your display (should be two or so times depending on your distribution)

Until a few minutes ago I didn’t know that this could be done by the command line. chvt is a nifty command to change virtual terminal. Basically all you have to do is type “chvt 2″ to change to tty2. I found it while I was looking for a solution to open up a view of other active terminals.

This could be handy if your on a laptop or your function keys are missing / broken.

Suspend Scripts for the Toshiba Tecra M2

Filed under: Quick Linux Tutorials,Shell Script Sundays — at 12:15 am on Sunday, March 30, 2008

As you may know if you are a regular reader I own a Toshiba Tecra M2. One of the things that annoyed me was I had to turn the brightness up every time my computer came out of standby mode. A fix for this is to adjust the brightness every time the computer comes out of standby mode.

The script is intended to be run under cron. I have mine set up to suspend after 5 minutes of the lid being closed.

if [ $(cat /proc/acpi/button/lid/LID/state | sed 's/state:      //') == "closed" ]; then
VAR=$(cat /proc/acpi/toshiba/lcd | sed ‘s/brightness:              //’ grep -v levels);
sudo su -c “echo mem > /sys/power/state”;
if [ $VAR -eq 1 ]; then
elif [ $VAR -eq 7 ]; then
if [ $ACTION == "ADD" ]; then
VAR=$(($VAR + 1));
VAR=$(($VAR – 1));
sudo su -c “echo brightness:$(echo $VAR) > /proc/acpi/toshiba/lcd”;

I run this with the following cron entry:

*/5 * * * * sh

The script first checks the current brightness. If the brightness is currently 1 or 7 it adjusts the mathematic operation so that when the laptop is opened the brightness is adjusted. Basically if the brightness is one, it adds one. If the brightness is 7 or any other value it subtracts one. This is currently working out quite well for me. I don’t know how useful this is to any body else, unless you happen to have a Toshiba that is doing the same thing but it should give you a good overall idea of how to perform basic mathematic operations in bash.

Video Card Failure.

Filed under: Linux Hardware — at 11:59 pm on Thursday, November 29, 2007

Linux Blog - Video Card

At the moment I am a little unhappy with my Linux Box. It was making funny sounds (more than normal) the other night so I decided to turn it off. When I turned it back on, it was making even more racket. Turns out that my video card has been toasted, literally. The picture on the left shows the damage. Its pretty evident that the fan stopped spinning and burned up.

So much for my 128MB GeForce FX 5200.

I have an older GeForce laying around somewhere but I’ll have to use the legacy drivers. Until I find the card don’t fear I’ll be continuing to blog on my laptop. Which isn’t the best machine to use, but it will get the job done. Also from this experience I have thought of an blog post to write: dealing with hardware failure.