Latest Entries »

SSL certs


cat mysite.crt gd_bundle.crt > mysite_combined.crt

thanks to:

Tomcat 7

openssl pkcs12 -export -in mycert.crt -inkey <mykey.key> -out <mycert.p12> -name tomcat -CAfile <Entrust_SSL_CA.cer> -caname root -chain


  • <mykey.key> is your current private key.
  • <mycert.p12> is your current openssl certificate
  • <Entrust_SSL_CA.cer> is the Entrust Secure Server Root CA available for download at the following URL

The exported keystore will be in <mycert.p12>

thanks to:


UTF-8 in python

These Slides are the answer!!!Unicode In Python  Completely Demystified

Multiple Ucarp on the same host

Thanks to this Guy!

Fantastic discussion from a Passenger Developer here


This is a very nice online tool:


ssh -L localport:remoteip:serviceport username@remoteip
In this way we can access the service running on remoteip on the port serviceport (a working account on remoteip is needed)

Sometimes is useful to dump the audio stream from a a/v file recompressing it into a mp3.

ffmpeg -i $input.avi -vn -ac 1 -f mp3 -acodec libmp3lame -q 9 $output.mp3


  • -i: specify the input file
  • -vn: ignore the video stream
  • -ac:numver of  audio channels in the output file
  • -f: output file format
  • -acodec: audio codec
  • -q: audio quality (1 best – 9 worst)


Shrink large PDF files

To shrink a PDF file (without pictures) you can try:

gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=setting -sOutputFile=output.pdf input.pdf

where setting should be replaced by

  • screen
  • ebook
  • printer
  • prepress


thanks to:


The sole interesting issue is:

create a filter to auto attach the device to the vm using only the vendor id

Thanks to:

How to map ataX to sdY

When disks start to crash, the kernel try to warn the sysadmin with, not so readable, messages.

[12270071.931301] ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
[12270071.931421] ata1.00: irq_stat 0x40000008
[12270071.931524] ata1.00: failed command: WRITE FPDMA QUEUED
[12270071.931634] ata1.00: cmd 61/02:00:67:99:07/00:00:00:00:00/40 tag 0 ncq 1024 out
[12270071.931635] res 41/10:01:67:99:07/00:00:00:00:00/40 Emask 0x481 (invalid argument) <F>
[12270071.931918] ata1.00: status: { DRDY ERR }
[12270071.932021] ata1.00: error: { IDNF }
[12270071.934760] ata1.00: configured for UDMA/133
[12270071.934775] ata1: EH complete

How can i understand what device should be replaced ?

This script can help.

fail=1 ; a=`egrep "^[0-9]{1,}" /sys/class/scsi_host/host*/unique_id | grep ":$fail" | cut -d "/" -f 5` ;  ls -l /sys/block/sd* | grep $a | rev | cut -d "/" -f 1 | rev