Running Bluetooth Headset on Linux

Date January 27, 2009

As i said before in a previous blog, i got a new headset as a gift from my uncle,, mm i tried to configure it in the first day but i failed,,, today i played again and yes i got it working,, here how i configured it. I use Fedora 8 (yes i know currently there is F10 ๐Ÿ˜› ), my headset vendor is Teac, you will need to install the following packages: bluez-utils, bluez-utils-alsa also gnome-bluetooth if you use gnome and wanna add it to the panel. now use hcitool to seach about the device:
[idle-boy@localhost Enigma]$ hcitool scan Scanning ... 00:1F:5C:87:95:D7 idle-BoY 00:09:DD:70:D9:AA Stereo Headset
Now set your Headset to paring mode and do the following command to connect (as root):
[root@localhost ~]# hcitool cc 00:09:DD:70:D9:AA
Add the following to your ~/.asoundrc file (a file alsa use):
pcm.bluetoothraw { type bluetooth device 00:09:DD:70:D9:AA profile "auto" } pcm.bluetooth { type plug slave { pcm "bluetoothraw" } }
thats all, at least for me ๐Ÿ™‚ ,, i use mplayer,, to play a song:
[idle-boy@localhost Enigma]$ mplayer -ao alsa:device=bluetooth */*
for more info and other players, see this Documentation: http://wiki.bluez.org/wiki/HOWTO/AudioDevices weeeeeew so nice to move your head without cables ๐Ÿ˜›

ext3 label

Date January 26, 2009

Yesterday i got a very nice gift from my uncle, he came 2 days ago from china ๐Ÿ˜‰ , a Imation 320GB External Hard Disk and bluetooth headset (eh am trying to configure it in linux!) maybe they are not that good because they are from china (this is what known in Jordan about china products ๐Ÿ˜› ) but they works ๐Ÿ˜€ . So i started partitioning my new hard drive :),, its a big one so i didn't know how to partition all of that space :/ , i just created one partition with 100GB size and ext3 as file system,, automount in linux is so nice feature, but the partition name after mounting it is ugly,, so i wanted to label the partition with a nice name,, ahhhh i talked to much ๐Ÿ˜› ,, this is the command to label ext3/ext2 partitions:
e2label /dev/sdc1 ext_shaker
Replace the partition (/dev/sdc1) with the one you want to set the label on, and 'ext_shaker' by your label. Now every time hal and gnome-volume-manager automount my external partition, it will mount it under /media/ext_shaker ,, so nice huh ? ๐Ÿ˜€

Work/Home switcher script

Date January 25, 2009

Recently, i decided to bring my laptop to the work, so i start using it and leaving my work PC as testing machine,, also connecting to online servers through it. In the work we used a static IP with a static gateway for each department, also with a specific resolv.conf configuration,, at home, i use another configuration for network and internet connection,, so every time i go home, i need to reconfigure the internet,, when i go to the work, i also need to reconfigure the network.. so i decided to write a script so it help me to automate this. Also as i said, i will use my work PC to connect to online servers, yes i can connect through my laptop, but when i go home i must connect to the work PC so i can connect to the online servers. mmmmm,, so my idea was to automate the network connection and also if am at the work then each terminal i open it must login directly to my work PC,,, also my mind didn't work from a long time maybe 3 months and i started to 4get many things so i need to refresh it somehow ๐Ÿ˜‰ the following is the script i wrote:
#!/bin/bash ##Default to be home :S whereIam='scripts/work-home/work' touch ~/$whereIam; while true do if [ -f ~/$whereIam ] then sudo /home/idle-boy/scripts/work-home/net_conf.sh 1 > /dev/null zenity --notification --window-icon=/usr/share/icons/Fedora/48x48/apps/redhat-main-menu.png --text 'I am in the work!'; rm -rf ~/scripts/work-home/work else sudo /home/idle-boy/scripts/work-home/net_conf.sh 0 /dev/null zenity --notification --window-icon=/usr/share/icons/HighContrast-SVG/scalable/emotes/face-wink.svg --text 'OoOpPps am home!?'; touch ~/scripts/work-home/work fi done
The script simply touch a file under ~/scripts/work-home/ named 'work',, if the file exist then am in the work,, if the file not exist then am at home,, also i used zenity so it display a notification so when i want to change mode i just click on it. for internet configuration i wrote the script /home/idle-boy/scripts/work-home/net_conf.sh , and i use sudo to run it as root,, the script is:
#!/bin/bash if [ $1 -eq 1 ] then ## work conf: #stop network /etc/init.d/NetworkManager stop /etc/init.d/network stop #configure eth0 /sbin/ifconfig eth0 192.100.80.196 netmask 255.255.254.0 #bring loopback interface up /sbin/ifconfig lo up #add gateway /sbin/route add -net 0.0.0.0 gw 192.100.81.9 #insert resolv.conf configuration #i always lock resolv.conf, so unlock it chattr -i /etc/resolv.conf >/etc/resolv.conf echo 'search maktoob.com' >> /etc/resolv.conf echo 'nameserver 127.0.0.1' >> /etc/resolv.conf echo 'nameserver 192.100.81.9' >> /etc/resolv.conf #lock it again chattr +i /etc/resolv.conf else ## home conf: #bring up the network and NetworkManager #i use NetworkManager to connect to wlan, so it take everything from the router via DHCP /etc/init.d/network restart /etc/init.d/NetworkManager restart #i don't like getting resolv.conf configuration via NetworkManager, am home!,, so: chattr -i /etc/resolv.conf > /etc/resolv.conf echo 'nameserver 127.0.0.1' >> /etc/resolv.conf echo 'nameserver 212.118.0.1' >> /etc/resolv.conf echo 'nameserver 212.118.0.2' >> /etc/resolv.conf chattr +i /etc/resolv.conf fi

RHEL 5.3 Released

Date January 24, 2009

Today, i was tuning a RHEL 5.2 server,, editing some variables like variables located in limits.conf file,, after i finished from tunning it,, i wanted to reboot the system to get the new variables, but i always do yum update before reboot,, this is a production server and i can't reboot it every day ๐Ÿ™‚ and woops here we come,, the output of yum was too long and the tail of it is: Transaction Summary ============================================================================= Install 10 Package(s) Update 227 Package(s) Remove 2 Package(s) weew what all of this packages are all about!?! i didn't update this system from a long time!? strange, okay okay proceed,, after it finished i wanted to know this system release, is RHEL 5.1 or 5.2,, so cat /etc/redhat-release oOOoOPps 'Red Hat Enterprise Linux Server release 5.3 (Tikanga)' weeeeew 5.3!!? whaaat and when!!? so nice,, it released from 3 days ago ๐Ÿ˜€ and i just noticed that. btw,, in old releases i remember that update do 'update' for the system, and upgrade do the 'upgrade' for the system,, did they change something or am i wrong,, yes seems i am :S eh! Release notes is here, anyway,, nice to know that there is a new RHEL release with a new updates a features, and nice to know things by chance or by mistakes ๐Ÿ˜›

Cisco Programming Contest – US$100,000 Total Prizes

Date October 26, 2008

"think outside the box". "Finalists will develop their proposed applications on the Cisco AXP platform, and will have remote access to a Simulation Lab hosted by Cisco for developing their applications. "Finalists will present their implementations to a panel of experts comprising senior-level Cisco executives along with other industry luminaries. We will select three winners based on weighted judging criteria" here is the complete story.

Damn! No Dom0 Support in Fedora 10

Date October 23, 2008

In my laptop, I still use Fedora 8 because it support Dom0, i waited Fedora 10 final release because it suppose to support Dom0, Fedora 9 didn't has this support, i just noticed that Fedora 10 will also not support Dom0: http://fedoraproject.org/wiki/FWN/Issue146#Fedora_Xen_List http://www.mail-archive.com/fedora-xen@redhat.com/msg02344.html I will stay with fedora 8 even eol ๐Ÿ™

3’sbn 3annak oktoob 3araby :P

Date October 20, 2008

keeef ma eja lazem tooktob 3rby http://www.yamli.com/ar/ ๐Ÿ˜›

Can your hammer do that ??

Date October 20, 2008

gonna start to use my hammer!

Malal!

Date October 19, 2008

eh, from three days, mosh 3aref leeeh 7ass fe malal kbeer, i don't read RSS feeds, i don't read new posts in forums, i don't search about tut,i play chess too much, i play other games, i sleep every 1 hour about 10 minutes, i think too much, i smoke much more, weeeeeeeeeeeeeeeew what's happen!!! i am losing my interests in this life ๐Ÿ˜› ffffffffffffffffffffffffffffffffffffff!! i think this situation will be changed just by one thing and i think will do it soon to 4get this life.

ุงู„ุนูˆุฏู‡ ู„ุชุฑุฌู…ุฉ ูƒุชุงุจ ุณู„ุงูƒูˆูŠุฑ

Date October 9, 2008

ู‚ุจู„ ู…ุง ูŠู‚ุงุฑุจ ุงู„ุณู†ู‡ ูˆุงู„ู†ุตู ุนุฒู…ุฉ ุนู„ู‰ ุจุฏุฃ ุชุฑุฌู…ุฉ ูƒุชุงุจ ุณู„ุงูƒูˆูŠุฑ ูˆุงู„ู…ูˆุฌูˆุฏ ุนู„ู‰ ู‡ุฐุง ุงู„ุนู†ูˆุงู†

ูƒู†ุช ู‚ุฏ ุชุฑุฌู…ุฉ ุจุนุถ ุงู„ูˆุญุฏ ู…ู†ู‡ ูˆู„ูƒู† ุจุณุจุจ ุฅู†ุดุบุงู„ูŠ ุฃูˆ ู…ู…ูƒู† ุชูƒุงุณู„ูŠ ู‚ุฏ ุชุฑูƒุช ุงู„ุนู…ู„ ุนู„ูŠู‡ุŒ ุณุฃุญุงูˆู„ ููŠ ุงู„ูุชุฑู‡ ุงู„ู‚ุงุฏู…ู‡ ุงู„ุนู…ู„ ู…ู† ุฌุฏูŠุฏ ุนู„ู‰ ุชุฑุฌู…ุชู‡.

ุงู„ุชุฑุฌู…ู‡ ู…ูˆุฌูˆุฏู‡ ุนู„ู‰ ู‡ุฐุง ุงู„ุฑุงุจุท