Press "Enter" to skip to content

Category: Net: Techy: Linux

Posts concerning Linux

Funny: Funny Linux Commands

Shamelessly stolen from Frank Mash (or, as UK news organisations will probably argue, “this orphaned content found was at …”): % cat “food in cans” cat: can’t open food in cans % nice man woman No manual entry for woman. % “How would you rate Quayle’s incompetence? Unmatched “. % Unmatched “. Unmatched “. % [Where is Jimmy Hoffa? Missing ]. % ^How did the sex change operation go?^ Modifier failed. % If I had a ( for every $ the Congress spent, what would I have? Too many (‘s. % make love Make: Don’t know how to make love. Stop. % sleep with me bad character % got a light? No match. % man: why did you get a divorce? man:: Too many arguments. % !:say, what is saccharine? Bad substitute. % %blow %blow: No such job. % \(- (-: Command not found. $ PATH=pretending! /usr/ucb/which sense no sense in pretending! $ drink matter matter: cannot create $ ddate Today is Prickle-Prickle, the 69th day of Chaos in the YOLD 3176 and of course: unzip ; strip ; touch ; grep ; finger ; mount ; fsck ; more ; yes ; umount ; sleep Some of these work,…

Linux: Handy Varnish commands

If you are running the Varnish reverse proxy cache system on your website (yep, this is a techy post!), you might find the following command line tools useful. Varnish is a very powerful and useful cache tool which sits in front of your website and helps reduce the load on Apache/PHP – but there’s very little information about how to use it available. Hopefully this is the first of many posts about perfecting a varnish configuration. But first, let’s get an idea of some of the information that can be reported from varnish: varnishlog See what Varnish is currently processing. varnishtop -i RxHeader -I \^Referer Show the referer (sic) header for requests. varnishtop -b -i TxURL Shows requests made to the backend (-b) where the line matches (-i) the transmit URL (TxURL). Basically, shows you what is being passed to the backend and isn’t being cached. It will list all requests going to a backend, grouped by URL and sorted by a decaying average of frequency. Basically the number on the left should be single-digit and preferably all 1s or less (a higher number means the backend request is taking place frequently). [Technically, you don’t even need the “-b” as…

Techy: Find and replace on Linux excluding SVN folders

Just another snippet aid to memory, this find and replace (using perl) uses Linux’s find’s “prune” syntax to “prune” the path before it to avoid doing and search and replace on .svn folders: find -path ‘*/.svn’ -prune -o -type f -exec /usr/bin/perl -pi -e “s/ORIGINAL/NEW/g” {} \;

cPanel: Error: Package system can not be repaired automatically

If, like myself, you have recently upgraded the cPanel control panel system on your Red Hat Enterprise Linux 5.2 server and received the error message “Error: Package system can not be repaired automatically” when upgrading Apache, then it’s probably caused by a problem with either the RedHat Package Manager (RPM) or YUM. To fix it, first ensure that no RPM or yum updates are running: ps auxwww | grep yum ps auxwww | grep rpm If any are running, find out why and kill -9 them if they are zombie processes. Now you just need to rebuild the RPM database: rm /var/lib/rpm/__db.* -rf rpm –rebuilddb This process may take some time (between 1 and 30 minutes depending on your server speed and the number of packages installed). Once it’s completed, you should be able to upgrade without problems.

Techy: 10 Absolute Nos! For Freelancers

Wake Up Later has a list of 10 Absolute “Nos!” for Freelances which include (with my comments): Can you show me a mock-up to help us choose a designer/developer? When I worked for a web hosting company, we did waste a lot of time doing web site designs for people as “mock ups” and a few times we did see the ideas “recycled” in their finished design even though they hadn’t paid us. The percentage of “mock ups to completed projects” was quite low as well – meaning wasted time. Oh – and the number of people that said “I don’t like that mock up, can you do another”… Grrr… On the plus side, I’ve just realised that an insurance company that I wrote the billing system for nearly a year ago whilst at my previous employer is still in use, despite the pet insurance company having very little (if anything) to do with my previous employer now. Go me! Can you give us a discount rate? Am I the only person in the world that thinks “The price you see is the price you pay”? You don’t expect Tescos or Sainsburys to “haggle” the price of your food do…