Dance On..

17 07 2008

Keep it up, Matt!





E17 and fake transparency

16 03 2008

E17 stores the background images in edje file format. Edje (*.edj) is a binary file format which compresses the images quite a bit and has many additional features (animations, layers etc.). Creating an animated background for e17 is quite easy (check here). There is already the wallpaper module in e17 which can set the current wallpaper to any image.

What if we want to write a cron job to switch the wallpapers (think slideshow module?). Adding a bit more complexity to it : e17 doesn’t like fake transparency and may not change its mind in near future (source) and our terminals(mrxvt?)/system tray(stalonetray) need fake transparency. There’s a nifty hack called Esetroot which sets fake transparency but doesn’t change the e17 background.

Even there’s a way to achieve both : Install the e_utils package and photo module. Right click on any image in photo module and you can set it as your background.Actually the photo module calls e17setroot program in e_utils and sets the background and then calls Esetroot to set fake transparency. If you already have e_utils up and running, you don’t need to read further :)

A script to emulate e17setroot

  • Get the files : e17setroot and edc_skeleton
  • Put e17setroot in $PATH (e.g: in ~/bin) and change the line #31 to the location of edc_skeleton file
  • To set your wallpaper use e17setroot null /path/to/image/file

How this works ?
The main script e17setroot uses edje_cc to create the edj file. Edje (edje_cc) in fact needs an .edc file which contains few parameters to create the edj file. Our script takes the skeleton of an .edc and replaces the image name. And the resulting edj is placed in the ~/.e/e/backgrounds directory.

/me leaves the use of e17setroot to /reader’s creativity





Real transparency in urxvt

15 03 2008

Add the following lines to the ~/.Xdefaults to get a transparent urxvt terminal:
urxvt*depth: 32
urxvt*background: rgba:0000/0000/0000/dddd

The depth option tells urxvt to use 32 bits to define a color. Generally a color is represented as 24 bits (8 bits each for Red. Blue and Green). We add 8 more bits to store the Alpha(transparency) information. More info

Then we set the background option to denote the 4 different color information : Red/Blue/Green/Alpha.

To change the shading change the Alpha value in background option. 0000 = full transparent and ffff = no transparency.

For e17 users: Use the bling module for composite effects.





Testing Vimpress

15 03 2008

Vimpress is a script for VIM which allows posting to wordpress blogs from
the best $EDITOR

For more information, visit the project page :
http://www.friggeri.net/projets/vimpress

Also checkout :

  • http://linuxtidbits.wordpress.com/2008/02/29/publishing-a-blog-in-vim-with-vimpress/

Test stuff here

underlinebolditalic

Ciao





Play chess with god

26 02 2008

That was the topic of my talk on “How computers play chess”. Here’s the link to the presentation at scribd.

Some of the useful links :

BTW this is my first post this year! So a “Happy New Year” to all officially ;) I hope its not too late :P
Well during these 3 months, I coded two(three?) websites, modified an Online Judge server for our college’s online programming contest, brushed up gimp, played a lot with php and started using “Ratpoison and GNU screen” along with my e17 desktop environment.

Tags:





Convert CSV files into LDIF

2 10 2007

These days I’m using Claws Mail to fetch my GMail stuff into my box. So I faced this problem of getting my GMail contacts into Claws Mail. The problem is that : GMail exports contacts in either “GMail to GMail format” or in “Gmail to Outlook” CSV format. And Claws Mail accepts only mutt, pine or ldif files.
There are some programs which do this : Dawn. Thats for the Windows users.

Those of us who don’t have the time and energy to download “Wine” and run this exe, can go the online way. The idea is to use another intermediate file format : VCard. Here we go :

Well it works cool :-) Although I could get only a few fields(name and email) imported into Claws Mail, still it does work!

— Greetings —
Today is the birthday of Mahatma Gandhi. To quote him :

In the attitude of silence the soul finds the path in a clearer light, and what is elusive and deceptive resolves itself into crystal clearness. Our life is a long and arduous quest after Truth

Blogged with Flock

Tags: , , , , ,





How to : Setup a Local DNS Cache

20 09 2007

DNS(Domain Name System) is used to get the ip addresses of the domains. Basically whenever we enter an address in our browser, the browser sends a request to the “Nameserver” for the ip address of the domain. After the nameserver returns the ip address, the browser opens sockets(http, ftp etc) to the particular ip address and sends data to the server and waits for response. On response from the server, the browser shows us the content. They teach all this in a semester CS course :-)

Lets get into the “Name Resolution” part once again. So our browser would send a request to the Nameserver for the ip address of the domain we type in the address bar. A Nameserver is a box in your local network/ISP’s network which listens on a certain port for DNS requests and responds to each request with the IP address of the domain. If your browser gets stuck in the “Looking up hostname : xxx” part, then know that your ISP sucks and the nameserver box is too busy to cater to your browser’s name resolution request :P

Generally what ISPs do is : forward all their clients dns requests to nearest high level nameserver. And each of these requests by the clients are cached in the ISP’s nameserver to fasten up queries about the same domain name. So if some guy A queries up the ip address of “www.google.com”, the first time nameserver would forward this request to another high level nameserver and the return the ip address. But when another guy B asks for the ip address of “www.google.com”, our nameserver would return the ip address from its own cache.

But by whatever misses, there are times when you know that your ISP sucks. We will look into a few solutions to this :

  1. Use an alternative Nameserver : This is where the OpenDNS people have done an amazing work. To use their nameservers, just put these two lines in your /etc/resolv.conf
    nameserver 208.67.222.222
    nameserver 208.67.220.220
    nameserver your_ISP’s_nameserver_here
  2. Use a local DNS cache : Ah, this is the topic of this post. I’ll show the procedure for Arch Linux and OpenSuSE. So lets start -
    • Install BIND : They call BIND as Berkeley Internet Name Domain. For us BIND is a simple daemon program which will listen for dns requests on any box and send the ip addresses. Our idea is to run it in “localhost”, i.e, my own box and use my own box as my nameserver. This would save me the name resolution query time.
      For Arch : pacman -S bind
      For OpenSuSE : search for package “bind” in Yast and install it.
    • Setup the forwarders : Now localhost must access some highlevel nameservers to get the ip addresses of the domains requested for the first time. After getting the ip address, it is stored in BIND’s cache. To setup the highlevel nameservers (they call them forwarders) :
      * Open /etc/named.conf as root.
      * See the “options” block and insert/overwrite this line in there :
        forwarders { 208.67.222.222; 208.67.220.220; isp_nameserver; };
      Well
    • Start BIND as a service everytime system starts :
      For Arch : Change this in /etc/rc.conf Add “capability” to the MODULES list and add “named” to the DAEMONS list. Here’s my rc.conf :
      MODULES=(blah blah blah soundcore capability)
      DAEMONS=(syslog-ng network named !netfs !crond alsa mpd)

      For OpenSuSE : Type in yast2 runlevel in terminal with root. Then change the runlevel settings for “named” there.

Blogged with Flock

Tags: , , , , , ,





Removing orphan packages with Pacman

18 09 2007

A quick Arch tip : Get the list of orphan packages (packages no longer needed by any other packages) in pacman by with
pacman -Qe

Then remove the packages using :
pacman -Rc package_name

Blogged with Flock

Tags: , , , ,





Proud Arch-er

17 09 2007

After sticking with OpenSuSE for a long time (read 2 years), I finally got one of the bleeding edge distros : Arch Linux.Arch Logo Oh and the answers to the WHY :

  • Updates. Getting the updates was quite tough. There is this way of starting up Yast and getting the full system update, but I was really lazy to add up sources and get the packages. Well I follow quite a few opensource projects and build stuff from svn/cvs repositories.
  • Too much dependency. I could never keep track of the extra packages i needed to run a software. Now someone can argue that its the software developer’s problem. But still i would say the RPM way was becoming tougher for me.
  • Finally, to be frank, My System needed a life (even I also need one ;-)). I believe that the system should do one stuff and do it properly (unix fundae).
    I had tried to customize SuSE to as much as I could. Removing all the unnecessary stuff which bloat the system etc.. Just for history : I could get my system running with a desktop manager (e17) and music player daemon at ~50 MB of RAM.

Apart from all this, I would still say that OpenSuSE rocks. For someone new to linux and OSS, I would definitely recommend OpenSuSE. Even the new OpenSuSE build service (http://en.opensuse.org/Build_Service) seems promising.
Now I had the option to go for Gentoo or Arch Linux. After reading a few reviews, I got the impression that in gentoo i will have more of a source based system (correct me if I am wrong !). Here are the answers for “Why Arch” ?

  • Simplicity (The Keep It Simple Stupid! principle). Save the precious CPU cycles. I was really fascinated by the Arch philosophy.
  • Its more of experiment and learn. Do it yourself stuff.
  • Full system upgrade with a single command : pacman -Syu !
  • All system configurations are maintained in a few files.

Some facts about my current setup :

  • Rapid improvement in my system boot up time. I get full X running with in 20-30 seconds !
  • I can practically see what all packages are installed in my system and do periodic cleanups. (Will write a script for that)
  • Update my system daily :-)

I will follow up with a “How to : Arch” in a few days.

Blogged with Flock

Tags: , ,





Life is too short without man pages

26 07 2007


More…

Thanks to Randall Munroe for this awesome cartoon :-)

Tags: , , , ,