Sa 20. Jun 03:38:59 CEST 2009

Automatic security updates for Debian based systems

unattend-upgrades is a debian package providing automatic security upgrades.

To use it, just install unattended-upgrades, modify /etc/apt/apt.conf.d/50unattended-upgrades to your needs like:

Unattended-Upgrade::Allowed-Origins { "Debian stable"; };
To automatically and unattended install security updates you also have to set
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
in /etc/apt/apt.conf or in a file located in /etc/apt/apt.conf.d/ (I use /etc/apt/apt.conf.d/60security)
For further details have a look at /usr/share/doc/unattended-upgrades/README or https://wiki.ubuntu.com/AutomaticUpdates

Just setup unattended-upgrades and life becomes more easy as you dont have to remember to upgrade each of your machines.

Posted by Ulrich Dangel | Permanent Link | Categories: Shell stuff

Sa 20. Jun 03:10:56 CEST 2009

One command line interface for multiple RDBMS systems

sqlline a java based console program allows you to connect to any database with existing jdbc drivers replacing the original programs like mysql, sqlplus or psql.

Example to connect to an oracle database with sqlline:

$ java -cp ~/path/classpath/classes12.jar:/usr/share/java/sqlline.jar sqlline.SqlLine
sqlline version 1.0.2 by Marc Prud'hommeaux                
sqlline> !connect jdbc:oracle:thin:@hostname:1521:xe USER PASS
Connecting to jdbc:oracle:thin:@hostname:1521:xe
Connected to: Oracle (version Oracle Database 10g Express Edition Release 10.2.0.1.0 -
Production)
2: jdbc:oracle:thin:@hostname:1521:xe> 


Posted by Ulrich Dangel | Permanent Link | Categories: Shell stuff, Stuff

Fr 20. Feb 20:04:37 CET 2009

Static ip assignment with libvirt

I just started to use libvirt and needed to have static ip assignment for some of the systems. Libvirt supports this but there is no documentation for this, a patch with documentation has just been send to the mailing list, but thats all (except the documentation in the *.c files ;-)

A simple example which assigns 192.168.122.2 to the host with the mac AA:BB:CC:DD:EE:FF:
<network>
  <name>sample</name>
  <bridge name='intbr0' />
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254' />
      <host mac='AA:BB:CC:DD:EE:FF' ip='192.168.122.2' name='foobar'/>
    </dhcp>
  </ip>
</network>

Posted by Ulrich Dangel | Permanent Link | Categories: Stuff

So 11. Jan 13:13:05 CET 2009

Short overview about mpris and command line tools

mpris player

media mlayer remote interface specification, short mpris is a specification to connect media players via dbus. This is quite useful as you can have one command for example to control Amarok, Audacious or any other mpris capable player.
This are all gui player, so lets have a look at mpd, a music daemon simple to control via commandline.
mpd natively does not support dbus, but there is another solution, mpDris, a mpd client exporting the mpris functionality via dbus.

mpris client

A really nice and powerful mpris command-line client is mpris-remote to access an mpris capable player. Here are some examples commands:
mris-remote pause # toggle pause 
mris-remote next # next 
mpris-remote random true 
mpris-remote random false 
it is really intuitiv, so just use ist.

So what is the benefit?

  • You only have one command to control them all, so you can just switch your music player and your scripts will work. So instead of binding player specific commands to, e.g. your multimedia keys on the keyboard, consider using mpris and it does not depend if you use mpd, amarok, audacious or any other client.
  • Additional features are possible, for example inhibit power-manager when playing music, so you can close the lid, unhibit when music stop so your pc can start sleep. And this works for multiple player out of the box.
  • You can can subscribe to signals from the music player, so you can just get the information and don't have to check the status regular
So, if you going to control a music player via commandline, look if the player support mpris and use this, instead of proprietary command line.


Posted by Ulrich Dangel | Permanent Link | Categories: Stuff

Sa 3. Jan 17:22:10 CET 2009

Mark build dependencys as automatical installed

The latest apt-get version in experimental has is a really nice feature, which allows to mark all packages installed with apt-get build-dep as an automatic install.
You can set the option on the commandline
apt-get -o "Apt::Get::Build-Dep-Automatic=True" build-dep gnome-power-manager

or set it in the config file
$ cat /etc/apt/apt.conf.d/99builddep 
APT::Get::Build-Dep-Automatic "True";


To remove the dependencies just use apt-get autoremove

Posted by Ulrich Dangel | Permanent Link | Categories: Just me, Stuff

Mo 29. Dez 23:52:10 CET 2008

Mehr als 800 Zuschauer innerhalb von 5 Minuten ....

beim diesjärigen Hacker Jeopardy beim 25C3.
Ich habe da u.a. ich beim Theora Streaming mitgemacht, und wir haben dazu von der FEM ihre MMS Streams transcoded und Theora Streams bereitgestellt. Kurz vor Start hatten wir ca. 400 Zuschauer, danach >1200 Zuschauer.
Stats theora streams
Das ganze auf 4 Servern (2 an der Uni Ulm, einer an der BA Lörrach und einer im BCC) verteilt. Sehr coole Aktion!

Posted by Ulrich Dangel | Permanent Link | Categories: Stuff, 25C3

Do 20. Nov 14:14:30 CET 2008

Touchpoint scrolling mit dem neusten X11

Da im neuen xorg die Konfiguration der Eingabegeraete nicht mehr in der xorg.conf steht sondern das ganze ueber hal erfolgt, muss die Konfiguration fuer das touchpoint scrolling ueber hal erfolgen.
Dazu einfach eine Datei mit dem folgenden Inhalt in /etc/hal/fdi/policy/ anlegen, z.bsp. scrolling.fdi
    <match key="info.product" string="DualPoint Stick">
        <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
        <merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
        <merge key="input.x11_options.EmulateWheelTimeout" type="string">200</merge>
        <merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
        <merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
        <merge key="input.x11_options.ZAxsisMapping" type="string">4 5</merge>
        <merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
        <merge key="input.x11_options.Protocol" type="string">ExplorerPS/2</merge>
    </match>
Wenn man wie ich ein ALPS Touchpad hat, benoetigt man momentan noch einen Kernelpatch um mittels mittlerer Maustaste + Touchpoint zu scrollen.

Posted by Ulrich Dangel | Permanent Link | Categories: Stuff

Do 20. Nov 13:52:22 CET 2008

Netwerktraffic per Verbindung messen

Ab und zu steht man vor dem Problem festzustellen welche Netzwerk Verbindung gerade am meisten Traffic macht. Hier kommt jnettop ins Spiel das das ganze sehr komfortabel visualisiert.
Jetzt noch mittels netstat -anp nachschauen welcher Benutzer den Traffic generiert und ihn schimpfen :)

Posted by Ulrich Dangel | Permanent Link | Categories: Shell stuff

So 21. Sep 16:07:45 CEST 2008

WSGI Applikationen als CGI ausfuehren

WSGI Frameworks erfreuen sich immer grösserer Beliebtheit, und es gibt zig verschienden Möglichkeiten diese in seine bestehende Infrastruktur einzubinden, via Fastcgi, WSGI Modeln, http proxys etc. Die einfachste und sicherlich unperformanteste Möglichkeit ist, das ganze als CGI auszufuehen.
#!/usr/bin/env python2.5
from wsgiref.handlers import CGIHandler
from lodgeit import make_app

application = make_app(
    # the path to the database
    dburi='sqlite:////tmp/pastebin.db',
    secret_key='xlw7pe@FO_gZ\xa4\xah\xbdTz\xa7\x9v\xf7\x7f_o\x8f\xedq\xc7\xaf\xc5R'
)
CGIHandler().run(application) 

Dies ist ein Beispiel für lodgeit, und sollte eigentlich selbsterkärend sein.

Die Apache Konfiguration ist jetzt ziemlich einfach:

ScriptAlias /foo "/pfad/zum/cgi/script.cgi"
und fertig.


Posted by Ulrich Dangel | Permanent Link | Categories: Stuff

Sa 20. Sep 16:41:24 CEST 2008

Cache von Linux leeren

echo 3 > /proc/sys/vm/drop_caches
Nur zur Erinnerung ;)

Posted by Ulrich Dangel | Permanent Link | Categories: Stuff