Showing post in category: Linux
Today at work over lunch I read an article in Linux Magazine called Pimped Prompt.
It inspired me to try different stuff out. I often missed an indication on when I was doing different stuff in the terminal… this is what I ended up with:
export PS1='\[\e[0;34m\][\@\e[1D]\[33[0m\] \u@\h:\w\$ '
This is how it looks like.
To make it permanent put it in your .bashrc file in your home directory. Remember that this variable is propably already set so you either need to replace the line or instert closer to the bottom of the file.
I’m extracting all my CD’s to flac files but my girlfriend is using iPod and iTunes on Windows which won’t play flac files. So I looked into converting all the music to mp3 so she could use it as well. I wanted a way to do it from the command line and I knew Gstreamer was up for the job:
gst-launch-0.10 filesrc location="music.flac" ! flacdec ! audioconvert ! lame ! id3mux name=tag v2-tag=true v1-tag=true ! filesink location="music.mp3"
The cool thing is that tags is preserved.
Note: Actually first I thought tags wasn’t preserved during the the gstreamer conversion, but that was because I used Totem with the Xine backend which apparently cant show mp3 tags.
Now I only need to write a bash script to run through all the music… lets see when I find the time
At work today I found an old SCO evaluation CD. A paragraph at the back of the CD cover made me laugh:
> SCO – a tightly integrated set of products which give you the best of both worlds – the power and reliability of UNIX and the freedom of Windows.
The “freedom” of Windows… what is that? :-O Click on the link below for full image.

This week I’ve been on a course to prepare for the Novell Certified Linux Engineer (CLE) which is required (and payed) by my employer.
But to take the CLE certification test you need to be CLP certified first, so today I took the CLP certification.
Now I’m ready to do the CLE tomorrow.
I’ve been working with Linux for some years now so the test wasn’t really that hard. Actually I was disappointed that I only got 718 points, I would have expected more. Anyways it is passed so who cares
Don’t know what to expect from tomorrows test, I hope it is as easy as this one.
(Ubuntu is still my preferred Linux distro… but don’t tell Novell
sssshhh)
When I came home from work today I read Planet Gnome, I usually visit Planet Gnome several times a day so nothing new in that.
But this time I found the post “tsclient 0.150 – call for translators” post by Jonh Wendell.
I thought why not… even tough I always use the English language when ever I can get away with it.
I use tsclient a lot at work so I guess it was about time I payed something back to this great program.
I found an old Danish translation back from version 0.106 in the SVN repository, and started from there.
I used a Danish translation guide translation guide since this is the first time I’ve ever translated software.
This guide linked to a nice word list for Danish translations which helped me a few places where I was unsure about which Danish word I should choose. About 2 hours later I was finished and had submitted the translation in a bug report.
I hope someone will find this useful out there.
2 days ago I recieved my Squeezebox… finally I pulled my head out and bought one. I should have done this along time ago. This is one of the best investments since my IBM x40… and that says a lot. At first I got really disappointed because I couldn’t get the Squeezebox to connect to the wireless network. After a few hours tinkering with my wireless access point and the Squeezebox wireless settings I gave up. I plugged it to the network with a wire and installed the latest Slimserver on my Windows partition (I know, I know… Windows, not something I was proud of).
When the Squeezebox found the slimserver on the Windows box the Squeezebox asked me to allow it to update its firmware. After that the wireless ran without problem. Yay.
I’ve started ripping all our music to FLAC even though my girlfriend was almost finished with our over 300 CDs in mp3.
Right now I use Linksys NSLU2 (running Debian Etch) both as music storage and to run the slimserver. It feels a bit slow but it is really not that bad. I’m thinking of finding another NAS but it either has to as silent as the NSLU2 or it has to be wireless. If any of you guys know a good alternative the the NSLU2 let me know.
Back to the Squeezebox… Not only can you play all you digital music but you can listen to internet radio (there is a Pandora plugin). You can have it to wake you up, show RSS (news) feeds on the display, play you podcasts and much more. All you digital music needs gathered in one freaking cool looking, easy to navigate, low noise box in your living room. All in all the Squeezebox rocks! Period.
Yesterday I needed an xsl transformation which could replace a specific attribute value in a xml file and keep the rest intact. The following code is put together by pieces I found around the net (copy-paste FTW
):
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="attribute"/>
<xsl:param name="oldvalue"/>
<xsl:param name="newvalue"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<!-- This is a generic search replace of attribute values -->
<xsl:template match="@*" priority="10">
<xsl:attribute name="{name()}">
<xsl:choose>
<xsl:when test="(name()=$attribute) and (. = $oldvalue)"><xsl:value-of select="$newvalue"/></xsl:when>
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
Lets say that the above code is saved in a file called attribute_replace.xslt. Now with xsltproc you would be able to replace the vaule 5011 with 5015 in all attributes called port:
xsltproc --stringparam attribute port --stringparam oldvalue 5011 --stringparam newvalue 5015 attribute_replace.xslt server_config.xml > new_server_config.xml
I used this to manupulate with some JBoss configuration files.
While working on implementing failover for a JBoss application in heartbeat I had it sometimes fail miserably. After examining the logs files for a while I noticed that it tried to start my service twice.. why?
This was due to multiple errors from my side:
- I hadn’t implemented the status call for my heartbeat resource script
- My script didn’t return true when asked to start and it was already started.
According to LSB standard your start / stop scripts should return true even though your service is already started.
Note to self: Learn to read the documentation and not just assume you know how it works (especially not with failover clusters… they are meant to have uptime you know.
Good readings about heartbeat and the resouces scripts.
Some time ago I think it was when I made the switch from Gaim 1.x to 2.x sending my instant messages with Ctrl + Enter stopped working. I have lived with it for along time but it kept annoying me… a good friend of mine found the solution on another website and today I took the time to actually do it.
The thing beneath is kinda ripoff / copy-paste
Create the file .gtkrc-2.0 in your home directory with the following content:
gtk-key-theme-name = "Emacs"
gtk-can-change-accels = 1
binding "gaim" {
bind "Return" { "message_send" () }
bind "Return" { "insert-at-cursor" ("\n") }
}
widget "*gaim_gtkconv_entry" binding "gaim"
Sometimes you have to get primitive … duh.
Today I got really annoyed about the “Package Management” tool on Red Hat EL 4 update 4. When I tried to install the “Development tools” I just got an error that krb5-libs could not be found which was a dependencie of krb5-workstation (1.3.4, 33). Both krb5-libs and krb5-workstation was installed…?!? I’m not Red Hat expert… and that is probably my biggest problem here
Back to the commandline… it always works.
I had to search the CD’es (afterwards I found that all the packages I needed was on CD3). I made a little search script… dont think anyone can use it… just thought it was fun:
for i in 1 2 3 4 5
do
mount -o loop /root/RHEL4-U4-i386-ES-disc$i.iso /mnt/
echo "Results on cd $i"
find /mnt/RedHat/RPMS/ -iname $1\*
umount /mnt/
done