Tag: debian

Aptitude Easter Egg

This Easter Egg has been around for a while, but I just discovered it from Wikipedia. Really geeky. :)

Debian Aptitude Easter Egg


Updating iPhone to iOS 4 in Vmware

While updating my iPhone 3GS to iOS 4, I encountered an error on iTunes saying that my iPhone could not be updated. My phone went into recovery mode after that. This is not the first time I’m doing restore and update with Vmware, so I’m pretty surprise why the update process failed.

A peek into dmesg shows the following -

[52420.444795] usb 2-2: usbfs: interface 2 claimed by ipheth while ‘vmware-vmx’ sets config #4
[52420.460159] usb 2-2: usbfs: process 9345 (vmware-vmx) did not claim interface 2 before use
[52420.460222] usb 2-2: usbfs: process 9345 (vmware-vmx) did not claim interface 2 before use

Linux is now capable of detecting the iPhone over USB natively and automatically via the iPhone for tethering and direct access to the underlying filesystem, so it’s hogging the USB port on the iPhone and denying Vmware of accessing it.

Anyway the solution is simple. Just run

# rmmod ipheth

#  dmesg

[52445.922401] usbcore: deregistering interface driver ipheth
[52445.964038] ipheth 2-2:4.2: Apple iPhone USB Ethernet now disconnected
[52491.228075] usb 2-2: reset high speed USB device using ehci_hcd and address 21
[52491.524073] usb 2-2: reset high speed USB device using ehci_hcd and address 21

Linux releases the iPhone. On Vmware, disconnect and connect the iPhone again.


Update: Native Tethering To IPhone On Linux

I missed out something important in my previous post on the native tethering on Linux. Turns out my tethering works only after I kick off the tether from Windows (Which resides in a VM on my machine). Further digging led me to the following site.

http://giagio.com/wiki/moin.cgi/iPhoneEthernetDriver

In order to get tethering to work, you need to ‘pair’ the IPhone with your machine. The site above provides the source to the pairing program, which surprisingly isn’t part of any Debian package. Or at least I couldn’t find it. Someone please point me to the right package if there’s one.

Anyway, just follow the instructions on the site to checkout the source from GIT and compile ipheth-pair. Plug in your IPhone and check your dmesg for the following:

[40883.744096] usb 2-1: reset high speed USB device using ehci_hcd and address 10
[40883.905582] ipheth 2-1:4.2: Apple iPhone USB Ethernet device attached

Run ipheth-pair if your IPhone has been picked up and loaded successfully.

Leave the rest to Network Manager. Just connect to wwan0 like connecting to any other devices.


Native IPhone Tethering On Linux (Debian)

For some reason, I can get tethering to work natively on Linux after I did an upgrade on my unstable Debian.

This was not possible previously. Now the kernel detects a new device called ipheth (IPhone USB Ethernet device). This is the magic that made the tethering possible. And the best part is that it works out of the box with Network Manager.

This is really cool. I used to tether from Linux using Bluetooth, but the connection is unstable sometimes.

Screenshots of dmesg output etc. Click for the full size image.

I’m running the unstable distro of Debian, so I’m not sure if this is available on the stable release. It might be possible on Ubuntu, since they get all the cutting edge stuff.


IPhone Tethering – Use and Abuse!

This is the geeky sequel to my last Linux to IPhone tethering episode where we used and abused the IPhone tethering function.

Some background, I’m one of those people who contracted (and got stuck) with the 50G SingTel Mobile Broadband Plan before the days of 12GB IPhone plan. My usage was about 4G per month, so none of the plans was suitable for me at that time.

Anyway, that aside. For some reasons my team had to work in a place where we had no internet access while we are building the network for high speed internet access. What irony! The only systems engineer in the team (me) decided that I had alot of data to spare, so here we go…use and abuse!

Configuration’s simple. First you have to setup tethering as per my previous post on IPhone tethering. Once you are done with that, do the follow steps. And again, it’s a 5 minute quick hack.

1. vi linux-router.sh

2. Paste the following into the shell script

#!/bin/bash
/sbin/ifconfig wlan0 192.168.0.1 255.255.255.0
/sbin/iptables -t nat -A POSTROUTING -o bnep0 -j MASQUERADE
/sbin/iptables -A FORWARD -i bnep0 -o wlan0 -m state –state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i wlan0 -o bnep0 -j ACCEPT

3. Save the file.
4. chmod 700 linux-router.sh
5. ./linux-router.sh
6. Done!

My colleagues are connected to a WIFI router, hence the use of wlan0 as the “inside” interface. bnep0 is the “outside” interface connected to the IPhone via bluetooth. All the machines point to my laptop as the gateway, which bears the IP address 192.168.0.1. All of them are NAT’d out from the outside interface.

I have 2Mbps for my plan. Good enough for the team to check email and do some simple web browsing for information.

There are other things you can do like transparent proxying so that you save abit of bandwidth.

Leave a comment if you have any questions on the configurations. Have fun!


Linux to IPhone Tethering In 5 Mins

Tethering from a mobile phone is not new to me. I started from the days of having to script the ppp chat scripts to wvdial to finally having Network Manager recognizing my mobile phone as a 3G modem.

IPhone is new. I have been reading about tethering on Linux as soon as I bought it. Painful ways, jailbreak, run proxy etc etc etc.

Linux didn’t recognize the IPhone as a modem when I plugged in via USB, so it’s only bluetooth now. I tried the tethering of my Mac first. With bluetooth, I found that tethering actually happens over the PAN (Personal Area Network). That should work with Linux, and so it did.

These are steps for me to get tethering on Debian in 5 mins.

1. Run “sudo aptitude -y install blueman” in Debian.

2. Logout and login again. This is for the dbus and stuff to react correctly when you turn on your bluetooth later on.

3. Turn on your bluetooth or insert your USB bluetooth dongle. A bluetooth icon should appear in your system tray or whatever you call it in Gnome. That’s Blueman.

4. Discover and add your IPhone in Blueman

5. Turn on Internet Tethering under “Settings –> General –> Network”. Choose Bluetooth.

6. Go back to your Blueman, click on it and you should see your IPhone. Right click on your IPhone and select “Network Access Point”

7. And you are done!

That’s it! Simple right? No hacking, no jailbreak!

Do drop me a comment if anything’s unclear. The same solution should work with any of the modern distros like Fedora and Ubuntu.


SCIM in Debian Lenny for Chinese Input

I have to struggle with this whenever I had a new Debian installation. SCIM does not work out of the box in Debian, so there’s some minor configurations to do. But I failed to note it down anywhere, just happily relying on Google.

So yet again, I have a new Debian Lenny installation on my new notebook. And the same story again, I got to search all over Google for the instructions to make it work. So this time round I decided to note it down here so that I can “Read My Own F$#king Manual” next time as well as for the benefit of others.

Step 1:

Install the fonts

aptitude install ttf-arphic-bkai00mp ttf-arphic-uming ttf-arphic-gkai00mp ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp ttf-arphic-ukai xfonts-intl-chinese unifont ttf-unifont

Step 2:

Install all the scim related packages

aptitude install scim-pinyin uim-pinyin scim-uim scim-chinese scim-tables-zh

Step 3:

im-switch -c

Select scim and save.

Step 4:

Restart your session by logging out and logging in again.

You should have your SCIM work after that.


New Bluetooth Kernel Module Doesn’t Play Well

Recently got a mini usb bluetooth dongle. Sad thing is that I found that it doesn’t play well in the latest version of Ubuntu. Did a quick search on Google and found that it’s because of the new btusb kernel module in the latest kernels. The old kernels were using hci_usb.

I booted up Debian with kernel 2.6.24 to verify and the dongle works perfectly. I was actually worried that the dongle I got was faulty. Now I’m contemplating compiling kernel 2.6.32 to see if the problem gets fixed. Still reading through the release notes of 2.6.32 though.

Better ideas anyone?


  • My Tweets

  • Copyright © 1996-2010 YiBi's Life|Live Log. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress