mutt: daily use (still in progress)

Tag messages matching
shift-t -> “search string”

Limit messages matching (pattern)
l > ~T (tagged)
l > ~A (all)
l > ~N (new)
l > ~U (unread)
l > “search string”

Random commands
;d > Delete tagged messages
s > Move message
;s > Move tagged messages
b > Bounce messages

folks…thats for you: how to extract a initrd file

$ gzip -dc /boot/initrd-2.6.32.23-0.3-default | cpio -id

….

Apache2 & Jenkins & SSL

$JAVA_HOME/bin/java -DJENKINS_HOME=/var/lib/jenkins -Xms=512m -Djava.awt.headless=true -server -jar /var/lib/jenkins.war --httpPort=8080 --httpListenAddress=127.0.0.1 --ajp13Port=-1 --logfile=/var/log/jenkins.log
<VirtualHost *:443>
  ServerAdmin admin@example.com
  DocumentRoot "/srv/www/"
  ServerName jenkins.example.com

  SSLEngine On
  SSLVerifyClient none
  SSLVerifyDepth 3
  SSLCertificateFile /etc/ssl/example.crt
  SSLCertificateKeyFile /etc/ssl/example.key

  ProxyRequests Off
  ProxyPreserveHost On

  <Proxy http://127.0.0.1:8080/*>
    Order deny,allow
    Allow from all
  </Proxy>

  ProxyPass / http://127.0.0.1:8080/
  ProxyPassReverse / http://127.0.0.1:8080/

  <Location />
    Order allow,deny
    Allow from all
    AuthType basic
    AuthName Build
    AuthUserFile /etc/apache2/jenkins-http.user
    Require vaild-user
  </Location>

  Header edit Location ^http://jenkins.server/ https://jenkins.server/
</VirtualHost>

Jenkins with AJP and SSL via Apache was not working…maybe a bug?

Building qemu & libvirt from scratch…

Pre-requirements

git clone git://git.qemu.org/qemu.git
git clone git://github.com/sahlberg/libiscsi.git
http://libvirt.org/sources/libvirt-1.0.0.tar.gz (4/12/12)
aptitude install libvdeplug2 libvdeplug2-dev libaio1 libaio-dev libcap-dev libattr1-dev libsdl-dev libxml2-dev

Building

libiscsi:

./autogen.sh
./configure
make && make install

qemu:

./configure --enable-kvm --enable-vde --enable-virtfs --enable-linux-aio --enable-libiscsi --enable-sdl --target-list=i386-softmmu,x86_64-softmmu,i386-linux-user,x86_64-linux-user --audio-drv-list=alsa
make && make install

libvirt:

(maybe you should build libvirt with python < v3.2)

./configure
[...]
configure: Drivers
configure: 
configure:       Xen: no
configure:      QEMU: yes
configure:       UML: yes
configure:    OpenVZ: yes
configure:    VMware: yes
configure:      VBox: yes
configure:    XenAPI: no
configure:  xenlight: no
configure:       LXC: yes
configure:      PHYP: yes
configure:       ESX: yes
configure:   Hyper-V: no
configure: Parallels: yes
configure:      Test: yes
configure:    Remote: yes
configure:   Network: yes
configure:  Libvirtd: yes
configure: Interface: yes
configure:   macvtap: yes
configure:  virtport: yes
[...]
configure: Storage Drivers
configure: 
configure:      Dir: yes
configure:       FS: yes
configure:    NetFS: yes
configure:      LVM: yes
configure:    iSCSI: yes
configure:     SCSI: yes
configure:    mpath: yes
configure:     Disk: no
configure:      RBD: no
configure: Sheepdog: no
[...]
configure: Libraries
configure: 
configure:   libxml: -I/usr/include/libxml2   -lxml2  
configure:   dlopen: -ldl
configure:  libcurl: -DCURL_DISABLE_TYPECHECK   -lcurl  
configure: openwsman: no
configure:  libssh2:   -lssh2  
configure:   gnutls: -I/usr/include/p11-kit-1   -lgnutls   -lgcrypt
configure:     sasl:   -lsasl2
configure:     yajl:   -lyajl
configure:  sanlock: no
configure: firewalld: yes
configure:    avahi: no
configure:   polkit: /usr/bin/pkcheck (version 1)
configure:    audit: no
configure:  selinux: no
configure: apparmor: no
configure:  numactl: no
configure:    capng:  -lcap-ng
configure:      xen: no
configure:   xenapi: no
configure: xenlight: no
configure:      hal: no
configure:     udev:   -ludev -lrt     -lpciaccess  
configure:    netcf: no
configure:     pcap: -I/usr/include -L/usr/lib64 -Wl,-rpath,/usr/lib64 -lpcap
configure:       nl: -I/usr/include/libnl3   -I/usr/include/libnl3   -lnl-3   -lnl-route-3 -lnl-3  
configure:    mscom: no
configure:      xdr: 
configure:      rbd: no
[...]
make && make install

If you getting errors like this one

make[3]: Entering directory `/home/rmichel/src/libvirt-1.0.0/python'
  GEN    generator.py.stamp
  File "./generator.py", line 21
    print "test"
               ^
SyntaxError: invalid syntax
make[3]: *** [generator.py.stamp] Error 1

you are using python 3.2.x (or newer) and should switch back to python 2.7.x!

The problem is the 'print' function. In python 2.7.x the syntax is print "foobar" but in 3.x that's not valid anymore! Instead you should be use print("foobar") (which is also valid in 2.7.x) !!

Examples

libiscsi:

qemu [...] -drive file=iscsi://10.1.1.1/iqn.storage.test/1,if=scsi,bus=0,unit=3

vde:

vde_switch -s /tmp/vdesock1 &
qemu [...] -net nic -net vde,vlan=0,sock=/tmp/vdesock1

linux-aio:
"QEMU has two asynchronous I/O mechanisms: POSIX AIO emulation using a pool of worker threads and native Linux AIO."

qemu [...] -drive file=foo.img,aio=[threads|native]

aacraid & arcconf – Create a RAID5 online

                                                                     |-- Drives  --|
arcconf CREATE 1 LOGICALDRIVE Name R5_3TB Rcache RON Wcache WT MAX 5 0 4 0 5 0 6 0 7
                                                     Raid size <|  | | |
                                                       Raid level <| | |
                                                         Channel ID <| | 
                                                             Drive ID <|

Gentoo – Jenkins startup script

Not the best but its working for me…maybe JENKINS_* and JAVA_OPTS can be moved to /etc/conf.d/jenkins or something else.

#!/sbin/runscript

depend() {
        use logger dns
        need apache2
        provide jenkins
}

JENKINS_USER=jenkins
LOCKFILE=/var/run/jenkins.pid

JENKINS_HOME=/home/jenkins
JAVA_HOME=/usr/java/jdk1.6.0_25

JAVA_OPTS="-DJENKINS_HOME=${JENKINS_HOME}/jenkins-home -Xmx512m -Djava.awt.headless=true -server"

JENKINS_OPTS="--httpPort=8080 --httpListenAddress=127.0.0.1 --ajp13Port=-1"
JENKINS_OPTS="${JENKINS_OPTS} --logfile=${JENKINS_HOME}/jenkins.log"

ARGS="${JAVA_OPTS} -jar ${JENKINS_HOME}/jenkins.war ${JENKINS_OPTS}"

start() {
        ebegin "Starting ${SVCNAME}"
        start-stop-daemon --user ${JENKINS_USER} --make-pidfile --pidfile ${LOCKFILE} \
        --background -1 ${JENKINS_HOME}/jenkins-console.log -2 ${JENKINS_HOME}/jenkins-console.log \
        --start --exec ${JAVA_HOME}/bin/java -- ${ARGS}
        eend $?
}

stop() {
        ebegin "Stopping ${SVCNAME}"
        start-stop-daemon --stop --pidfile ${LOCKFILE} --exec ${JAVA_HOME}/bin/java
        eend $?
}

Windows 7 error 0×80300001

THANKS Microsoft for this self-explanatory error message during a installation:

“Windows is unable to install to the selected location. Error: 0×80300001.”

You should write “FOOOOO! Maybe you have the wrong CD/DVD in your drive.”

(I had the virtio drivers cd in my drive…)

Gentoo and libvirt-0.9.12

Yesterday i’ve started the update process for my system…so far, so good.

After a while emerge finished successfully…of course with a lot of messages, even some messages (from libvirt) that in my kernel config some features are missing e.g.

[...]
CONFIG_DEVPTS_MULTIPLE_INSTANCES
CONFIG_VETH
CONFIG_MACVLAN
CONFIG_NETFILTER_XT_TARGET_CHECKSUM
CONFIG_NETFILTER_ADVANCED
CONFIG_BRIDGE_NF_EBTABLES
[...]

As usually i’ve ignored these messages :( After a reboot i try’d to start one of my several VMs – without success. Only with a error message

Could not access KVM kernel module: Permission denied 
failed to initialize KVM: Permission denied 
No accelerator found!

Uhm what is this now? I’ve try’d to start qemu-kvm on a shell..that worked. So it must be anything with libvirt and qemu-kvm. After some research on my system i’ve found out that qemu-kvm try’d to start the VMs as the user qemu but /dev/kvm belongs to root:kvm.

Adding the user qemu to the group kvm should help

gpasswd -a qemu kvm

Maybe this is Bug in the ebuild file!?

“No Java compiler available” on SLES11SP1 and tomcat6

On one of my two sle11 machines i had a java exception which i could not explain.

java.lang.IllegalStateException: No Java compiler available
	org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:229)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:581)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.mule.galaxy.web.ThreadLocalCacheFilter.doFilter(ThreadLocalCacheFilter.java:27)
[...]
# rpm -qa tomcat6
tomcat6-6.0.18-20.35.36.1

Oracle Java JDK 1.6.0_27

After i compared both, i’ve found some missing links on the second one.

# ln -s /usr/share/java/commons-collections-tomcat5.jar /usr/share/tomcat6/lib/
# ln -s /usr/share/java/commons-dbcp-tomcat5.jar /usr/share/tomcat6/lib/
# ln -s /usr/share/java/commons-pool-tomcat5.jar /usr/share/tomcat6/lib/
# ln -s /usr/share/java/ecj.jar /usr/share/tomcat6/lib/

Restart the tomcat and be happy :)

wodim

Burning ISO image

wodim speed=16 dev=/dev/cdrw image.iso

Copy on-the-fly

genisoimage -R -T -V /dev/cdrom | wodim dev=/dev/cdrw

Blanking CDRW

wodim dev=/dev/cdrw blank=disk