Tuesday, November 24, 2009

Image magick

Few days ago, i was given a task to create a gallery for a website. The images i got were around 3000x2000 resolution, each having 3 MB size. I thought to down scale those images so that i could easily upload and manage them in the gallery of the website. Then came "Imagemagick" into the scene. With just a line of shell command i converted 300 odd images into 600x400 resolution.


:~/ convert *.JPG -scale 600x480 output.jpg

You need to have the imagemagick package to use this command. You can just do an

:~/ apt-get install imagemagick

The output files will be created like output-0.jpg, output-1.jpg, etc...

Thursday, September 3, 2009

Agave - Color scheme generator


AGAVE is a package available for GNU/Linux, which enables to choose color schemes easily. It generates contemprary colors to a color choosen, making the task of a theme developer easier. The most important option obtained by the package is the eyedropper (The tool used to get color code of any color visible on the screen). This is the most important option for any theme developer.

Tuesday, June 9, 2009

Lynx - Terminal Browser

Lynx is a cursor-addressable browser which can run on terminal itself. The coolest part is that it runs with cool colors and is also easily navigable using direction keys and some confirmation keys. It prompts for some actions to press (y | n .... and adds more functionality to it.

Monday, June 8, 2009

Configuring Nagios

Nagios is a Network monitoring software which uses samba server to serve the localhost with all the monitored information of the network. It actively monitors specified services on specified hosts. I was looking for a tool to put it in the server of the computer lab so that we could do some remote monitoring of the clients. I was successful a bit, as i couldn't remotely ssh clients to run some scripts. I think i have to work more on it so that i could learn all the features of Nagios.

Configuring Nagios

I followed the guide provided by http://www.myelin.co.nz/post/2008/10/30/#200810301 . I successfully confgiured Nagios on a system. The toughest job was to put all the hosts on the hosts.cfg file in the nagios3/conf.d/
I had manually enter all the 150 odd local ip's in the file. Then success came fast then expected. i was seeing screen which filled my heart with happiness. Nagios is a perfect package for remotely monitoring clients.


I also consulted some guys on irc chat who specified to use these tools for remotely running shell scripts on clients :

1. DSH
2. PyDSH
3. Puppet
4. CFengine
5. Fai-server

If time allows, i would explore the above mentioned and put them in my blog. Or may be i would unlock the ssh feature in Nagios itself.

Sunday, June 7, 2009

Using grep and cut

Grep and cut are some of the tools used for text processing. They use regular expressions to filter out specific terms in a file


Task :
To find out the IP Address from Ifconfig

Solution :
ifconfig eth0 | grep "inet addr" | cut -d ":" -f 2 | cut -d "B" -f 1

Explanation :
1. ifconfig eth0 (Displays network settings for your pc)
2. grep "inet addr" (Filters lines to the line containing string "inet addr")
3. cut -d ":" -f 2 (Cuts the obtained line into columns using delimiter ":" and then displays the 2nd column)
4. cut -d "B" -f 1(Cuts the obtained line into coumns using delimiter "B" and then displays the 1st column)

Configuring the Apt-Cacher

Apt- cacher is an nice package in Debian distro, which helps in saving a lot of bandwidth by caching the downloaded packages from the internet. If a client requests a package it is served from the local cache. If the package doesn't exist in the cache, it is fetched from the internet, copied to the cache and then served to the client.

Configuring the Apt-Cacher

First i will install the Apt-cacher and then import the packages from a mounted image of Debian distro.

1. apt-get install apt-cacher
2. nano /etc/default/apt-cacher (Change AUTOSTART=1)
3. nano /etc/inetd.conf (Add line "3142 stream tcp nowait www-data /usr/sbinc/apt-cacher/apt-cacher apt-cacher -i")
4. mount -o loop debian.iso /mnt/
5. /usr/share/apt-cacher/apt-cacher-import.pl -Rr /mnt/
6. nano /etc/apt/sources.list (Add line "deb http://ftp.us.debian.org/debian lenny main contrib non-free")
7. apt-get update
8.
nano /etc/apt/sources.list (Add line "deb http://localhost:3142/ftp.us.debian.org/debian lenny main contrib non-free")
9. /etc/init.d/apt-cacher restart
10. apt-get update

Hi Guys

Hi people. I have joined a free software community "Swecha" which is growing wildly in the south-eastern region of India. It has contributed in the development of "E-Swecha", an distro for engineering students. I am proud to be a part of such an free software community, which is dedicated in helping out engineering students in their curriculum.

At present i am participating in a free software workshop organized by Swecha which is conducted at TRR college, patancheru, hyderabad. I will maintaining this blog to share my knowledge what i gain from this workshop. Hope you all find this interesting!