June 2008

And you thought it was dead!

GOTO batchscript

:batchscript

Yup, the other day I had to do some googling to find out how to write some nasty batch script. (GOTO ftw). It’s pretty simple, just enough to prompt you for y/n and then an IF statement to see you typed y. I did this because ideally when you shut the computer down it prompts you to ask if you want to do a sync or not. This is so that if you just want to reboot, you don’t have to wait through it to sync, plus if you haven’t actually changed anything you don’t need to do a check. After writing the script I added it to the logoff scripts so that it would be done when I shutdown. Unfortunately it doesn’t run those scripts until after it shutsdown the whole GUI thing, so it basically just freezes while it waits for you to type ‘y’ but you can’t actually type it. So that didn’t work. I think I’ll just change it so that you just run the file, it does and update and then shutsdown the computer when it’s finished. Or just add it to the task sceduler. It probably uses a small enough amount of resources to just do it’s thing regardless of what I’m doing and it shouldn’t impact whatever I’m doing (unless I’m trying to play Crysis maybe).

Setting up cwrsync was a little strange because rsync still thinks it’s running in linux so you have to deal with the whole absoulte path thing e.g. /usr/… Solution: use absolute path ‘a la unix’, replace backslashes (\) with slashes (/) and put -/cygdrive/- in front of the drive letter.

@echo off
SET /P Choice=Do you want to do a backup before shutting down (y/N)?
IF NOT ‘%Choice%’==’y’ GOTO end

SETLOCAL

SET CWRSYNCHOME=”C:\rsync”

SET CYGWIN=nontsec

SET HOME=%HOMEDRIVE%%HOMEPATH%

SET CWOLDPATH=%PATH%
SET PATH=%CWRSYNCHOME%\BIN;%PATH%

rsync -av –exclude=*.db –exclude=*.ini “/cygdrive/d/Pictures/” “/cygdrive/z/phill/backups/Pictures”
:end

This is my batch files or .cmd file actally. It syncs up my Pictures folder on my NAS (which has been mapped to Z: drive) with the pictures on my computer. I noticed that when I open up picasa, it seems to change the modified times of the .ini and .db files it puts in the folders. I didn’t see any point to keep these files synced, so I excluded them. Otherwise everytime I opened picasa it would go through and update all these files. Even though they are small, it still takes a while for it to traverse my whole Pictures folder updating these files.

I found that to do this simple task, cwrsync doesn’t actually have to be installed. You just need the binary and some of the .dll files. You don’t need to use the cwrsync server thing either. I guess it just depends on the setup.

Next is to get this going on my parents machine. Hopefully it works in Vista.

Just as a thought, I wonder what would happen if I replaced the the shutdown.exe file with my own one that ran my script and then did shutdown.

general

Comments (0)

Permalink

Not even death can save you from me!

So, after several days of speculation, Blizzard has announced Diablo 3! I don’t think I’ve been more excited about a game before. It’s a pity that it probably won’t be out for a long time yet, but something to look forward to. I downloaded the ~800MB gameplay video they released and it looks like everything I could hope for. I think they have taken some inspiration from games like Titan Quest but made it Blizzard style (read: better).

Diablo 3 screenshot

general

Comments (0)

Permalink

For another rainy day

So, as mentioned two posts ago, I tried to install ruby (the programming language) on my NAS server. This was so I could use the ruby rsync to sync the freeNAS up with my Amazon S3 account. It is basically a watered down version of freeBSD, which is UNIX (not LINUX apparently) so of course it’s going to be an absolute mission. Firstly, a lot of the commands were different to those used in Ubuntu or Debian like I’m used to. For example they have “fetch” instead of “wget” and they have “pkg_add” instead of the useful apt-get package manager. It doesn’t seem to have man pages, I assume they must have taken that out of freeNAS in order to lower the installation footprint. All these things seem to make it very hard to me to work with it. Eventually I mangaged to find a (apparently) compatible ruby package (or port in BSD) and I think I even managed to install it at one stage, but I had no way of really using it. For example, if I installed it with Debian, I would immediately be able to type “ruby hello.rb” and it would run the hello.rb file. But this didn’t work with freeNAS, I didn’t know if it didn’t install properly or if you have to manually assign the link or binary or whatever. Also, when I was trying to follow somebodies install how-to they used shell scripts (.sh files) and either BSD doesn’t use them or freeNAS can’t run them as is, so I ended up giving up. For now.

I was quite interested to read about openfiler because it is based on a LINUX distro, something I’m used to and I don’t think it is quite as stripped down as freeNAS because it has a 1GB install rather than a 32MB one. So, something for another rainy day, either get ruby to work on my current freeNAS setup, find something else to install on it, or set up openfiler, or set up some other type of open source or freeware NAS OS.

general

Comments (0)

Permalink

Easy for once

Went down to good old Circuit City and got a Antec Tricool 80mm LED fan. Did some dodgy stuff to hook it up but it fitted all right. It’s running at 41°C now, about 5°C cooler than yesterday which is better than nothing. After hooking it up I realised that I would probably have to take it out in a few days when I get my awesome 128MB compact flash card and CF to IDE adapter which I ordered off eBay for about $10 after shipping. Pretty good deal!

Installing fan in NAS

general

Comments (0)

Permalink

You win some you lose some

Free NAS installation madness: I blame the heat. It took me most of a day of screwing around, but I got it to work. In the end, when I just opted for the easy way, it was pretty quick and easy to install really. Firstly, not having a spare compact flash card around (which apparently you can install it on, as well as a USB key), I decided to try and use an SD card plugged into my card reader. It just would not work. I booted up from a CD, and I designated it as the drive to install the OS on. It managed to copy over a config file and then it just stopped. I should probably explain what I was trying to install this on. It is an old Dell machine, with a 2GHz P4 and I think 1GB of RAM. It has two hard discs, a 120GB and a 4GB. So in the end I just installed the OS on the 4GB drive (which it actually decided to partition into a 96MB part, which it installed itself on and the rest is … gone? I don’t seem to be able to mount it). My plan for this is to buy a cheap 128MB compact flash card from ebay(~$5 after shipping), get a CF to IDE adapter from newegg (~$17 after shipping) and install the free NAS os on that to save power.

Bucket explorer madness: I bought bucket explorer. It is an alright program, works well, has a fair amount of features. But not the feature I bought it for. My fault, I was reading through their forums and saw reference to its syncing abilities … in version 2. Which has not been released yet. So, something to look forward to. They are having an open beta right now, so I expect version 2 isn’t too far away.

Next step madness: First thing I need to do is buy a fan for my hard drives in the NAS. We are sort of in a heat wave at the moment, or maybe it has just suddenly decided to be summer all of a sudden. Either way, my discs can get up to 48°C, which is 10-15 degrees more than I would like them to be.

Then, I would like to figure out some way of syncing up S3 with the NAS, rather than just with my PC. One plausible way of doing that is with a ruby rsync thing, but that was todays mission which I will have to post on tomorrow. That way, when I want to back something up, I send it to the NAS, and I have an onsite backup, then whenever it sends it up to S3 (nightly?) I will have an offsite backup also. Sounds really great.

So, in the end, I learnt a lot. Mainly that I do not like freeBSD unix.

general

Comments (0)

Permalink

Back the fuck up.

amazon s3 logo

Recently I have been considering the problem/importance of backing up certain data. The most important thing for me right now is the ~13GB of photos I have that aren’t really backed up anywhere. If I were to lose my entire hard disk today, I could get most of them back, but it wouldn’t be an easy task because they are on a hard drive in New Zealand. I think I have been very lucky so far because I haven’t had to deal with any loss of data even though I’ve never really had a decent backup system. One of my friends back in NZ had had a few HDD failures but he also had a decent backup system implemented so the loss of data was minimal.

Also, just for fun I worked out how long it would take to upload my 13GB of files at the lame 60KB/sec upload speed I have, and I think it was about 63 hours worth of uploading. Looks like my PC will be on for a few days.

Some few weeks ago I signed up for one of Amazon.com’s great services called Amazon S3 (Simple Storage Service).  It is a really cheap way to store any files up to 5GB in size. (I don’t have much stuff in there yet, but last month it cost me 5 cents) One of the reasons why it is so cheap is because they do not provide any front end interface to deal with it. So if you want to upload files to it you need a third party program, or you need to write something yourself. (They have development community for this and lots of contributions from outside Amazon itself). Here is a really great FAQ about S3 as well as a backup program someone has written (I haven’t tried it yet).

So; picking a program to handle the uploads, and do the whole sync thing so that when I put something new into my photos folder, or My Documents or whatever, it would start uploading it to my S3 account. The most popular or at least most used program I can find is called Bucket Explorer. It costs $29.99. I am a big fan of freeware, or open source programs, but for something important, I think it is worth shelling out the relatively small fee of $30 to get something that I can rely on since this is a fairly important task.

To go for the free option, there is a very simple handy little Firefox extension that I found called S3 Organizer. It’s quick and easy for uploading or downloading a file or two, but not as full featured as the Bucket Explorer.

So that about covers my intention for off site storage, but I also need to set up some kind of on site storage also. My options for me, for this sort of scale would be setting up a RAID ? as well as possibly an external HDD (which I would probably also need some sort of program to make it easy to sync up my files between my PC and the drive). The third option is to set up a NAS (network attached storage).  All of these options would be relatively inexpensive, it would just be a matter of buying several 500GB HDD. The best thing I could do would be to put another drive in my PC, set up a RAID. Get two more to put in the NAS, also in RAID. This is about the best option I can think of and would come out at $89.99×3 ~$270 for three 500GB Seagate 7200RPM 32MB cache drives, same as the one in my PC right now.

Next I need to buy/set up the Bucket Explorer and also consider the different options for NAS software.

general

Comments (0)

Permalink

Not the first

This is not the first blog I have tried to start, but maybe it will be the last.

I set this up on my dreamhost account. It was super easy, you basically click one button, choose a couple of options, and bam its all done. Setting up the design and stuff is proving to take a lot longer. But thats ok, what is time for if not to spend on something like this?

I have decided that this is as much to get my interests and knowledge out there, as much as it is to simply bookmark things that I see around the internet. So many times I think, “Wow, that’s a great idea/cool story/useful program/handy website!” and then I forget about it. Then, the day comes along when I realise I or someone else would benefit from that info, but I can’t remember what it’s called or where to find it. Some programs or websites, considering how useful they are, are remarkably hard to find.

Today is a good day so far, I recieved a phone call from someone I had a job interview with last week. He wants me to come in again next week to meet the team and have a look around and what not. Sounds geat. I feel pretty confident about it, I’m pretty sure I can get on with everyone, put on a good first impression.

Tomorrow I intend to put up a list of some of the handy things I have found recently, or have actually been using.

general

Comments (0)

Permalink