Bill Farmer

Random thoughts on random subjects

Upgrading WordPress

by Bill Farmer. Categories: Hacking .

This site has the firewall set up so that the web server has no external access. This means that I can’t use the usual WordPress update mechanism to keep it up to date. I use FileZilla for maintaining the server, and I recently discovered you can use drag and drop to move stuff around remotely.

So my easy WordPress upgrade method is:

  • Download the latest zip file and unzip it.
  • Rename the wordpress folder to something else, like wordpress-old.
  • Upload the new wordpress folder.
  • Move the stuff you need from the old wordpress-old folder, like themes, plugins, uploads, any modified theme files and your config.php file.
  • Check it works and upgrade the database.
  • Remove the old wordpress-old folder.

Nearly as easy as letting it do it itself.

Read more →

Haskell

by Bill Farmer. Categories: Hacking .

I read an article recently about how amazingly efficient functional programming, and Haskell in particular is. So I thought I’s give it a go and see how I got on.

You can try it out in your browser: http://tryhaskell.org

    λ let factorial n = product [1..n] in factorial 99
    9332621544394415268169923885626670049071596826438162146859
    2963895217599993229915608941463976156518286253697920827223
    7582511852109168640000000000000000000000
    :: (Enum a, Num a) => a
    λ  

Pretty impressive! So I thought I’d try a simple web application.

    import Network.CGI
    cgiMain :: CGI CGIResult
    cgiMain = do
        setHeader "Content-Type" "text/html; charset=UTF-8"
        output "Hello World!\n"
    main :: IO ()
    main = runCGI (handleErrors cgiMain)

This seemed to work, so I tried a graphical GTK app.

Read more →

SlimStat

by Bill Farmer. Categories: Hacking .

When I first set up this web site, I looked for a simple web analytics program so that I could see if anyone actually looked at it. After faffing about with a couple of well known open source packages, I decided that they were way over the top by several orders of magnitude. Then I found SlimStat. However it appears to be no longer actively maintained, which it why the previous link is via the Way Back Machine. But it works just fine. It’s also on Github and Google Code.

Read more →

Raspberry Pi Wifi

by Bill Farmer. Categories: Hacking .

When I got my Pi some months ago I bought a wifi adapter for it, as you do. But I couldn’t get it to work reliably in Raspbian, and I didn’t even try in Arch Linux. So I tested the adapter on my windoze box, and it worked just fine, and I tried it with Linux and it worked just fine, so I put it in the ‘too hard’ box.

Read more →

Python

by Bill Farmer. Categories: Hacking .

I’ve studiously avoided Python up till now, even though it appears to be fairly popular, because it violates the first law of compiler design: ‘Blank space shalt not be significant except to separate tokens where necessary.’. That’s why you can minimise a lengthy JavaScript script like jQuery to one enormously long line and it still works just fine.

But, she-who-shall-be-ignored (self categorisation) decided she wanted to enter an advent calender competition which involved checking a web page to see if your name has come up and sending an email if it does. So I thought that’s an ideal little job to run on my Raspberry Pi. So I installed the ssmtp package and attempted to test sending an email. After several days of faffing about with no joy I gave up.

Read more →
Previous page Next page