Category: Linux

  • Debian or Ubuntu

    From: Rahul
    To: Sunil Mohan
    Subject: Debian or Ubuntu

    Some applications which I had backported while using debian etch along with the backporting difficulty level:

    alltray (simple)
    ekiga (medium – the etch version was giving problems for IP-to-IP direct calling)
    ffmpeg / mplayer / avidemux (quite a nightmare … I was trying to backport the testing version from debian-multimedia.org)
    gwenview (simple – etch version had some bugs)
    pidgin (difficult – because it was using libnss .. actually i installed libnss from mepis :D)
    wammu / gammu (simple – the etch version wouldn’t recognise my phone)
    dcfldd (simple – extremely useful software if you use dd regularly as it shows status)
    isomaster (simple)

    So basic ga what I feel about stability of distributions I am considering is:

    Debian Stable (+backports) > Ubuntu (+backports) > Debian Testing > Debian Unstable

    where packages provided by Debian Stable are most outdated and those provided by Debian Unstable are latest (i.e. in reverse order of distribution stability).

    And reg. the mindset about using the latest software, I agree with you to considerable extent. Most of the times you don’t need the lastest software because you might never use those features. But at times it might really make a difference as it may add extra features or involve bug fixes. For ex. gammu / wammu, the etch version wouldn’t recognize my phone. Luckily the latest version from lenny did. Similar ga gwenview, I liked all the features but it was crashing whenever I loaded the jpegs imported from my sister’s phone. I almost discarded it if not it had struck me that I could try the version from lenny which had the problem fixed.

    So basic ga bottom line is I don’t think using the latest software is just about mindset. It might have considerable advantages at times. And you never know what feature in the new version you might fall in love with (ex. firefox non-intrusive way of prompting whether you want to save the pasword or possible future thunderbird tray icon). And yeah I could always compile from the source but then of good use would Synaptic be and the entire debian package management be :D.

    I think for now I’ll proceed with using Debian Testing. If I continue to find this not to be very stable, I’ll consider either switching to Debian Stable (+Backports) or Ubuntu (+backports).

    Thanks for your feedback.

    Regards,
    Rahul.

  • Pidgin Master Password Patch

    Pidgin stores the passwords of the accounts in plain text in a xml file (i.e. if you have enabled the “save password” option for the accounts). Anyone who can get read access to this xml file (accounts.xml) will know the passwords of all the accounts for which you have chosen to save the password.

    This patch (written by Dooglus) allows you to have a master password for encrypting the passwords of the individual accounts. This is similar to the master password feature provided by Thunderbird / Firefox (and I think this also uses the same encryption method as that used by Thunderbird / Firefox).

    Source Installation (in Linux)

    Installing Pidgin dependencies

    If using Debian Lenny, you can install the dependencies using apt-get:

    # apt-get install cdbs debhelper libgtk2.0-dev libxss-dev libmeanwhile-dev libgadu-dev libnss3-dev tcl8.4-dev tk8.4-dev libgstreamer0.10-dev libgtkspell-dev libltdl3-dev libperl-dev libstartup-notification0-dev libzephyr-dev libxml2-dev libebook1.2-dev libedata-book1.2-dev libcamel1.2-dev libdbus-glib-1-dev dbus python libavahi-client-dev libavahi-glib-dev libxml-parser-perl libncursesw5-dev libsasl2-dev xsltproc doxygen libsqlite3-dev libsilc-1.1-2-dev

    Alternatively, if you have the source repositories enabled, you can just run:

    # apt-get build-dep pidgin

    Installing Patch dependencies

    # apt-get install libnss3-dev libnspr4-dev

    Applying Patch

    Download the pidgin source (pidgin-x.x.x.tar.bz2) from here and the master password patch (pidgin-x.x.x_master-password.patch) from below. Extract the source and apply the patch.

    # tar -xvjf pidgin-x.x.x.tar.bz2
    # cd pidgin-x.x.x
    # patch -p1 <../pidgin-x.x.x_master-password.patch

    Compiling and Installing Pidgin

    Once the dependencies are installed and patch is applied, pidgin can be compiled and installed as usual.

    # ./configure --prefix=/opt/pidgin
    # make
    # make install

    After pidgin is installed, you can run it using:

    # /opt/pidgin/bin/pidgin

    and set the master password through Tools -> Preferences -> Security.

    Windows Binaries

    Following the instructions given at http://developer.pidgin.im/wiki/BuildingWinPidgin, I was able to build windows binaries. Also note that GTK+ for windows has to be installed as a prerequisite and it can be downloaded here. If you are using Win9x/Me, download and install GTK+ version "2.6.10 Rev A".

    pidgin-2.3.1_win32.zip
    pidgin-2.4.1_win32.zip
    pidgin-2.6.2-win32-bin.zip
    pidgin-2.6.2.exe
    pidgin-2.6.2-no-gtk.exe
    pidgin-2.6.2-debug.exe

    Patches

    pidgin-2.3.1_master-password.patch
    pidgin-2.4.0_master-password.patch
    pidgin-2.4.1_master-password.patch
    pidgin-2.4.2_master-password.patch
    pidgin-2.4.3_master-password.patch
    pidgin-2.5.4_master-password.patch
    pidgin-2.6.2_master-password.patch

    It should be noted that these patches might work for other pidgin versions as well. While patching the source, if any of the files are not patched properly, the failed hunks are put in a .rej file for inspection and the rejected changes can be merged manually.

    References

    http://dooglus.rincevent.net/gaim/

    Fix for Master password expose for Pidgin

  • File Encryption Using GPG And Editing Using Vim

    File encryption is a useful feature. Especially if you want to store some sensitive information in a file on your PC or mail someone a file with sensitive data. GPG allows us to encrypt files using either a password or public-private-key pair. Further, a vim plugin is available which allows you to edit the gpg file directly. Though vim by default provides encryption support for files (using the -x option), the encryption algorithm is weak. GPG provides a great alternative for strongly encrypting files. Below are a few links which should help you understand about GPG and also use vim for GPG encryption. Also note that you might need vim and not vim-tiny for this plugin to work properly.

    http://en.wikipedia.org/wiki/GNU_Privacy_Guard
    http://advosys.ca/viewpoints/2006/07/pgp-symmetric-encryption/
    http://vim.sourceforge.net/scripts/script.php?script_id=661

  • Need for Backup

    Note: See also the follow up to this article about some of the Linux Backup Solutions

    Some things are learned the hard way and the importance of taking backup was among those. While I will not get into the details about how to take backup I just want to stress on the importance of backups. Just consider one of the following real-life scenarios:

    1. There is a huge power fluctuation and your entire hard disk gets destroyed.

    2. You are moving your PC / laptop around, it suddenly slips from your hand and resulting in your hard disk crashing.

    3. You are very sleepy and accidentally delete some important folder.

    4. You have all your blogs on wordpress or some free hosting provider. You write about some controversial issue and your blog hosting provider deletes your entire site without giving you any explanation (ever bothered to read the agreement to which you agree while opening an account?)

    5. You access your mails from everywhere. Someone who is really pissed off with you by some means gets access to your account password and deletes all your mail.

    These are all very real life situations which I have either encountered or seen someone else encounter. Hence I strongly suggest that you take regular backups of all your important data (it might not be necessary to take Operating System backup but if you do it will be helpful for recovering quickly in case of an eventuality).

    I use dar combined with SaraB and cron to take nightly backups to an external hard disk. And then once in a month I copy these backup files to DVD for offline storage. Apart from dar, there are many tools available in linux for helping you to take full and differential backups. I personally prefer dar because it is simple and has some nice features such as compression and automatic splitting if the backup image size exceeds a particular size so that it will fit on backup media such as CDs / DVDs.

    Similar to linux, Windows will also have many backup software available for free including the backup utility which ships default with Windows. Also if you google around, you should get articles related to how you can take backup of your blogs/websites and emails.

    So don’t be a fool like me and wait till disaster strikes. Instead start taking backups today and sleep peacefully.

  • Mail Retriever

    A mail retriever is used to retrieve mails from remote mail servers. This is especially useful if you want to retrieve mails from remote mail servers and deliver it to your local mail server or store in your local machine.

    Fetchmail and getmail are mail retrievers which enable you to retrieve mails using the standard protocols such as IMAP and POP3. But for Yahoo and Hotmail, there is no support for IMAP/POP3. But not to worry as we have similar programs to retrieve mails from Yahoo and Hotmail known as fetchyahoo and GetLive respectively.

  • Setting Up Mail Server (With MDA, IMAP And Webmail)

    Mail Server

    Using your own mail server, you can have mails delivered directly. Certain things I looked out for while choosing a mail server for my personal use:

    – Support for regular operating system accounts (unix logins)
    – IMAP support (either inbuilt / external)
    – Webmail support (either inbuilt / external)
    – Maildir format supported
    – (Sieve) Server side filtering (http://www.debian-administration.org/articles/244)
    – Ease of installation

    I’ve explored some mail servers. Sendmail’s configuration and maintenance are difficult. qmail is difficult to install and in-built features are less, but this is the most popular MTA I guess. Exim or Postfix is what I’d recommend because of their ease of installation, maturity and extensibility. Here is a quick tutorial on setting up postfix in Mepis. Be sure to have a backup mail server if you are setting up your own mail server for higher reliability.

    Mail Delivery Agent

    A mail delivery agent (MDA) / mail filter is used to process the mail which is received and enables to perform actions such as moving that mail to a specific folder or forwarding it to another email id depending upon the rules you mention. Procmail and maildrop are two very popular MDAs. While procmail seems to be more widely used, I’d highly recommend maildrop for its ease of setup and use. Here is a small tutorial on setting up maildrop with postfix. Visit the maildrop page on Wikipedia for further references.

    IMAP Server

    I’ve used Courier-IMAP server for some time. But later I shifted to Dovecot. Dovecot is an open source IMAP and POP3 server for Linux/UNIX-like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It’s fast, simple to set up, requires no special administration and it uses very little memory. Here is a brief tutorial on setting up dovecot on Mepis

    Webmail
    Squirrelmail is one of the first webmail clients. A relatively new webmail client which I have found to be extremely impressive is Roundcubemail (this uses Ajax).

    Some other relevant links:

    List of mail servers (this list is huge) – http://www.emailman.com/unix/servers.html
    Comparison of mail servers – http://www.geocities.com/mailsoftware42/, http://shearer.org/en/writing/mtacomparison.html)
    Setting up Courier – http://www.courier-mta.org/install.html
    Configuring mail clients for Courier-IMAP – http://www.trekweb.com/~jasonb/articles/exim4_courier/confclient.html
    Exim + Courier-IMAP – http://www.trekweb.com/~jasonb/articles/exim4_courier/exim4.html
    Setting up Qmail – http://www.lifewithqmail.org/lwq.html

  • Adding JPEG Comments

    MaPiVi is a photo organizing software which can be used to add comments to JPEG files (always take a backup of your photos as this software works on it directly). However, MaPiVi is no longer being maintained actively. Another graphical tool which can be used for editing JPEG comments is XnViewMP. Originially written for Mac, binaries are now available for major linux distributions.

    The linux commands “wrjpgcom” and “rdjpgcom” (provided by “libjpeg-progs” package) can be used for reading and writing comments to JPEG files as well. Other command line based tools that can be used are ExifTool by Phil Harvey (exiftool) and Exif Jpeg header manipulation tool (jhead).

  • Shutdown Using Power Button

    Here is a small tip. For configuring the power button to start shut down sequence when pressed, install “acpid” daemon via apt. This will install the necessary event (/etc/acpi/events/powerbtn) and associated action (/etc/acpi/powerbtn.sh) to be performed upon pressing the power button.

  • Setting up DHCP Server

    A dhcp server allows you to assign IPs dynamically to your clients. For further information visit, Setting up DHCP server.

  • Connecting via PPPoE

    This is especially useful for those who use a username and password to connect to their broadband cable/ADSL connection (such as that provided by BSNL, Airtel and Tata Indicom). For this you need to install pppoeconf package and run the command.

    # apt-get install pppoeconf
    # pppoeconf

    Alternatively, if you are using mepis you can configure by going to Kmenu –> Internet –> Connection –> ADSL/PPPoE configuration.