22 May 2007

Using KDE Style for Gnome Applications

for setting the same style colors in Gnome applications that are used at the KDE Desktop:
sudo apt-get install gtk-qt-engine [Debian/etch]

and check "Use my KDE style in GTK applications" in
KDE Control Center -> GTK Styles and Fonts

17 May 2007

Compile JAVA with gcj

to compile the common helloworld example

public class HelloWorld {

public static void main(String[] args) {
System.out.println("Hello, World!");
}
}

with the gnu gcj compiler to JAVA bytecode
gcj -C HelloWorld.java

and interprete with the VM
gij HelloWorld

... or compile it to native code
gcj --main=HelloWorld -o HelloWorld HelloWorld.java
./HelloWorld


Guide to GNU gcj
yolinux.com - LinuxTutorialJava
Linux Journal - Developing Gnome Applications with JAVA

15 May 2007

working with ISO files

to copy a CD to a .iso file:
dd if=/dev/hdc of=nameofcd.iso

to make an iso file of the content of a local directory:
mkisofs -o nameofiso.iso directorywithisocontent/

cmdline audio recording

for audio recording from ALSA sound devices arecord can be used
arecord -f cd -d 1800 audioCD.wav

this will record 1800 secs of audio in CD-quality, 44.1kHz, 16 bit

14 May 2007

Parsing MBox Mails in Perl

to extract attachments from my Thunderbird mbox files:

#!/usr/bin/perl
use strict;
use Mail::MboxParser;
use Mail::MboxParser::Mail;

# name of mbox file
my $mymailbox="Inbox";
# no parser options
my $parseropts="";

open(FD,"$mymailbox");
# new mbox object
my $mb = Mail::MboxParser->new($mymailbox,decode=>'ALL',parseropts=> $parseropts);
print "Starting decoding of Messages\n";
my $message_counter = 0;
# msg loop
while (my $msg = $mb->next_message) {
$msg->store_all_attachments(path => "./attachments_Inbox/");
print "processed ".++$message_counter." messages\n";
}
print "DONE\n";
close (FD);

Modul Mail::MboxParser at cpan.org