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 ?
Posted in CLI
No Comments »
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/48×48/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
Posted in Scripting & CLI, bash
No Comments »
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
Posted in Linux others..
No Comments »
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.
Posted in Life
No Comments »
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
Posted in Linux others..
No Comments »
October 20, 2008

gonna start to use my hammer!
Posted in Life
No Comments »
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.
Posted in Life
No Comments »
October 9, 2008
قبل ما يقارب السنه والنصف عزمة على بدأ ترجمة كتاب سلاكوير والموجود على هذا العنوان
كنت قد ترجمة بعض الوحد منه ولكن بسبب إنشغالي أو ممكن تكاسلي قد تركت العمل عليه، سأحاول في الفتره القادمه العمل من جديد على ترجمته.
الترجمه موجوده على هذا الرابط
Posted in Linux others.., Slackware
No Comments »
October 6, 2008
This is a quick howto build a simple GNBD server with one GFS Partition exported to two nodes, this two nodes will use this GFS Partition as document root for apache, i will use three XEN machines for setting up and they are running CentOS 5.2.
You can create this setup on RHEL 5.2 servers, no differences between CentOS and RHEL, but RHEL needs a registration on Advance Software to get some clustering packages which i don’t have, so when i used RHEL i did rpmbuild for some packages not exist on RHN, i will mention them later.
Also i used GFS 1 instead of GFS 2, reading from RedHat Linux-Cluster mailling list i noticed that GFS 2 is still unstable to use in production servers.
About Networking, I used a private subnet (10.0.0.0/24) locally, before starting, please make sure you have a working DNS or at least put entry for your machines with their IP in /etc/hosts file, for me i did that in /etc/hosts file on the three machines as the following:
10.0.0.1 n1.sqawasmi.com
10.0.0.2 n2.sqawasmi.com
10.0.0.7 gnbd1.sqawasmi.com
For Disk Partitioning, in the GNBD server i used 1G as GFS partition named xvdb1, nodes will import it.
Okay here we go, the following pictures display my GNBD server named gnbd1.sqawasmi.com and exporting GFS Partition through local network to n1.sqawasmi.com and n2.sqawasmi.com, there is a Load Balancer in front of n1 and n2, it balance coming load over our two nodes.

Installing RHCS needed packages:
yum install cman gnbd kmod-gnbd-xen lvm2-cluster kmod-gfs-xen gfs-utils
note that i installed kmod-gnbd-xen and kmod-gfs-xen packages which they are contain kernel modules for XEN kernel, if you are doing your setup on real machines then install kmod-gnbd and kmod-gfs instead of them. also i remember there was a difference in this packages names in CentOS and RHEL, i think in RHEL they named gfs-kmod and gnbd-kmod.
Configuring cluster.conf file:
The first step is to configure your /etc/cluster.conf file, this file is all what you want, it contains our nodes (n1,n2,gnbd1) and we will specify the fencing method that we will use, also we add our recourses (in our setup it will be our exported partition).
I used the following configuration:
<?xml version="1.0"?>
<cluster name="test-cluster" config_version="1">
<cman expected_votes="1">
</cman>
<fence_deamon post_join_delay="60">
</fence_deamon>
<clusternodes>
<clusternode name="n1.sqawasmi.com" nodeid="1">
<fence>
<method name="single">
<device name="gnbd" ipaddr="n1.sqawasmi.com"/>
</method>
</fence>
</clusternode>
<clusternode name="n2.sqawasmi.com" nodeid="2">
<fence>
<method name="single">
<device name="gnbd" ipaddr="n2.sqawasmi.com"/>
</method>
</fence>
</clusternode>
<clusternode name="gnbd1.sqawasmi.com" nodeid="3">
<fence>
<method name="single">
<device name="gnbd" ipaddr="gnbd1.sqawasmi.com"/>
</method>
</fence>
</clusternode>
</clusternodes>
<fencedevices>
<fencedevice name="gnbd" agent="fence_gnbd" servers="gnbd1.sqawasmi.com"/>
</fencedevices>
<rm>
<resources>
<clusterfs device="/dev/xvdb1" force_unmount="0" fsid="5391" fstype="gfs" mountpoint="/www/www-data" name="www" options=""/>
</resources>
</rm>
</cluster>
for explanation for cluster.conf scheme, refer to this page.
later, to be continue…
Posted in GNBD, linux-cluster
4 Comments »
Recent Comments