Category Archives: linux

Compiling ArcEMU on Fedora

I was trying to compile ArcEMU on Fedora and I kept geting the following error:

configure: error: Couldn’t find pcre library. Make sure your pcre path is correct.

Turns out if you don’t have the mysql-devel packages installed you get this error.  That makes a lot of sense.  After an hour of searching the web and building pcre over from scratch a dozen times, I finally found a post that mentioned a problem with using mysql-devel 64bit packages.  I checked and didn’t have mysql-devel installed, so I installed it and it compiles just fine now.

Lack of posts recently

I’ve been slacking on the posts recently.  There has been a lot going on.  I’ve switched jobs and I’m now working for E.W. Scripps’ Online Division.  E.W. Scripps is newspaper company based in Knoxville and also formally part of HGTV, FOOD Networ, etc.  I was brought on to help split out the web servers during the company split.

We’ve made a lot of progress on getting things running more effeciently.  We’ve recently upgraded from Postgres 8.1.3 to 8.3.3 which made a huge improvement.  Even though Postgres claims that writes don’t block reads and reads don’t block writes, we were seeing a lot of processes getting hung waiting on a commit to finish.  I think that it was having problems starting a new transaction while a transaction was commiting.  Postgres 8.3 introduced asyncronous commits, so that we no longer have to wait for everything to be flushed to disk before we received the commited status.  Now we immediately get a commited status and transactions are written to disk as they can be.

This has been a HUGE performance gain for out database.  Before we had seem the database hit loads over 300 while getting Drudged.  Now we never see the database get above a load of 10, they ususally over around 3 to 4.

Next we will be working on clustering Postgres.  I have evaluated CyberCluster, PGCluster, Slony, PGPoolII and Sequoia.  The only one that seems to be reliable and meet our needs has been Sequoia, so we will see how that goes.

Oh, and I’ve also got a new MacBook Pro.  More on that latter.

Task_Killable in 2.6.26 kernel

Ever been frustrated by a processes that you could not kill on a Linux box?  I know I have, especially working with Samba and NFS.  Good news, there is a new sleep state that will help eliminate the problem and more code makes use of it.  In fact most of the NFS code has already been converted.  Check out the link here and read more about it:  http://lwn.net/Articles/288056/

Huge fonts and toolbar in firefox 3

I’ve tried the firefox 3 beta a couple times on my linux box.  Every time I try it the fonts and toolbars are obnoxiously big.  I couldn’t find any help on this.  It seemed like a dpi issue, so I went to about:config and searched for dpi.  There it was layout.css.dpi.  Mine was set to -1, I changed it to 150 which seemed about right.

Type about:config in you browser window.  Then type dpi in the filter text box and double click the layout.css.dpi to change the value.  I changed mine to 150.

Interesting tools.

Two things I ran across today that I need to look further into.

http://latencytop.org/   – This shows what processes are waiting on and looks very interesting.

The other is Group Scheduling in Linux 2.6.24 and above.  This allows you to put processes in a group so that one set of processes can share the same resources.  For example, you can assign two different users 50% of the processor and one use could be running 50 compiles but should not affect the performance of the second user.

Sorting a loop in bash and other possibilites

As I said in my previous post, I learned a couple things about bash today. I had a nice for loop that outputted the info I wanted, but not in the right order. I thought to myself, man if this were php I would just put it in an array and sort it before looping across it. I bet this will be a pain in bash.

BUT, I was pleasantly surprised to find out how simple this really was. If you want to perform an action the output of a loop in bash then you just pipe done into the fuction you want performed. See the example below.

for VAR in $VARS; do
{someaction}
done | sort -n

Cool, right?

Lineing up fields with BASH (or other programming languages)

Learned a couple things about bash today. I was wanting to print something out nicely, so I was using tabs to separate fields. As you know, nothing ever lines up if you do not have values very similar in size. So I was about to search Google for the problem when I had a moment of sheer brilliance. 🙂 I thought I’ll just concatenate a bunch of spaces on the end of the variable and then use cut to grab how many characters I want. I was very proud of myself, but then bash quickly humbled me by condensing all my spaces I had added to the variable.

So, back to the all knowing Google. Turns out you have to quote your variable when you use it if you don’t want bash to truncate the spaces. So I quoted my variable when using it and all is good.

BUFFER="$VAR                                                                "
NICE_VAR=`echo "$VAR" | cut -c -15`
echo "$VAR $VAR2"