torek, 26. maj 2009

Export public key from a X.509 certificate

If you have an X.509 certificate in .p12 file then you can export public key like this:
openssl pkcs12 -in myFile.p12 -out myPublicKey.pem -clcerts -nokeys

petek, 22. maj 2009

Enable/disable KDE 4 desktop effects on command-line

Today I had a problem that my laptop, running KDE4 with desktop effects turned on, froze before I could start systemsettings and disable it. So to manually disable it:
- start Ubuntu in recovery mode
- go to root console
- go to /home/$USER/.kde or /home/$USER/.kde4
- then edit share/config/kwinrc
- set Enabled to false under [Compositing]

četrtek, 21. maj 2009

When I came to work

If I want to know when I came to work in the morning I use this piece of code:
LANG=en_us date "+%b %d" | xargs -i grep -m1 -i {} /var/log/syslog.0 | awk '{ print "Today I got to work at " $3 }'

I can use this since I power up my laptop every morning.
I got this one on a blog that I cannot find now, so I hope the author will not be angry with me. I just added LANG=en_us since the date format in syslog.0 is in en_us.

nedelja, 10. maj 2009