DIY


21
Feb 09

Backing things up a la Crashplan

Backing things up is very important… your hard drive will fail one of these days, and when it does you will lose everything (trust me, my laptop hard drive failed once…).

bit of HDD failure

You are backing important things up right? Oh…

Enter Crashplan. It seems like a simple way to set up your important things to be backed up elsewhere, either on another hard drive, another computer (maybe a family member’s or maybe even on their servers (don’t worry… it is encrypted quite well).

The first thing you have to do is get it (down in the right corner):

Getting Crashplan part 1

Then you have to chose the version you want to get (Linux for me obviously):

Getting Crashplan part 2

Unzip it and install it:

Welcome to The Crashplan installer

You will notice that I am installing as root, that is because of this notice:

NOTE: You are apparently not installing as root. While it is recommended to
install as root it is not required. If you continue to install as seanja
then Crashplan will only be able to back up files readable by seanja.

You can install it as a non-root (admin) user if you only want to backup files that are yours, but I have files that I would like to backup elsewhere. I just installed it using the defaults:

Crashplan Defaults

Ah… I had to install this twice because I messed it up the first time… make sure that you are in the directory that you unzipped crashplan to so that you can just run:

sudo ./install.sh

Then start Crashplan (which will auto start at the end if you told it to), and signup for an account:

Sign up for Crashplan

And if it all went well, you will now have Crashplan up and running, you can now install it on another computer using the same account, and it will recognize it as another one of your computers and let you backup to it for free.

3-backing-up


6
Aug 08

Xampp Virtual Hosts

One of the tools in my tool box is xampp, which seems to work better than trying to install everything bit by bit (at least it did at work). One thing I never considered was setting up virtual hosts for each project, I always worked from a folder so that to access the site I went to:


http://localhost/sitename

That is fine, but what happens when you are working with a site that needs to be the root site (ie: it has links like /page_name.php which bounce you out to the root)? In that case you need to set up a virtual server. In xampp they have separated the files out to ‘make it easier’ on a user to find what they want. Sometimes this is not the case… so here is how to setup a virtual server (at least it worked for me) on Windows Vista (and XP, and with some small modifications Linux and Mac as well).

Find the httpd-vhosts.conf file, it should be:

    C:\xampp\apache\conf\extra\http-vhosts.conf

if you installed it in the default location.

Then go to the bottom of that file and add:

<VirtualHost *:80>
  ServerName http://sitename.127.ca
  DocumentRoot C:\xampp\htdocs\sitename
</VirtualHost>

if that doesnt work, then there might be something in the http.conf files that is stopping access to that folder, in that case, add

 <Directory C:\xampp\htdocs\sitename>
    IndexOptions +FancyIndexing NameWidth=*
    Options Includes FollowSymLinks Indexes
    AllowOverride All
    Order allow,deny
    Allow from all
 </Directory>

So, you have:

<VirtualHost *:80>
  ServerName http://sitename.127.ca
  DocumentRoot C:\xampp\htdocs\sitename
  <Directory C:\xampp\htdocs\sitename>
    IndexOptions +FancyIndexing NameWidth=*
    Options Includes FollowSymLinks Indexes
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

While you can probably put the site in any folder on your computer, it makes sense organizationally to keep them all in the htdocs folder (at least it does to me…), so that is why the example uses the path

    c:\xampp\htdocs

You should now be able to access your site by going to:


http://sitename.127.ca

For why 127.ca see this site.


23
Jun 08

Batch Editing Photos with Phatch

My dad was looking to edit some photos to be able to send more than just a couple through email. He needed something simple, all he really wanted to do was either lower the quality or shrink the image (make the file smaller than the 2 mb that it started as). The other requirement was that it runs on his eeePC which is the linux version.

There were many options out there, and eventually he did settle on something that was already on the system (what appears to be an equivalent to MS Paint). I however found something way more interesting to play with. It is called Phatch (cleaver name eh?). And yes, it works on Windows too (since Kris was complaining about her large number of overly large photos).

The interface is simple, and I am sure that even a trained monkey could use it, so there is no excuse not to try it out. Well… maybe if you are on a mac there is already a program for this seing as it is monopolistic and all, or you are still running dos or something silly like that… no… wait, you can use the command line too, nevermind… even you DOS traditionalists can use it (ok, don’t quote me on that one, I don’t think it really works in dos… but seriously, upgrade your system). Infact, as I write this post I will be installing it on vista (here’s hoping that it works, or I will look like a dummy (more so than usual)).

First you have to get Python from here. Or if you are on Linux you probably already have it installed (or use apt-get install python). For some reason python does not add itself to the path variables in Vista (not sure about other versions of Windows). Thats not a problem though because python associates all of the .py files with python so all you have to do is double click them (booya!).

Next, you need to install wxPython (Python bindings to the wxWindows cross-platform toolkit) from here. For Windows scroll down and find the one that is suited for your version of python (2.5 is the latest one as of this post) you will most likely want the Unicode version (as it says on the page). Then I am asuming at the end of the install process you want to leave everything checked except the viewReadme (unless you will be using it to write software).

Finally if you want to install pil (Python Imaging Library). Which is available here. Once again, download the one for the version of python that you downloaded (pil 1.1.6 for python 2.5 for me). Install that (there were some “could not create file” messages for me, but we shall see what happens). It all works by the way.

If you are on Linux there is one more step and that is to install findutils. Which is apparently used to add search functionality to programs.

On ubuntu all I had to do was download the .deb file and install it from there.

Now you are ready to install phatch from here (at the bottom of the page beside the number 2).

Ok, moment of truth, I am downloading it, and I will try to install it as soon as I unzip it (if you cannot unzip the file get 7zip and you will be able to do so no problem. Inside the unzipped folder there is a folder called Phatch, this is where the program is run from (mine is at C:\phatch\phatch). And here is the running program:


Moving on…

Once you have what appears to be a working program you can start the magic. Click on the plus sign like it tells you to (see what I mean about monkeys?) and you are confronted with this screen:Phatch Actions

This screen contains what I can only assume are the “most common actions” that the author of the program uses. If all you are doing is changing the size you are fine. So, click on Scale and you are given the options for that action as you can see here:

Scaling options

Each one of the rows that you see here (the last one of which is highlighted in blue) is clickable and editable. In the image I have left the standard settings but you can change them if you want. Once you have chosen all of the things you want to do to the images (or image) add a save action to the end (if you forget phatch will remind you (I think)), choose the options for saving it. Where you want to save them, what you want the files to be called, the type of file (I suggest png as it is quite portable and has really good quality). Then click the play button (Execute the Action). You can actually just leave it all alone and it will automagically use the same file type, and create a folder with _phatch on the end. The end result will be a new folder in the location that you decided full of your creations. Beautiful.

But, we are not done! Thats right, there is more. Once you are happy with the result of all of your tinkering, you can save your Action list for later. If you want to be even more creative, you can do File -> Export -> Action List Droplet. This makes an executable that will carry out all of the actions that you have used in this action list. This means that you can send your action list to a friend and tell them to drag and drop a folder onto the executable and they will get the same fun actions done to their photos. Apparently it just links phatch up to your script and runs a windowless version of python. I think I prefer to just open up phatch and drop a folder on it instead. You need to install the Python Win32 Extensions (which can be found here the one in the big green box) to be able to do this. You might have to restart Phatch after you install this. I am about to find out. The answer appears to be yes.

Here is my Cool Action List Droplet. Try it out!

Apparently it needs python to run, but mine cannot find pythonw. Fortunately this is easy to fix by adding python to your path variables.

Control Panel -> System -> Advanced (Settings) -> Environment Variables (at the bottom)

Look in the System Variables box (the bottom one) for the variable called Path select it, click on Edit and add:

;C:\Python25

To the end of it. Click Ok and then close all of those windows. You should be good. Though apparently mine is still not for some reason. Oh well, all I have to do is look for pythonw (which is in the python folder (C:\Python25) and click it when it asks me to and all is good. I am not really sure why this is a problem (probably a different version of python than this was written with), and I am not about to fix it myself seing as I do not know python. I might inform the author of this small problem though.

Oh ya, and if you want to share with your friends that are not on Windows you can just send them the .phatch file. Like so.

Here is the end result of my phatch file if you don’t want to try it out.


13
Oct 07

Make yerself a stealth banjo!

Stealth Banjo

Make a little guitar into something useful, like a Banjo!
Everyone plays banjo! Humans are born with it!
Just strum the open strings of a banjo. That’s a G chord. All the other major chords are one finger straight across. Now you know 300 songs!
“Banjo” is the sound the banjo makes. Your thumb hits that funny high string and it’s magically never a wrong note. When you’re saying the word banjo, that’s a banjo song!
Any dog that wags a tail can play banjo too. Just put the banjo and the wagging tail together, and you’ve got a fine sound…


22
Oct 06

Plumbing

Ok, so I decided that I would get a blog over here cause I got bored of the blogspot one, and hadn’t posted over there in a long long time. This also looked interesting and it is open source so I can see how it works.

There is a pipe that burst (apparently) under my house in Peterborough, so my house STINKS! It is terrible. We called the landlord today and he was here almost all day (he is a great guy) working on the problem. He still hasn’t fixed the whole thing quite yet, but at least we can now flush a toilet without worrying about it filling up the basement. We still can’t run the shower (I don’t want to risk it really) or anything on the main floor yet. I am not sure exactly why this is (I think it might be because this is the pipe that burst). He is coming back tomorrow to finish fixing the problem (he is replacing the pipes that were broken). Fortunately this is reading break and we don’t have to worry about being anywhere or needing to get anything done really so we can stick around while he fixes the problem. I am not sure whether or not we will be paying him for the pipe that he needed to buy (as it is probably our fault that this happened).

I think I know exactly what happened actually… Matt decided to put paper towels in the toilet and it got clogged so he used a plunger and sent them down the drain clogging it and making the pressure in the pipe build up and therefore breaking the pipe. If that is the problem we shall have to talk to him about the miraculous thing called a dish cloth, which can be washed and not flushed down the toilet.

Reading break is not really a break at all though, it is a time to do 2 assignments, to study for the math 260 quiz, and possibly to meet with teachers about the 401 project. Hopefully I will have enough time to figure out the assignments by myself as I have not really looked at them. The 332 one is probably going to be the hardest one as we have to prove one method of CPU scheduling is faster than another (I think). The 305 one will be a lot easier (I hope) because I think I have payed better attention in that class compared to 332 (and it is more interesting to me). I wonder if Steve will be able to help me with the 332 assignment.

The quiz that I have to study for is COSC/Math 260. It should be not too much of a problem, as it is a really short thing compared to the others (man I love Firefox 2.0 RC3 with its integrated spell checker and dictionary). The first one was not too bad, I probably should have studied a bit better for it though.

And I am off.