Android, Rants

All I seem to do is complain..

I’ve said long in the past that I’ve developed an AlertMe application for my phone. It’s been a while since I first created it and it has been rather entertaining to observe the cold winter temperatures remotely and comfortably from indoors.. Until now.

7 – huh? The weather service said -minus- 7..

7 ..wtf??

I had thrown in a ‘raw testing’ facility in the application for (my own) giggles, and I was thankful that I was able to use it. It told me from the raw data returned by the API which function was reporting the temperature incorrectly and other functions that weren’t affected – which was surprising that they differed at all.

*sigh* Hopefully the new version doesn’t have any other nasty surprises – I’m used to doing that all on my own!

Standard
Nostalgia, Random

I regret the conversations we never had, the time we did not spend together. I regret that I never told him that he made me happy, when I was in his company. The world was the better for his being in it. These things alone do I now regret: things left unsaid. And he is gone, and I am old.

Neil Gaiman (The Sandman: The Wake)

The quote was what first came to my mind with the abrupt news I received from the other side of the world. It was so sudden and out of the blue; it reminds me that “the best thing the devil accomplished was to convince everyone they had all the time in the world”.

I’m sorry I wasn’t around Em; I hope you knew that you made me happy in your company ever since first meeting you in high school.

Of Regret

Quote
Web

New Year upgrade with WordPress 3.3

Upgrading my desktop is a simple matter of clicking confirm. I know it is probably possible to set up WordPress to do the same, but I like to give the least amount of rights to the web-data user over my files. Here is my quick checklist of the 3.2.x upgrade to 3.3(.1)

Database backup

Don’t skimp on this step – if for some reason the upgrade fails you have the ability to restore it to it’s preupdate state. I create a full backup of the database:

mysqldump --user=root --add-drop-database --add-drop-table --complete-insert --routines -p WORDPRESS_DB > mysqldump_WP_TODAYSDATE.sql

Note that I like using complete inserts and drop tables for ease of reading (and to closely follow more standard SQL).

New code shuffle

Download the new version of WordPress and expand the files. I don’t backup the uploaded wp-content – I simply move them from the old locations to the appropriate directories in the new codebase. This way a backup of the old code also exists. Also worth noting that before moving the directories and files you need it’s probably a good idea to set the WordPress site under maintenance.

Here is the list of items you will simply need to move over:

  • /wp-content/uploads
  • /wp-config.php – you can copy rather than move to save a backup

The other directories – /wp-content/plugins and /wp-content/themes – are a little more tedious: you compare the directory contents before you move things. However, if certain items have an update that coincides with the new WordPress then these can be upgraded directly into the new codebase.

Beware – if you have installed plugins that create their own directories outside the normal wp-content convention you will need to move these too!

Permissions

You should have all the external assets (from WordPress) in the appropriate directories of the new codebase. Now check if the permissions need to be changed – like setting the group user to the web-data user or allowing code to be executable.

After this step, it’s time for the ‘great move’.

Move and test

Move or rename the old codebase, followed by moving or renaming the new codebase to the original location. Disable the maintenance and test out your new install. If you were logged in as an administrator before the change you should be able to see if you need to confirm any database updates from the dashboard.

Hopefully all the files and plugins are still in order and your site should look…. exactly the same as it did before.

Standard

A Happy New Year, 2012!

Random

Happy New Year!

Image

Mulled Wine Hot Chocolate: a boozy winter warmer! And a chocolate and hazelnut biscotti - now all I need is a Chesterfield and a blanket with a roaring fire in the fireplace..

Random

First!

Image

Container Mall

Random

Container Mall

Image
Random

Quick and dirty ssh tunnel setup

My quick and dirty setup to set up a SSH tunnel to home machines from our remote web server.

This sets up a way to access our home machine via our remote web host – just do a ssh -p PORTNUM localhost when logged in at USERNAME@REMOTESERVER.NET

Setup of keys; creating a passphrase

First, make sure that you’ve created an RSA public/private key pair:

ssh-keygen -t rsa

I had to use this since I completely forgot the old passphrase I set up in the past. Now, rather than copy over to authorized_keys to the remote server it is far nicer to use:

ssh-copy-id -i ~/.ssh/id_rsa.pub USERNAME@REMOTESERVER.NET

Passphrase permanence

To stop you from being asked for the passphrase every time you want to SSH into the remote server do:

ssh-add

.. on the (home) machine you want to access. Follow the prompts to ‘record’ your passphrase. Now we can move onto the actual port forwarding itself.

Basic port forward

Now, on the (home) machine you did a ssh-add to, I’ve set up the forward with:

while true;
do ssh -C -R PORTNUM:localhost:SSH_PORT USERNAME@REMOTESERVER.NET;
sleep 5;
done

The SSH_PORT is normally 22. I use sleep 5 so there is some time to escape out of this infinite loop if I want to cleanly close the session running this bash script. Thus the script is left running on untouched unless I need to kill it off.

Standard