Categories
Development OS tricks

Bash #2

Part of what I find really hard with Bash scripts is encapsulation and error handling. It all became a tiny bit better when I discovered how I can print the call stack when something occurs. Check out this blog post for how to print the call stack.

I’m thinking this fits nicely with trap, but I’ll have to try that another day. 🙂

Categories
Development OS tricks

Bash #1

I’m currently working on automating our deployment with Bash scripts. For a TDD loving Java programmer it can be quite hard to figure this all out, but I’m getting better. I don’t ever think I’ll start to love it, but maybe one day I can like it. 😉 I’ll try to share small snippets of what I learn here.


set -e
set -u

I always have these early in my scripts. That way I know if anything fails (set -e) and if any variables is undefined (set -u).

Any other tips?

Categories
OS tricks Web

The backups you never make

So my harddrive for my home-server crashed. Seems like it short-circuited or something. Any tips for restoring would be appreciated. 🙂 I had devised some sort og backup mechanism, that obviously didn’t work. Lost about a years worth of posts. 🙁

Have signed up to Dreamhost now which offers 200GB diskspace on the cheapest plans. Finnally we are seeing hostingplans that are viable for my hosting. My first impression of their controlpanels etc. are really good too. Some minor glitches, but seems like a well thought through product.

UPDATE: Think I retrieved most my content from some caches. It’ll be a fair bit of job to put it back into wordpress, but at least it’s not lost. 🙂