Monday, December 7, 2009

Moving to wordpress

I have moved my blog to wordpress. Please update your bookmarks to arunsag.wordpress.com . Thanks :-)

Saturday, October 31, 2009

Micro blogging with emacs addons


Emacs has become my favourite application these days, Its now part of my digital life. I always wondered why i have missed such an nice app before.

For those who are n00bs and non-geeks goto http://www.gnu.org/software/emacs/tour/

Emacs-color-theme:
Makes life colourful :D. It hasn't made into Fedora repository yet, But package review is on at https://bugzilla.redhat.com/show_bug.cgi?id=501101

Add the following to your ~/.emacs file to get it working
(require 'color-theme)
(color-theme-initialize)
(color-theme-robin-hood


Emacs-jabber:
I used it to connect Gtalk from emacs, FYI gtalk uses a open protocol named XMPP (jabber).It is a great app. Find the package review request at https://bugzilla.redhat.com/show_bug.cgi?id=508316

Add the following to your ~/.emacs file to get it working
(setq jabber-account-list
'(("email@gmail.com"
(:network-server . "talk.google.com")
(:connection-type . ssl))))


Back to Micro blogging:

Identi.ca is a free software microblogging service, similar to Twitter, based on the Laconi.ca code base. It has a Twitter bridge, which means you can associate your twitter account to identi.ca , so that the notices you post to identi.ca will be posted to your twitter account too;

It has a XMPP bridge, which means you can post notices to identi.ca from gtalk (gtalk uses XMPP). To post notices to identi.ca using gtalk add update@identi.ca bot to your gtalk contacts list and activate the bridge in identi.ca .

Facebook has a identi.ca app http://apps.facebook.com/identica/, which fetches notices from your identi.ca account and posts updates in facebook;

So the tree goes like,
XMPP (gtalk)-> Identi.ca ->{Twitter,facebook}

Now, the heck it relates to emacs? yes, use emacs-jabber and msg update@identi.ca to post notices;

BitlBee:

Alternatively, you can use BitlBee; BitlBee brings IM (instant messaging) to IRC clients. It's a great solution for people who have an IRC client running all the time and don't want to run an additional MSN/AIM/whatever client.

Bitlbee and erc can be combined to get a good experience;

Configuring bitlbee:
cat /etc/bitlbee/bitlbee.conf |grep -v "#"
[settings]

RunMode = inetd
User = bitlbee
DaemonInterface = 127.0.0.1
DaemonPort = 6667
ClientInterface = 0.0.0.0
AuthMode = Open
ConfigDir = /var/lib/bitlbee/
PingInterval = 0

[defaults]


We use xinetd to run bitlbee:
bash-4.0$ cat /etc/xinetd.d/bitlbee
# default: off
# description: bitlbee is an IRC gateway to other IM networks.
service ircd
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = bitlbee
bind = 127.0.0.1
server = /usr/sbin/bitlbee
type = UNLISTED
port = 6667
log_on_failure += USERID
}


Start xinetd,
service xinetd start
chkconfig xinetd on


Now in emacs,
M-x erc
IRC Server: 127.0.0.1
IRC Port:6667
Nick:zer0c00l
Password:


Above erc commands should get you inside bitlbee's local irc server;

Register your nickname:

You should register your nick with local bitlbee irc server using,
register 'password'


(Don't forget to auto identify =P )

Add your IM account(s):
account add jabber email@gmail.com 'password'


Activate your IM account(s):
account on 0

Now it should automatically connect you to gtalk; Bitlbee supports Various IM networks including yahoo;

Identica Mode for Emacs:


If you don't want wasting your time with bitlbee, emacs-jabber and XMPP bridge; Then emacs-identica-mode is the one for you;Its under review at https://bugzilla.redhat.com/show_bug.cgi?id=532241

Identica mode for emacs HOWTO: http://blog.nethazard.net/identica-mode-for-emacs/

Thursday, August 20, 2009

Setting up a Network installation Server

Couple of days back , i have installed nearly 100 machines of my alma mater's lab with Fedora 11. I used PXE based network installation instead of using DVD's on each machine.I tried to document it here, as it might help someone who tries to do the same in future.

To install Fedora , we need the iso image (DVD) inside the hard disk. If you have a DVD but not the iso file its easy to create the iso file from DVD, just insert the DVD inside the machine and issue the following command,

dd if=/dev/sr0 of=/media/disk-1/fedora11.iso



Install following packages in your existing Fedora installation by using,

yum install httpd syslinux tftp-server dhcp system-config-kickstart


Configure TFTP server:

The TFTP Server configuration file is stored in /etc/xinetd.d/tftp

Example configuration file,

service tftp
{
disable = no
socket_type =
dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot/
per_source = 11
cps = 100 2
flags = IPv4
}



Note the server_args variable , it refers to the TFTP root.

start the TFTP server using,
/etc/init.d/xinetd start


Configuring DHCP:

The DHCP configuration file is stored in /etc/dhcpd.conf
Sample configuration file:

allow booting;
allow bootp;
ddns-update-style interim;
ignore client-updates;
authoritative;
subnet 172.16.16.0 netmask 255.255.240.0 {
option subnet-mask 255.255.240.0;
option broad
cast-address 172.16.31.255;
range dynamic-bootp 172.16.28.2 172.16.28.240;
next-server 172.16.24.199 ;
filename "pxelinux.0";
}



Note 1:
In above sample configuration file, next-server is the IP address of your TFTP server.
The IP addresses in above configuration file should be adjusted according to your network.


Note 2:

If DHCP fails to start, check /var/log/messages for error messages.

Start the DHCP server using,
/etc/init.d/dhcpd start

Using Kickstart:

Kick start file is used to automate the installation process,

Open kickstart file creator by issuing following command,
system-config-kickstart


When configuring kickstart using GUI, it should be noted that, the "Installation Method" should be "HTTP" , "HTTP server" field should be the IP address of machine which is having Fedora DVD dump. The "HTTP Directory" should be the directory in which you dumped (mounted) the iso file (here it is 'fedora11').

The packages to be installed can be preselected from the GUI tool.

After selecting various options from the kickstart GUI tool, save the file as ks.cfg.


Setting up Apache Webserver:

I have assumed my machines IP address is 172.16.24.199

Create a folder named fedora11 in /var/www/html/ (need to be root)

Mount the Fedora's ISO image (needs to be root) inside /var/www/html/fedora11/ using,
mount -o loop /media/disk-1/fedora11.iso /var/www/html/fedora11/


Copy the ks.cfg (kickstart file) inside /var/www/html/

Start Apache webserver using,
service httpd start


Copying files to TFTP root:

Create a directory named /tftproot

Copy the kernel (vmlinuz) and ramdisk (initrd.img ) from the DVD and paste it in /tftproot/ directory. (you can find kernel and ramdisk in images/pxeboot/ directory of the installation media or the ISO file.)

Copy the /usr/share/syslinux/pxelinux.0 inside /tftpboot/ directory.

Create a directory named /tftpboot/pxelinux.cfg

Create a file named 'default' and place it inside /tftpboot/pxelinux.cfg/ directory,

The content of the 'default' file should be,

DEFAULT pxeboot
TIMEOUT 10
LABEL pxeboot
KERNEL vmlinuz
APPEND initrd=initrd.img ksdevice=eth0 ks=http://172.16.24.199/ks.cfg lang=en_US keymap=us
ONERROR LOCALBOOT 0



Booting clients:

Switch on the machine in which you wish to install Fedora, enter into Bios setup and Enable PXE booting with LAN. Set the first boot device to network interface card (if required) and start booting from the network. Thats it!

Further Reading:
Cobbler - Installation server https://fedorahosted.org/cobbler/
ks.cfg - Sample kickstart file http://sagarun.fedorapeople.org/misc/ks.cfg

Sunday, August 2, 2009

What i am up to these days

Whenever some one ping's me in gtalk the first question he/she asks is "What doin?" "vetti?" ( 'vetti' means scratching the chair/bench without doing/having any job to do :P)

I am really tired of answering those people, how many times i can sing the same song to each and everyone? so i decided to write what really i am up to these days.

I am happy to announce that, i finished my dgplug summer training task, which is "Kannel SMS setup on fedora" check it out http://wiki.dgplug.org/index.php/SummerTraining09:Projects/Kannel_SMS_setup_on_fedora


Then i joined Indradg's intern ship, and did following tasks

Configured squid http://www.burntomlette.in/index.php?title=Squid

Configured OpenLDAP and made squid to authenticate it users with OpenLDAP http://www.burntomlette.in/index.php?title=Squid_authentication_with_LDAP

Indradg wanted me to use Fedora-DS instead of OpenLDAP , so i did the same.
http://www.burntomlette.in/index.php?title=Squid_authentication_with_FedoraDS

Currently i am working on a piece of php code which i wrote for a website and trying to port it under codeigniter framework.

In the mean time i am keeping an eye on spechards MediaSpy project ;) and Qt software.

Finally, Yesterday my Head Of the Department has asked me to have a look inside my alma mater's IBM blade server and configure mail, so have to work on it :) !

Tuesday, July 7, 2009

My response to subverted national draft policy on open standards

Pro-Microsoft entities like NASSCOM,MAIT are trying to subvert the Draft policy on open standards crafted by GOI by changing it in last minute.
Download the subverted draft from here.Everything seems ok, except the section 6.

In response to the subverted draft, i have sent an email to those who are relevant as urged by this post.

===
Dear Sir,

I am an engineering graduate from TamilNadu. I happened to read the updated (subverted) National draft policy on open standards from http://fosscomm.in/OpenStandards?action=AttachFile&do=get&target=Policy_On_Open_Standards_V2.pdf .

I strongly disagree with section 6,which has been introduced to favour proprietary software companies like Microsoft.Why there should be mandatory characteristics in section 5 , as they can be overlooked as specified in section 6.

More than one standard will create lot of confusion.There is no use in this Policy if you go ahead with section 6.

I came to know that section 6 was introduced by NASSCOM and MAIT who always favour the people who they do business with (Microsoft)(no ethics only profit?).

I would like to give you some pointers regarding the reactions in electronic media about the policy change:

1. http://lists.fosscom.in/pipermail/network-fosscom.in/2009-July/000346.html
2. http://osindia.blogspot.com/2009/07/last-minute-dramas-around-around-open.html


Thanks and Regards
Arun SAG


--
A computer is like air conditioning: it becomes useless when you open windows.
<-Fighting 4 Freedom->

===

Similarly kapil has sent an explanatory reply on the subverted draft, you can find the copy of his response here.

Saturday, July 4, 2009

Getting started with Git and Gitorious


This is my small 'how to' regarding Git and Gitorious.Its targeted towards the beginners.

For Git mbuf has created a nice presentation named "di-git-ally-managing-love-letters" :),i suggest beginners to read and understand it first.

Link to the presentation:
http://shakthimaan.com/downloads/glv/presentations/di-git-ally-managing-love-letters.pdf

He explained the slides in an IRC classroom session, the logs of that class is available in dgplug's wiki

Link to the his session logs:
http://www.dgplug.org/irclogs/2009/2009-06-30_mbuf_git.log

The above two materials can be used as an excellent how-to for Git beginners.

Gitorious:

Gitorious is a website that provides you with infrastructure to manage your project.It uses Git as a Version Control System.

Using Gitorious:

1.You need to create an account in Gitorious.Its fairly simple and straight forward.

2.You need the public key to be uploaded (copied and pasted) in Gitorious.

Creating a public key:

Install openssh:

sudo yum install openssh


Run ssh-keygen:

bash-3.2$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/zer0c00l/.ssh/id_rsa):/home/zer0c00l/.ssh/id_rsa_test
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa_test.
Your public key has been saved in /home/zer0c00l/.ssh/id_rsa_test.pub.
The key fingerprint is:
fb:db:03:4d:43:ca:37:02:0f:b6:90:22:ca:71:60:15 zer0c00l@localhost
The key's randomart image is:
+--[ RSA 2048]----+
| ooE. . |
|..... o + . |
|..o. . o * o |
|.. . = = |
| S = o |
| .. . |
| . . |
| . .. |
| o... |
+-----------------+
bash-3.2$


Note: The password need not be your root or current user accounts password.

The public key will be stored in: /home/(yourusername)/.ssh/id_rsa.pub

bash-3.2$ cat /home/zer0c00l/.ssh/id_rsa_test.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0nQ56VUU7nHjBWZPUja1nsCofdYfJhAu9XZtcixKBTZp6lKgQxnOwXYszhk6W9eV/GRcht3DL7L6i1pnyc8vic1xpC9/tkMcwEkglLhWfN3SNR6MmNPTb4mM1DeLCdyd5f7Ff6kYgy2s8RmYBf2YopfbMUlyXIlKec1AHIsqvG+YixCMTOpl5io0619ac1R0xaP6E7h8hepvUEGcKmBnuxg8UhEifj+m3NG3XJvWWUx1zTvB1CXyFNx3qiFj+UxkdrmeDO/PdEPd9HcaN1jX3e1Y+jqUD8QdlEVAC9tkGIN6mG3BpVgWdsRlMtEFUPsHPFGC6tmjzuJAVOT1Hk5ROQ== zer0c00l@localhost
bash-3.2$


So copy it and paste the public key in Gitorious.

Note: Don't copy my key :P, you don't know the password.

3.Create a project

http://gitorious.org/new

4.Add repositories

5.Push the code from your local Git repository to remote Gitorious repository.

Gitorious provides users with possible workflow commands relevant to each operation.(see screen shot for more details )

Edit: If you want to start and don't know where to begin, start cloning my code ;)

git clone git://gitorious.org/kalaisurabi_php_code/mainline.git

Wednesday, July 1, 2009

My Summer Training Task:Kannel SMS setup on fedora

I came to know about dgplug's summer training when kushal announced it in ilugc,i didn't know mbuf will be there to guide us [:)] ,my task in summer training is to setup a SMS gateway on fedora with kannel, test it and document it.

With the help of kannel you can send/receive sms from your GNU/Linux box.(Don't just think of some third party text message sending sites [:P], its more than that )

Here are the use case scenarios i am trying to address:

* User sends us a text message.

* We might send them a reply after processing it (web application is used to process the text message).

* We might also periodically able to send the user text messages.

I successfully completed testing the last use case and in the process of documenting it.

I always wanted to create a desktop app for GNU/Linux with GTK+ ,i am thinking of picking up another project after finishing this task [;)].

Apart from summer training i am now teaching php in a private training centre for free,you know what teaching is the best way for doing some GNU/Linux advocacy [:D].

btw: Switch to firefox 3.5 ;)