Skip navigation.
Related Links
linux
Syndicate content

Linux

Linux is a great OS, don't you think? I know I do - and here is a list of stuff about linux such as tips on use and useful software.


Removing trailing spaces with vim

16
Jul
2008

Baby Tux

After recently reading about how great VIM is for the three hundredth and fifty second time (I kept count), I decided to take a look.

It really is quite cool! I've also decided to try to log any cool tips I learn about it. Here is the first which I found after running the coder module on one of my modules (Page Title 2) and it threw hundreds of errors about too many trailing spaces on empty lines.

Getting Lighttpd working with AWStats

21
Apr
2008

Lighttpd meets AWStats

Following my previous post about configuring Lighttpd on this VPS Webserver to replace Apache I bring you a guide to configuring AWStats under Lighttpd. This process is differs to Apache as control of directories and aliasing is handled differently. There can also be complications if you have previously enabled the Drupal LUA Magnet script on your site for clean URL handling!

How to batch rename files

19
Apr
2008

This afternoon I needed to rename a bunch of files from one form to another in a command shell… Well technically I didn't need to do it in a shell - but, as sure as there is a hole in my ass, I wasn't gonna go through renaming them all manually!

They needed to go from, for example, add.png to add_32.png. After a little research into commands like printf, awk, bison and so on - I suddenly realized that 'cut' held the key!

for i in *; do j=`echo $i | cut -d . -f 1`; j=$j"_32.png"; mv $i $j; done

Powered by Lighttpd

16
Apr
2008

Lighttpd LogoThis blog is now no longer powered by Apache (the feature filled but slightly bloated beast), instead I have decided to give Lighttpd (pronounced Lighty) a whirl.

What convinced me? Ages ago I read an article by Dries Buytaert comparing webserver configurations. It was shocked to see that Lighttpd appeared to be able to serve almost twice as many pages per second as Apache. There is also the advantage that a static file will only cost you substantially less memory to serve in Lighty than it will in Apache due to Apache bundling ALL the mods into every process.

So what is Lighttpd? The inventors describe it perfectly…

How much memory am I using?

08
Nov
2007

Following on from my previous post about how to check how many apache processes are running - I recently wanted to find out exactly how much memory my applications where using… So I did a little research and found a few new and useful commands!

The price of sucess - too many users!

25
Oct
2007

Recently at work we had been having issues with spiking server load. One of the potential suspects was the Apache configuration as it was allowing 256 MaxClients. Combine that with Drupal eating RAM for breakfast (say a minimum of 12Mb per page) and you have a recipe for disaster - too many visitors cause a RAM shortage, lots of swapping and eventually a server meltdown. After speaking the Rackspace Technical Support Team, one of the guys there (Daniel) wrote a VERY useful script for us to run on the server to monitor Apache usage.

Getting the most out of Fedora Core 4

28
Sep
2007

Powered by Mysql & ApacheI recently looked into which versions of software I was running and was a little concerned to see how backward Fedora Core 4 was in some areas. I did a little Googling around and found a website (http://remi.collet.free.fr/) which is predominately written in French (but has a few English translations) which provides a new repository for Fedora Core 4's Yum Installer Package which provides far more recent RPM's for the likes of PHP and MySQL... So I installed it!

Force a PDF to download

06
Aug
2007

Apache HTTP Feather LogoI recently needed to force a PDF to download using Apache. The default behaviour for most browsers is to try to open the PDF inside the browser itself. This is fine for a small PDF or for powerful machines - but a large PDF on even a modest machine can often lock the browser up. This needed fixing!

After 20 minutes of perusing the Apache documents, I happened across the FilesMatch option which takes Regular Expressions. Regular Expressions are cool things which pattern match; you give it a rather complicated (yet logical) pattern and it matches it for you. Initially I used something like this...

Which modules use hook_cron?

14
May
2007

Drupal Grep

I recently needed to find out a list of modules which used hook_cron. I have SSH access to my server. Instead of writing a module (or using devel to execute some PHP) which returned the result of module_implements, I turned to Grep. Simple CD into your modules folder (can be the Drupal install, but you end up recursing through unlikely folders) and run this:

grep -R "^function.*_cron" *module

How to SCP a path with spaces

14
May
2007

Baby Tux

I recently needed to remotely copy over SSH a folder from the remote machine to my local machine. Usually this is not a problem, however the path to this folder had a space in it. The folder itself is rather large and contains files which wouldn't really benefit from compression. It turns out the solution was quite simple.

From Russia without Love

08
May
2007

Spam with Chese

I've recently been receiving some spam from some Russian IP's. As each spam attempt was from a different IP, blocking individual ones was a little futile and time consuming. I did a quick google and ended up at Deekayen's website as it seem's he has had similar issues. His solution was an Apache level "Deny"… My sollution uses iptables.

YAFC as an FTP Client

02
Feb
2007

Firstly - YAFC? "What on earth is YAFC?" I hear you say. YAFC is a command line FTP tool which, unfortunately, only comes in source code which means you need to know how to compile it. Fortunately, compiling it is easy - it required very few dependencies and most of those I could install using yum on my linux box (Redhat Fedora).

Drop all tables in a MySQL database

10
Oct
2006

This morning I am faced with a task that will involve repeatedly dropping and reimporting a lot of data. MySQL has DROP TABLE and DROP DATABASE but there is no command to drop all tables or truncate the database.

RRD::Simple - an API for Round Robin Files

03
Oct
2006

After trying on and off for days to find an easy way to use RRD to keep an eye on server load (found in places like the top and uptime commands or in the /proc/loadavg file), I found this. Its fantastic!

Webmin OSX Tiger Theme

07
Sep
2006

If anyone has ever used webmin then its quite likely they'll have got bored with the default theme very quickly.


It'd be nice if you asked before taking stuff from my site. Contact me at webmaster [at] thingy - ma - jig . co . uk

This site was based on the Cobalt 2.0 Theme for phpBB written by Jakob Persson

Free MiniMac

Free MiniMac

Social Statistics
Search
Google



Weblinks

Add to Technorati Favorites

TGC Webring

CMS Drupal Showcase

Feedburner for ThingyMaJig

View Nicholas Thompson's profile on LinkedIn

IconBuffet

Twitter

bile-edge