Archive for the ‘Linux’ Category

Load balance anything with HAProxy

Recently I wanted to load balance a TCP service i.e. not http, in the past I’ve used ultramonkey but there doesn’t seem to be any maintained Redhat/Centos packages.

After some googling I found that haproxy can balance non-http services but examples of non-http configurations are few and far between, this blog post lead me to my solution, so after the jump I have a haproxy.cfg which will load balance smtp round-robin style across 4 servers, you also get a webstats interface listening on http://IP:8080/haproxy?stats (username = me, password = password).

By changing the port numbers from 25 (SMTP) you can effectively load balance any TCP app :)

Bash script to fix file permissions recursively

I love the redhat implementation of cron, simply drop a shell script into /etc/cron.daily/ and your script will be executed every day (by default at 4am).

Recently I’ve been having a small problem with mediatomb, further investigation lead me to a “Inotify thread caught exception” error which can be fixed by recursively resetting your file permissions.

What I have done to fix the issue is save the following code as /etc/cron.daily/fix_mt.sh and ‘jobs a gooden’ :cool:

Is Mac the Anti-Linux or the Answer?

So, I’ve been toying with the idea of buying a mac. Using WindowsXP is a no go for me, we’re just not friends; work haven’t yet rolled out Vista. I love linux, have been using it for years, and have upset many an I.T department by partitioning their loving-crafted standard Windows Build with my favourite flavour of linux but I’m getting the same old Gripes….

History Meme - What’s your shell top 10?

Planet gnome have started a trend

$ history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
114 ping
107 sudo
82 ssh
71 top
71 cd
68 iwconfig
56 ls
46 usbkey.sh
43 ps
33 evolution

The output shows what commands you type the most, usbkey.sh is a script to unlock the secret-keys held on my usb key-fob, sudo is high up probably cause I use sudo to bounce services (the intel wireless drive crashes quite alot and both it and Network Manager then need restarting) and evolution needs a shutdown every now and again :( The other commands are fairly self-explanatory.

Windows Key on Fedora, Thank you Ruben

I’ve been running compiz fusion on Fedora 8 for a while and found that my windows key short-cuts only work half the time; well I found that if I…

add Option "XkbOptions" "altwin:super_win" to the InputDevice section of my /etc/X11/xorg.conf

It works every time. I’ve logged in and out of my laptop a few times over the last couple of days and had no problems since.

Thank you Ruben :D

Fedora HP Compaq nc6320: Overheating CPU

I’ve been having issues with my laptop overheating recently, in fact ever since loading fedora the cpu has run hot. According to CoreTemp when in windows my CPU idles at 56ºC ( i.e. I’ve logged into windows opened outlook and walked away) considering my AMD Desktop machine runs at 40ºC with two users logged and the CPU peaking at 100%, means that my laptop cooks. In Fedora I’ve found that the CPU actually Idles at around 70ºC which is a joke, it means that the fan is kicking out hot air causing my desk and everything around it to get proper hot - don’t leave any chocolate bars near me!

Bash looping through directories & sub-directoires

Note to self…. If I want to “do” something to all files in all sub-directories then I need…..


#!/bin/bash
export IFS=$'\n'
for i in $(find $1 -type f)
do
echo "$i"
done

Seahorse is running in insecure memory.

Seahorse is a cracking GnuPG implementation for Gnome.

Just like GnuPG it also requires secure memory to get the best privacy; I can never remember how to set this up, fortunately there’s an faq on gnupg.org so a quick…

sudo chmod 4755 /usr/bin/seahorse*

and we’re done, no more error messages :)

MediaTomb makes its way into fedora

Looking through the my yum updates for the day I notice that mediatomb is set for an update, is this the version 0.11 with transcoding we’ve all been waiting for? Sadly no, but it is a fedora build for the default repo - YAY :D

http://koji.fedoraproject.org/koji/packageinfo?packageID=5527

A big thanks to mwiriadi for this!

Fedora 7 to 8

As it’s quiet at work (due to the usual x-mas madness) I decided on Friday to upgrade from Fedora 7 to 8, now this was a bit of a risk for me since I have F7 running perfectly. The fedora release notes advise a clean install over an upgrade, so it’s important when you do this to backup /etc so that you can restore anything you need later.

As with all fedora installs it’s always two steps forward and one step back, my reasons for upgrading were:

Flushing the Evolution Exchange Password.

I know that day light savings is new to the US, but in the UK it has always been, anyway something weird happened this year, the clocks changing clashed with a password change; now this may not have been the fault but since then I’ve not been able to get my gnome evolution email client to connect to our corp’ Microsoft exchange server (via exchange-connector).

After a bit of fruitless googling for authentication issues, I decided to try and flush my evolution settings by deleting (well moving actually) my ~/.evolution directory, but this didn’t help, neither did deleting the account within the client (you know via mail setup)… fortunatley I found the following FAQ :

Fedora 7: Theming the Gnome Screensaver Lock Dialogue

Fedora 7 Flying High Locked Theme

I stumbled across this the other day, I’ve no idea why the fedora team would go to the effort of making a really nice theme for the lock dialogue for gnome screen saver then leave it “disabled by default”. After a quick google I found the ubuntu guys have been up to something similar, so here a quick how to enable the fedora art work on the gnome-screensaver lock screen.

To enable paste this into a terminal (NOT root, as your normal user).

gconftool-2 -s --type=string /apps/gnome-screensaver/lock_dialog_theme system

To switch it back:

gconftool-2 -s --type=string /apps/gnome-screensaver/lock_dialog_theme default

Security updates only for Fedora 7 / RHEL & Centos 5

I found this on redhat.com the other day….

It is now possible to limit yum to install security updates only. To do so, simply install the yum-security plugin and run the following command:

yum update –security

Hopefully this will allow fedora users to have the option of running a “stable” install :)

Weather Wallpaper rpm for Fedora 7

It’s not often I blog twice in a day, but after seeing this post I just had to see if I could build a rpm for fedora 7.

I’ve updated my repo for fedora 7, so.. yum install weather-wallpaper should do the trick :cool:

Edit: Hidden yum transation behind more tag.

Start.fedoraproject.org

A fedora start page is being tested… the original mine looks a little different tho, nothing a quick css update wouldn’t fix :)

... note quite working as expected!

... note quite working as expected!