Simple ubuntu backup to S3

After browsing the web for ages to find a decent solution to backup my server to amazon s3 I finally came across one and I’m just throwing it up here. Reqs: So basically all I need it to do was backup my sites(filesystem and mysql databases) and some config for lighttpd. Implementation: The post I’m basing this off is here Install automysqlbackup using apt sudo apt-get install automysqlbackup Run automysqlbackup as root(just to give it a test) sudo automysqlbackup ...

November 22, 2010 · Shane Dowling

8 randomly useful php tricks

1)debug_print_backtrace() I use this one a lot, print a debug-style list of what was called to get thethe point where this function is called. Very, very useful. 2) __autoload() Called when you attempt to load a class that hasn’t been defined. the autoloader to attempt an import of xyz.php. Probably not the best technique for readability or clarity in code, but has it uses. 3) ip2long() Don’t store IP addresses as strings on a db use this to store them as a long. ...

February 22, 2010 · Shane Dowling

Top 10 webapps for programmers

Evernote Although I use evernote as my brain online for everthing, it is incredibly useful for programmers too. Where I work things like requirements can be captured on almost anything, so snapping photos of whiteboards/notepads/beer mats that become OCR searchable is very handy. On top of that it’s nice to have all notes auto stored up on the web(I’d have a fit if I lost my developer diary over a hard drive crash). The client application for evernote could be better and I’d consider Microsoft’s OneNote a much better application but Evernote does everything I need it too. The killer feature being the iPhone app that lets me capture text, voice and snapshots everywhere. Coupled with JotNot it gives me a very powerful information capturing device that I simply cannot live without. This is one of the truly killer apps for my iPhone. ...

February 16, 2010 · Shane Dowling

Sync config files over dropbox

One of the many reasons for my love of linux is the idea of keeping config information in simple texts files in the home directory of each user. It all very painless. And now with Dropbox I can have a set of application configurations stored via the web. Using Dropbox, add a folder(I’ve called mine dotfiles) and add in all the useful config files you have. For me it’s my .bashrc (sets up environment stuff, can be iffy with multiple machines however) ...

February 14, 2010 · Shane Dowling

Disable jQuery autocompleter cache

For anyone wondering how to disable the autocompleter cache in jQuery(meaning you always poll the server each time a letter is entered). Simply set cacheLength: 0, in the autocompleter’s settings. Seems obvious but my googling told me never set this value below 1 or the whole thing would explode. Tried matchSubset etc and nothing else worked. Simple solutions eh?

February 12, 2010 · Shane Dowling

Php Beautifier

Why? When you’re faced with an ugly PHP file(or files) with little to do but trawl through it, there is a solution. PHP beautifier is a pear package that will process PHP files and reformat them in a (hopefully) nicer format. Installation You can install it using pear with a very simple pear install PHP_Beautifier Usage Usage is pretty dependent on your needs. What’s nice is, it takes formatting rules as arguments, so if you pass in Pear() as an argument your code will be formatted to the pear standard. ...

January 23, 2010 · Shane Dowling

The Pomodoro Technique

I bought a book, basically because it was a GTD technique that came off the pragmatic bookshelf so I figured I’d give it a shot. Explanation: To give a very brief explanation of the technique. You have a sheet with Today’s Todos, each time you do 25 minutes of work towards your todos you mark a ‘pomodoro’ and take a 5 minute break. You then clock up pomodoros everyday. Then every morning you pick from your \\activity inventory\\(an unsorted list of todos), and pick the highest priority tasks, beside each task should be an estimate of how many pomodoros it should take. For exampleI had estimated 2pomdoros for this blog post. So when selecting your pomodoros for the day you take your pomodoro average (sum of all the pomodoros you’ve ever done divided by the number of days), and don’t add more estimated pomodoros than your averages. So for example my average could be 11 and I could have 3 high priority tasks each estimated to take 5 pomodoros each, well clearly I would have to add 2 and find a third that only took 1 pomodoro. ...

January 18, 2010 · Shane Dowling

Vim!

For a while now vim has been my editor of choice and only up until recently have I began to unearth it’s potential. My reasoning before was that it was so cross-compatible(even working in ssh terminals) that this would always be my go-to editor. Now it’s become so much more! Running regexes across all working files with bufdo, crazy window manipulation and crazy editing tricks have made this editor truly fantastic. I’ve started using wherever possible, even trying out the vimperator firefox plugin. ...

January 11, 2010 · Shane Dowling

Google Wave Server Admin

Download here. What it does Execute commands from google wave on your remote server. How to set it up You need python2.6 or greater, which sucks for a lot of debian users but I need it to be able to kill processes nicely. Fill in the details required here. Deploy it to your own google app engine deployment and continue on the easy option. How it works Using google wave’s api and google’s datastore, when a blip is submitted an xmlrpc request is sent to your server, along with your hashed password for authentication. The python code running on the server is then executed as a sub process and the output is returned. If the server subprocess lasts more than 3 seconds it is killed and that output is returned, I can’t seem to be able to wait any longer before the request times out. ...

December 16, 2009 · Shane Dowling

Pseudocode Programming Process

So for the last while I’ve been experimenting with PPP as described in Code Complete. Jeff Atwood has a great description of it on coding horror. You should read the blog post the metaphor of pseudocode as tang is a good one. I’ve been using PPP for a number of weeks now and so far it’s really been working. There have been several reasons why I found it worksbut for me the most important and useful part is purely that it slows me down. ...

November 23, 2009 · Shane Dowling