Wednesday, February 14, 2007

Using Bluetooth with Nokia 6230i and Fedora


Sometimes I think about all those people carrying around this cool mobiles in their pockets, just because they are the newest ones, or have a nicer color... And most of the time much of the neatest features are just ignored. Take bluetooth for example. Most people don't know even what this is, or they just use it to exchange that funny ringtone... or that naughty wallpaper. But Bluetooth gives you so much more. Other good example is SyncML... and we could go on like this for ages.. as mobiles get more more advanced by the hour.

But right now we are here to create a simple connection with your distinguished, trustworthy and able Linux box and that sexy mobile of yours.

I am using a Bluetooth USB Dongle from D-link, and it works like a champ.

Just plug it into the linux box, and then type (in Fedora...)

#service bluetooth start

So the scenerario is set, lets move on.

Let's see if the dongle was correctly recognized:
#hciconfig -a
hci0: Type: USB
BD Address: 00:15:E9:69:F4:78 ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:8070 acl:192 sco:0 events:481 errors:0
TX bytes:6708 acl:182 sco:0 commands:169 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: ACCEPT MASTER
Name: 'Linux BOX'
Class: 0x000100
Service Classes: Unspecified
Device Class: Computer, Uncategorized
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

everything looks nice.


Now be sure to turn on your mobile's bluetooth radio.

lets see if linux can find the device:

#hcitool scan
Scanning ...
00:15:E9:69:F4:78 Alex's Nokia

That strange HEX address is the unique identifier of your mobile. Think of it as your mobile's bluetooth radio MAC address.

lets ping the mobile from the server

# l2ping 00:E0:03:58:3F:35
Ping: 00:E0:03:58:3F:35 from 00:15:E9:69:F4:78 (data size 20) ...
0 bytes from 00:E0:03:58:3F:35 id 0 time 51.84ms
0 bytes from 00:E0:03:58:3F:35 id 1 time 40.27ms
0 bytes from 00:E0:03:58:3F:35 id 2 time 27.24ms
3 sent, 3 received, 0% loss

pretty neat huh? Ok so now we are sure that they can see each other... lets get them to talk\

# rfcomm connect rfcomm0 00:E0:03:58:3F:35
Connected /dev/rfcomm0 to 00:E0:03:58:3F:35 on channel 1
Press CTRL-C for hangup


That is it!!! now your mobile and computer with a little tweaking is able to exchange contacts.. files, connect to the internet using the mobile's GPRS service, send receive SMS, and so on... but we will get into this in some other post!


Good luck!!






Friday, February 9, 2007

Finding large files in a linux filesystem

This is a small, "note to self" kind of post. Sometimes it is useful to know what files are taking up the most space in our filesystem. Very useful under stressful times like when your server has a 100% filled partition. It can be done this way:

find / -size +10240000c -exec du -h {} \;

This will find files larger than 10Megs.

Now i won't forget next time!!!

Hope this is useful for you as well!

Thursday, February 8, 2007

Hamachi!


Every few months (even years) i stumble into this piec
e of software that makes me feel like i'm receiving my Atari 2600 for Xmas all over again. HAMACHI falls just right under that category. Unlike its distant cousin Tamaguchi it is not a little device with an animation that you have to feed, take care and play with...

Quoting their website: "Hamachi gives you a LAN ove
r the internet." As easy as that. And what I like about it the most is that it plays well with others. It runs in Windows, Mac OS X, and Linux. What more can you ask for? (Ok,ok.ok... i can already hear some BSD, Solaris, Palm OS people shouting...).


Check out my current setup:


No matter where i am with my laptop... i can always reach all of my files, even from the Mac G5! So far so good. I've been testing and the speed is not that bad (no Formula 1 trophies either...).

Windows installation is pretty straight forward... so lets focus on getting hamachi running on the linux box.

You may download the package from here

As of this posting the version for linux file is hamachi-0.9.9.9-20-lnx.tar.gz

let's play:

#tar -xvzf hamachi-0.9.9.9-20-lnx.tar.gz
# cd hamachi*
#make install
#tuncfg (for MacOS users... there is an extra step involved so you can get a tun device in Darwin)
# hamachi-init
Initializing Hamachi configuration (/root/.hamachi). Please wait ..

generating 2048-bit RSA keypair .. ok
making /root/.hamachi directory .. ok
saving /root/.hamachi/client.pub .. ok
saving /root/.hamachi/client.pri .. ok
saving /root/.hamachi/state .. ok

Authentication information has been created. Hamachi can now be started with
'hamachi start' command and then brought online with 'hamachi login'.

# hamachi start

# hamachi login
Logging in ....>....... ok (this is were you connect to the hamachi network)


Now you will need to create your own network, in this example im creating the "mytestnetwork1" network with a password of "mypassword". (I've been blessed with creativity this morning).

#hamachi create mytestnetwork1 mypassword

Ok, so we should name our linux server something, lets call it CONAN (the comedian, not the barbarian).
#hamachi set-nick CONAN
#hamachi go-online mytestnetwork1
password:*******

lets get everyone names...

#hamachi get-nicks
#hamachi list

There you will notice that you get a 5.x.x.x IP address... that is your address on your Hamachi network. Now you can use that IP to use shared drives... get webpages... whatever you want from your network!


Cool huh? try it out!