Category Archives: coding

some information about the eee-PC on current kernel

0
Filed under coding, general, linux

hi,

just wanted to give you a small update about how things are going with the current kernel (2.6.31.1 so far) on the 901 model from Asus.

Graphics:
The intel chipset ( Intel Corporation Mobile 945GME Express Integrated Graphics Controller ) works very well and even KMS works like expected. There were some minor issues that required to build a initial ramdisk in the past, but now that’s not necessary anymore. I don’t know if that’s because of a bugfix or just some lucky configuration of my kernel. ;)

Wireless:
WiFi works with the rt2860 module from /staging.

Bluetooth:
I managed to use my cell phone as a modem device. It wasn’t very difficult. I’ll write a small article soon how to get this done. wvdial and rfcomm do the dirty work anyway …

I also bought a very nice little IBM thinkpad some days ago which I am currently tweaking to fit my needs. Screenshots will follow. Here is one from my eeePC:

endorsing calcurse :)

2
Filed under amusing, artistic, coding, general, linux

Today I found a very nice ncurses-based calendar tool named calcurse. At first it is a bit hard to get used to it, but once you figured out how it works, you’ll love it.
Friends of console applications will love it anyway ;) . I have always been searching for a reasonable console tool for this task. Now I found one :)

Here is the link to the website:
calcurse

I’m using it as my primary calendar application to get an overview of my daily tasks and events.

Here a screenshot of me entering my university lessons :P :

entering stuff in calcurse

entering stuff in calcurse

playing with github – everyone is invited!

0
Filed under biology, coding, general, perl

#### UPDATE #####
To have a look at the project:
click me
###############

hi guys,

I decided to register an account on github to share some of my coding projects with the world. By now I only uploaded huntersim so far but some others will follow soon. If you want to help me by commenting or patching it, feel free to do so. Get an account at github.com and tell me you account name by mail. I could then add you to the collaborators and you can submit your changes directly. If you just want to take a look or run the program you can of course just clone the repository without registration.

The public clone URL is: git://github.com/ap0calypse/huntersim.git

You can clone the repository with the following command:

git clone git://github.com/ap0calypse/huntersim.git

So, if you want to contribute to the project (or fork it, whatever) tell me your username and I add you to the collaborators. You should have some git knowledge. But don’t be scared. You can’t destroy anything :P

huntersim 0.1 – my first simulation

5
Filed under amusing, artistic, biology, coding, linux, perl

hi guys,

some days ago I decided to write a little simulation in Perl. Well, … here is the result (huntersim-0.1). The package contains a README where everything should be explained.

Have FUN!

UPDATE:

Because people want to see pics:


[UPDATE] helper script for changing the MAC

3
Filed under coding, general, linux, perl

UPDATE:
##############

I now rewrote the script a little bit to use a private MAC-area because of problems when generating some MAC-addresses. Please use this version if you want to use it …

##############

hi guys,

yesterday I told you how to change your MAC address. Because I’m unbelievably lazy I decided to write a little helper-script to do this automatically. This script generates a random MAC address and brings the interface up with it.

here it is: change-mac

#!/usr/bin/perl
use strict;
 
# name:     change-mac
# author:   ap0calypse (ap0calypse@agitatio.org)
# purpose:  helper script for bringing an interface down
#           and up again with a random MAC-address
# date:     2009-04-15
 
# replace this with your wlan-interface
my $interface = "wlan0";
 
my @val_mac = (0 .. 9, "A" .. "F");
my $rand_mac = "AC:DE:48:";
 
for (1 .. 6) {
    $rand_mac .= $val_mac[rand(@val_mac)];
    if ( ($_ % 2 == 0) && $_ != 6) {
        $rand_mac .= ":";
    }
}
 
system("ifconfig $interface down");
system("ifconfig $interface hw ether $rand_mac");
system("ifconfig $interface up");

new script: my_banner 0.1

2
Filed under artistic, coding, perl

good morning ;)
As I wrote in my last article I wrote a small programm to display a 5×9 matrix of letters like the commandline tool banner does. Of course, my version isn’t that powerful, but it works. my_banner doesn’t do line-breaks, so if the sentence is too long you’ll see simply nothing very useful :P .

Here an example:

echo "ABCDEFGHIJKL" | perl my_banner
 ###  ####   #### ###   ##### #####  #### #   #  ###   ###  #   # #
#   # #   # #     #  #  #     #     #     #   #   #      #  #  #  #
#   # #   # #     #   # #     #     #     #   #   #      #  # #   #
#   # ####  #     #   # ###   ###   #     #####   #      #  ##    #
##### #   # #     #   # #     #     #  ## #   #   #      #  # #   #
#   # #   # #     #  #  #     #     #   # #   #   #    # #  #  #  #
#   # ####   #### ###   ##### #      #### #   #  ###    #   #   # #####

and another one:

echo 'This is a test' | perl my_banner
##### #                                                       #                 #
  #   #       #                 #                            ###               ###
  #   ####         ####              ####        ####         #    ###   ####   #
  #   #   #  ##   #            ##   #           #   #         #   #   # #       #
  #   #   #   #    ###          #    ###        #   #         #   #####  ###    #
  #   #   #   #       #         #       #       #   #         #   #         #   #
  #   #   #   #   ####          #   ####         ####         ##   #### ####    ##

Here is the source: my_banner

You may ask yourself how it works? Well, I did it this way:

I figured out, that an ‘A’ for example would look like this in a 5×9 matrix:

 ###    01110   = 14
#   #   10001   = 17
#   #   10001   = 17
#   #   10001   = 17
#####   11111   = 31
#   #   10001   = 17
#   #   10001   = 17

Well after I figured this out, I created an array inside of a hash for every letter from a-z A-Z and some special characters.

my %led_letters = (
    'A' => [qw( 14 17 17 17 31 17 17  0  0 )],
    ....
    'g' => [qw(  0  0 15 17 17 17 15  1 30 )],
    ....
);

The rest was easy after that. Maybe someone wants to expand it. Enjoy!

slackware on the eee-pc 901 – hints, tips and experiences

2
Filed under artistic, coding, general, linux

Yesterday I got my new toy, an Eee-PC 901 with pre-installed Windows XP. I guess it’s no neccessary to say that Windows was removed immediately (including the annoying “designed for Windows XP” stickers all around). I started to install my distribution of choice (slackware 12.2) on it with an external DVD-drive.

This model off the eee has a 4GB SSD like my older 701 model plus an additional 8 GB Module. This gave me the great opportunity to have my home-directory separated now. (my older eee had an SD-Card to satisfy ma needs in this case)

I partitioned like this:

[14:47:12] root@blackbox ~ # fdisk -l /dev/sd?
 
Disk /dev/sda: 4034 MB, 4034838528 bytes
128 heads, 63 sectors/track, 977 cylinders
Units = cylinders of 8064 * 512 = 4128768 bytes
Disk identifier: 0x57985ef0
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         920     3709408+  83  Linux
/dev/sda2             921         977      229824   82  Linux swap
 
Disk /dev/sdb: 8069 MB, 8069677056 bytes
255 heads, 63 sectors/track, 981 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3094aa77
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         981     7879851   83  Linux

After a normal installation and the removal of some obsolete packages I compiled the recent kernel on it (2.6.28.7). After surfing through “make menuconfig” I discovered that the wireless chip of this model isn’t supported in the mainstream kernel. The wireless chipset of my older model was supported by the ath5k-module, but this chipset (rt2860) isn’t yet supported :( . There were 2 options:

  • I wait until it comes to mainstream kernel (hopefully with 2.6.29 ??? ) and connect to WiFi with my zd1211-USB stick meanwhile
  • I compile the official driver from Ralink

I decided to take option 1, because I hate to compile third-party modules. I read on some boards and mailinglists that kernel-support for rt2860 is currently a work in progress. I guess it won’t take a long time to get it into mainstream kernel. Here an output of lspci:

00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)
00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)
01:00.0 Network controller: RaLink RT2860
04:00.0 Ethernet controller: Attansic Technology Corp. L1 Gigabit Ethernet Adapter (rev b0)

After compiling and rebootiing my new gem I discovered that my eee suddenly freezed during the initialization of the eeepc_laptop module. At first I thought the kernel really freezed because it took up to 30 seconds until it continued to boot normally. “Maybe just an unlucky constellation …” I thought and rebooted to test if it happens again, …. and it did. So I decided to compile my kernel without eeepc_laptop until it is fixed. I also read on the kernel mailinglist that this is a known issue.

Well, here I was, surfing the web with my new eee, connected via my zd1211-usb-wlan-stick with my home-network. But there was something very, very annoying again. The fonts of my firefox-menu and everything seemed extremely big and bloated. From my past I knew that there was a DPI option in the firefox-menu but I couldn’t find it anymore … *sigh*

After some searching I found a solution. I rewrote my ~/.Xdefaults and added the following line:

Xft.dpi: 96

After that, Firefox started to look normal again.

Finally, a little screenshot:

slow page-scrolling with firefox

0
Filed under coding, general, linux

hi everyone,

some days ago, while browsing the web on my favorite websites, I felt that they all seemed to be slower. Firefox even started to need around 100 % of my CPU what NEVER happened before. It was interesting that pages like Google-search or simple text-pages weren’t affected. The problem obviously had to do something with the stuff surrounding the text ( pics, flash, whatever, … ). At first I was kind of helpless because I didn’t know what caused this mess, but then I remembered an update of my NVIDIA-driver. After a bit of searching I found the responsible option in /etc/X11/xorg.conf:

...
Option "NoAccel" "false"
...

After restarting X, it worked again. Maybe this helps some people.

necessity is the mother of invention

2
Filed under artistic, coding, general, linux

Some days ago i realized that my touchpad of the Eee-PC wasn’t working as expected anymore. The left button works but the right button does nothing. First I thought of a problem with the synaptics-modules but after trying different kernels and distros there as no doubt anymore … the button is somehow broken … :(

Well, you can imagine how annoying it is to work without the right mouse-button (pasting doesn’t work, fluxbox-menu doesn’t work, browsing with firefox becomes a pain,…).

I searched around to find a possible solution for this problem and discovered 2 very convenient tools: xbindkeys and xautomation.

After compiling and installing the packages, I created a config file called .xbindkeysrc in my home directory with the following content:

"xte 'mouseclick 3'" 
  Menu
"xte 'mouseclick 2'" 
  Pause

xte is a tool from xautomation which simulates different X-Events like mouseclicks or keyboard events. After creating the config-file I had to add “xbindkeys &” to my .xinitrc so that the daemon runs whenever X starts.

Now, whenever I want a right-click (button 3), I press the “Menu”-button and if I want a middle-click (button 2) I press the “Pause”-button.

some funny comics :)

0
Filed under amusing, coding, general

I just clicked through some of my favourite boards on the net and found 2 funny comics I want to show you.

I love coding humor :)

Some more funny jokes:

Why do programmers always mix up Halloween and Christmas?
Because Oct 31 equals Dec 25.

Programming is like sex:
One mistake and you have to support it for the rest of your life.

Saying that Java is nice because it works on every OS is like saying that anal sex is nice because it works on every gender.

COBOL programmers understand why women hate periods.

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

If debugging is the process of removing bugs, then programming must be the process of putting them in…

The day Microsoft makes something that doesn’t suck, they’ll be making vacuum-cleaners.

It’s easier to optimize correct code than to correct optimized code.

Software developer: device for converting coffee into code