Archive for the ‘Hacking’ Category

How to fix suspend/hibernate stop working after new linux install

July 19, 2008

This is for those who had suspend/hibernate working fine, and then suddenly it stopped working. So you must be wondering what is broken? Or what have you done wrong to your system. This is because you either have installed another copy of Ubuntu or someother linux on separate partition and that changed the UUID of swap partition. So now you need to tell your Ubuntu system about that new UUID.

Below are the steps to solve the above mentioned problem. (more…)

Advertisements

Are you wondering why PSI on ubuntu is not playing any sounds?

July 19, 2008

So you are using PSI on Ubuntu and wondering why PSI is not playing sounds on new messages and on other events. PSI uses a play command to play sounds. You need to install few sound libraries that are used by play to enable PSI to play sounds. Use the following command to install required libraries.

sudo apt-get install sox libsox-fmt-all

Hope this will be helpful.

How to view actual physical memory available on xen host

July 19, 2008

When I was new on xen I had this very problem, that I was not able to figure out what is the actual amount of physical ram on xen host i.e Dom0. So sharing this little tip here for newbies that might be starting.

use “xm top” command to find out the actual physical ram.

Hope this will be helpful for someone.

Technorati Tags: , ,

Firebug is now available for Firefox 3

June 28, 2008

Yay!!! one more yay for Firefox 3 and Firebug team. Firebug is now finally available for Firefox 3, specially for Ubuntu users its a breeze. Just do:

sudo apt-get install firebug

If you are not using Ubuntu, Get your firebug from Mozilla.

So there is alot happening for Firefox 3, As I already posted how efficient it is for memory and other resources. Also the bookmark management is awesome. Have a look at my firefox 3 post.

Kudos to Joe Hewitt for giving us something like Firebug.

Generating squid “myip acl” and tcp_outgoing_address for all your IPs on FreeBSD

May 26, 2008

This is the perl script which generates squid “myip acl” and tcp_outgoing_address directives for all the IPs configured on FreeBSD except localhost IP (i.e 127.0.0.1), I have written this script to help my friend configure squid as I describe here.

#!/usr/bin/perl
open(IFCONFIG, "ifconfig em0 |");
$count=1;
@acls = ();
@tcps = ();
while (<IFCONFIG>) {
  if (/inet/) {
    s/^\s+//;
    @tokens = split(/ /);
    if (! ($tokens[1] =~ "127.0.0.1")) {
       push(@acls, "acl ip$count myip $tokens[1]\n");
       push(@tcps, "tcp_outgoing_address $tokens[1] ip$count\n");
       $count++;
    }
  }
}
close(IFCONFIG);
foreach $acl (@acls) {
  print $acl;
}
foreach $tcp (@tcps) {
  print $tcp;
}

Click the “View Plain” link above the code, copy the code from the new window and use it.

I know its not commented but I didn’t had much time because of my Google Summer of Code, and the script is so trivial that I didn’t feel like commenting it.

Setup squid proxy server to use multiple outgoing IP addresses

May 26, 2008

A friend of mine needed my help to configure squid server to use multiple IP addresses based on the squid’s IP being used as proxy server. I told him that he can configure the squid server using following squid acls and tcp_outgoing_address directives.

acl ip1 myip 192.168.1.2
acl ip2 myip 192.168.1.3
acl ip3 myip 192.168.1.4
tcp_outgoing_address 192.168.1.2 ip1
tcp_outgoing_address 192.168.1.3 ip2
tcp_outgoing_address 192.168.1.4 ip3

The acl lines tell squid to match myip which means if someone uses the IP 192.168.1.2 as their proxy server they will match the acl ip1 and so on..

Update: But his problem was not solved by this, because he had to configure squid for 500+ IPs and doing this by hand is not worth it when you have so many languages out there. So I wrote a small perl script for him to generate squid acl and tcp_outgoing_address directives for all IPs.

Python Developers build your apps for Google servers!

April 8, 2008

AppEngine LogoGoogle has launched Google App Engine which will host web apps for anyone. This is another great service launched by Google. Now developers don’t need to worry about their applicatioin’s growth because it will be now hosted on Google servers.

Google App Engine SDK allows developers to develop application locally. SDK also comes with the development web server just like Django. The database API is almost same as provided by django, so django developers will not have many problems developing application for Google App Engine.

What are you waiting for? Go and signup for Google App Engine at: http://appengine.google.com/

Read more at:

Python gaming challenege is coming…

August 31, 2007

Python gaming challenge PyWeek 5 is ready, Registrations are open and the theme voting has been started. It is a fun challenge you will get only one week to code a game from scratch. There is no prize money involved but the fun which is worth of your time. Read more about it on PyWeek site.

Below is the time table.

Timetable
Friday 2007/08/03 Registration open
Sunday 2007/08/26 Theme voting underway
Sunday 2007/09/02 Challenge start
Sunday 2007/09/09 Challenge end, judging begins
Sunday 2007/09/23 Judging closes, winners announced


How to disable debconf for automated installs of packages using apt-get

April 21, 2007

I have been working on an application for the whole last month. Last week I realized that I need to disable debconf for packages that will be installed by my application using apt-get. I found in manuals that we can configure apt-get to don’t preconfigure packages by editing file /etc/apt/apt.conf.d/70debconf.

As a quick hack I just commented out the only single line that was uncommented in that file. But that didn’t worked out for me. So, I spent lot of time in searching how can I stop debconf showing up and asking me questions for the bunch of applications that will be automatically installed.

I found two ways of changing this behavior, although only the second one was suitable for me  but I will share both.

First method
This method will change the debconf configuration and so debconf will not ask you when ever it will be called. If you want this solution the enter the following command and select the last (6th) option i.e “Noninteractive”.

dpkg-reconfigure debconf

Second method
This method allows to disable debconf interactive dialogs for a single execution of apt-get. And this is done by changing environmental variables. Got this tip from debconf manpage.  Below is the example apt-get installation of exim4 package.

DEBCONF_FRONTEND='noninteractive' apt-get install exim4

This was the solution that took me so long, I know I should be missing something or I should have consulted the man page on the very first place, because this is the reason they are provided on every Linux.

So, from now on. Read man page before going to Google. Yes, Google has made me lazy.

Humor: Linyos Torovoltos a soviet computer hacker

February 18, 2007

Today I read a very interesting article from one of my favorite  blogs.  The article  was  really humorous and I couldn’t stop myself from posting it to be shared.

That was really funny, Linux torvals soviet pronunciation ” Linyos Torovoltos”. The article pointed out by, All About Linux.

The article titled, “Is your son computer hacker” The article is really humorous, you can read it from here .

powered by performancing firefox