Category Archives: artistic

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

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:


Happy Towel-Day 2009!

0
Filed under amusing, artistic, general

I hope you all enjoy the towel day this year. Wear your towel!
Maybe I’ll post some pictures later :)

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:

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.

tweak your eee … slackware 12.2 / kernel 2.6.28

5
Filed under artistic, general, linux

hi,
you maybe asked yourself how my current desktop looks like. Well:

you can find the used dotfiles and configs in my about-page. Enjoy!

code golf: grid computing

3
Filed under amusing, artistic, coding, perl

Well, I tried my best for another challenge from codegolf.com.

I can’t imagine how these guys can solve this in less than 50 characters. I managed to solve it in 132 characters in Perl. Maybe I could try to solve it in Ruby too … later ;)

Here is my approach:

@{$$a[$_]}=split/ /,<>;for 0..9;for(0..9){$A=$B=0;for$y(0..9){$A+=$$a[$_][$y];
$B+=$$a[$y][$_];}$Z=$A if$A>$Z;$Z=$B if$B>$Z;}print$Z;

Maybe someone else wants to give it a try. The task is to calculate the highest sum from a given 10 x 10 grid. Have fun!

some code-golfing …

4
Filed under amusing, artistic, coding, perl

Yesterday I discovered a funny challenge on a board I visit regularly. The challenge was to create the shortest possible program to get a given output. In my case, it was the “99 bottles of beer” song. Here is my solution:

$b=" on the wall.";for(reverse 1..99)
{$i=$_>1?" bottles of beer":" bottle of beer";
print"$_$i$b $_$i.\n";print"Take one down and pass it around,
",$_-1,"$i$b\n\n"if$_>1;}
print"Go to the store and buy some more, 99 bottles of beer$b\n";

236 characters (you can delete the newlines. I just put them in to make it more readable). So far I couldn’t get it any shorter. Maybe someone else could give it a try. ;)

Ok, just did a short update. Now it has 235 characters:

$b=" on the wall.";for(reverse 1..99){print$_,$i=$_>1?
" bottles of beer":" bottle of beer",
"$b $_$i.\n";print"Take one down and pass it around, ",
$_-1,"$i$b\n\n"if$_>1;}
print"Go to the store and buy some more, 99 bottles of beer$b\n";

FINAL UPDATE:
#####################

I just discovered a small singular/plural problem with the code above, so I had to redesign it a little … This is now the final (and working) code:

$i=" bottles of beer";$b=" on the wall";for(reverse 1..99)
{$j=$i if$_>1;print"$_$j$b, $_$j.\n";$j=~s/es/e/ if$_==2;
print"Take one down and pass it around, ",$_-1,"$j$b.\n
\n"if$_>1;}
print"Go to the store and buy some more, 99$i$b.\n";

234 characters …

my first Perl-poem :)

1
Filed under amusing, artistic, coding, perl

I just started writing my first poem in Perl ever. It isn’t as beautiful and clever as many others, but I’m a bit proud of it, mainly because it is my first one ;) . It seems a bit rude and brutal but it wasn’t intended to be in the beginning … it just happened :P . Here it is:

#!/usr/bin/perl
 
$i = "am alone again ...";
for ($ever) {}
until ($i) {die}
@you = push @me, $away and split /my/, @heart;
 
while ("you are asleep") {
    $i = chop ($YOUR, $FUCKING, $HEAD);
    close($your_door) or ($this, $night) = ($your, last)
}

Works with Perl 5.8.8. Comments are welcome :)