22 February, 2010

IPv6 Configuration

The following procedure seems to work for me: First convert the existing IPv4 address to IPv6 address:
kpe@somewhere# ipv6calc --ipv4_to_6to4addr 10.1.208.11
2002:a01:d00b::
Then change static configuration in /etc/network/interfaces like this:
auto eth0
iface eth0 inet6 static
address 2002:a01:d00b::
gateway 2002:a01:d001::
network 2002:a01:d000::
netmask 40
up route -v add default gw 10.1.208.1 dev eth0
To let avahi resolve the IPv6 addresses change the hosts line in /etc/nsswitch.conf:
hosts:          files mdns6_minimal [NOTFOUND=return] dns mdns6
to:
hosts:          files mdns_minimal [NOTFOUND=return] dns mdns

20 April, 2009

Dvorak DE Layout

Followind the idea described here I defined a Dvorak Keyboard Layout extension allowing me to input the german umlauts and sharp 's' by pressing AltGr. To use, create a file /usr/share/X11/xkb/symbols/us_dvorak_de containing this:
// us_dvorak_de: Custom extended us keymap

default
partial alphanumeric_keys
xkb_symbols "dvorak-de" {
  name[Group1]= "USA - Dvorak DE";


  include "us(dvorak)"
  include "level3(ralt_switch)"

  key <AC03> {[ e,            E,           EuroSign,       U2203           ]};
  key <AD09> {[ r,            R,           registered                      ]};
  key <AC08> {[ t,            T,           trademark                       ]};
  key <AC04> {[ u,            U,           udiaeresis,     Udiaeresis      ]};
  key <AC02> {[ o,            O,           odiaeresis,     Odiaeresis      ]};
  key <AC01> {[ a,            A,           adiaeresis,    Adiaeresis       ]};
  key <AC10> {[ s,            S,           ssharp                          ]};
  key <AC06> {[ d,            D,           degree                          ]};
  key <AD08> {[ c,            C,           copyright,     cent             ]};
  key <AB07> {[ m,            M,           mu                              ]};
  key <AD02> {[ comma,        less,        lessthanequal, lessthanequal    ]};
  key <AD03> {[ period,       greater,     ellipsis,      greaterthanequal ]};
};
The most reliable way to activate the layout seems to be:
setxkbmap -option lv3:ralt_switch,grp:lwin_toggle us,bg,us_dvorak_de ,,dvorak-de
Better is to specify this in /etc/default/console-setup, e.g.:
XKBMODEL="pc105"
XKBLAYOUT="us,bg"
XKBVARIANT="dvorak-intl,"
XKBOPTIONS="grp:lwin_toggle,lv3:ralt_switch"

09 May, 2008

Fixing the Sun Java Crash in Eclipse on 64 bit Linux

After a lot of easy reproducible crashes of the Sun JVM when running eclipse, I found a way of fixing them, add -XX:-PrintCompilation to the -vmargs of your eclipse.ini. When eclipse crashes, take a look at the hs_err_pid<pid>.log file. Somewhere inside you will find a line like this (search for Current CompileTask):
Current CompileTask:
C2:2393      org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding.<init>(Lorg/eclipse/jdt/internal/compiler/lookup/ParameterizedTyp
eBinding;Lorg/eclipse/jdt/internal/compiler/lookup/MethodBinding;)V (435 bytes)
Now you can exclude the method from being compiled by the HotSpot:
-XX:CompileCommand=exclude,org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding,<init>
My eclipse.ini looks like this:
-showsplash
org.eclipse.platform
-vmargs
-Xms256m
-Xmx1024m
-XX:MaxPermSize=128m
#-XX:-PrintCompilation
-XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith
-XX:CompileCommand=exclude,org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding,<init>
Some more HotSpot VM Options could be found here.

19 February, 2008

Activating Debian menu in Xubuntu XFCE

Aufter installing crossover office and not finding its menu entries, I did this:
   update-menus
This will create/overwrite ~/.config/xfce4/desktop/menu.xml And then I added those lines in ~/.config/xfce4/desktop/menu.xml:
 <separator />
 <menu name="Debian" icon="debian">
  <include type="file" src="menudefs.hook"/>
 </menu>
 <separator />
It is however better to put the lines above in /etc/xdg/xfce4/desktop/menu.xml, so they are not overwritten after a call to update-menus.

Apache front-end for Archiva

To use apache httpd as a proxy/mirror for archiva, I made these modifications to httpd.conf:

<IfModule mod_proxy.c>
ProxyRequests Off

<Proxy /archiva>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass /8081/ http://myhost:8081/
ProxyPassReverse / http://myhost:8081/

RewriteEngine On
RewriteRule "^/archiva/(.*)" "http://myhost/8081/archiva/$1" [P]
RewriteRule "^/archiva" "http://myhost/8081/archiva/" [P]

</IfModule mod_proxy.c>

If SELinux is used, you might need to:
   /usr/sbin/togglesebool httpd_can_network_connect
to check the status of the relevant SE flags:
   sestatus -b | grep httpd
A less complicated variant:

<IfModule mod_proxy.c>
ProxyRequests Off
ProxyPreserveHost On

<Proxy /nexus>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass /nexus http://localhost:8081/nexus
ProxyPassReverse /nexus http://localhost:8081/nexus

<Location /nexus>
    Order allow,deny
    Allow from all      
</Location>

</IfModule>

11 February, 2008

GUI for svn diff

Instead of calling svn diff, I can call svndiff to get a graphical diff, by defining the alias (in my ~/.bashrc):
alias svndiff='svn diff --diff-cmd /home/kpe/diffwrapper'
This allows me to have a GUI diff, when I define diffwrapper like this:
#!/bin/sh

# Configure your favorite diff program here.
# Subversion provides the files as a 6-th and 7-th parameter.
meld "${6}" "${7}"

Tee Timer Bash Script

Loving Tee? Here a timer:
#! /bin/bash

beep -f 3000 -l 100

TIMEOUT=5
COUNTER=$TIMEOUT

echo "$(date +%H:%M:%S)  started"
while [ $COUNTER -gt 0 ]; do
  sleep 60

  COUNTER=$(($COUNTER-1))
  beep -f 7000 -l 100 -r $(($TIMEOUT-$COUNTER))

  echo "$(date +%H:%M:%S)  $COUNTER min left"
done
echo "$(date +%H:%M:%S)  done"

beep -f 1000 -l 10 -r 2; beep -f 3000 -l 1 -r 2;
beep -f 2000 -l 20 -r 2; beep -f 3000 -l 10 -r 3

while [ 1 -gt 0 ]; do 
  sleep 5

  beep -f 5000 -r 2 -l 100 
  beep -f 4000 -r 1 -l 50
  beep -f 11000 -r 2 -l 50
  beep -f 12000 -r 1 -l 100
done