Nov
26
2008
0

Backing up SVN to a Zip File

I promised in my post about getting a UTC Formatted Date and Time from the command line that I would give some tips about using it for backups.

I use my dateTimeUTC command line application I wrote about and 7-zip which is an open source command line zip utility.

First of all, I backup to my d drive into a directory (folder) called backups.

The command line tool SVNADMIN has a hotcopy option which makes a copy of the entire Repository to a new location without having to stop the SVN service.

So the first step I do is delete the COPY of the Repository (if it exists), then make a new copy if it.

IF EXIST "d:\backups\SVN\SVN_Repos" RMDIR /S /Q "d:\backups\SVN\SVN_Repos"
MKDIR "d:\backups\SVN\SVN_Repos"

SVNADMIN hotcopy D:\SVN_Repos D:\backups\SVN\SVN_Repos --clean-logs

We now have a complete copy of the repository in D:\backups\SVN\SVN_Repos.

Now, using my datetimeUTC tool, I set a variable to the value of the filename I want to use

for /f "usebackq" %%a in (`datetimeUTC.exe yyyyMMddTHHmmssZ`) do (set UTCdts=%%a%)
SET newfile=Backup.SVN.%UTCdts%.zip

The variable %newfile% now contains something like “Backup.SVN.20081126T133505Z.zip”

Just in case it exists, I attempt to delete this file

del d:\backups\SVN\%newfile%

I then compress the entire folder using 7-zip.

7z.exe a -mx=9 -tzip -r d:\backups\SVN\%newfile% d:\backups\SVN\SVN_Repos

Calling 7z by itself will give you the options, but the options I use are:
a : Add files to archive
-mx=9 : Use maximum compression (5 is default)
-tzip : Set type of archive to zip
-r : Recurse subdirectories

Then, at the end, delete the COPY of the SVN Repository

IF EXIST "d:\backups\SVN\SVN_Repos" RMDIR /S /Q "d:\backups\SVN\SVN_Repos"

You can test the zip file for errors using

7z.exe t d:\backups\SVN\%newfile%

Directly after the test command, the parameter %ERRORLEVEL% will return a non zero result if there was any error.

I’ll post another log soon on how to email logs from the command line when errors are detected. In the mean time, set up scheduled tasks to run a batch file do complete your backing up processes.

And remember the golden rule which goes something along the lines of “If you’ve never restored a backup, you may as well not have a backup”.

Written by John Burns in: PC Tips |
Nov
25
2008
0

My first photo of the International Space Station

The International Space Station passed over London tonight. Yes, it passes over regularly but it can only be seen (easily) when it reflects the sun. Using the website Heavens-Above you’re able to perform these predictions with ease.

It was predicted to pass over at 5:45pm UTC with a magnitude of -1.9. This magnitude puts it brighter than the brightest star Sirius which clocks in at around -1.46 (A few notes about the Magnitude system are at the bottom of this post).

I only managed to get one photo during the time it appeared from the cloud and before it went out of the view of my balcony.

30 Second Exposure of the International Space Station

30 Second Exposure of the International Space Station

If you want to know a little more about the magnitude system, here are a few facts:

  • Lower (and into -ve) values are brighter
  • Higher values are dimmer
  • A difference of 5 units is 100 times brighter
  • A difference of 1 unit is 2.51 times brigther (5th root of 100)
  • A full moon gets to about -12.6
  • The sun on a clear day is about -26.7
  • Good binoculars can make out +9
  • The Hubble space telescope can make out +30
  • Click here for Wikipedia’s Article

Written by John Burns in: Astronomy |
Nov
24
2008
0

More 3D Photos

Here are the 3D Photos I promised.

They are from my first test of my dual camera rig. I got off the tube at Piccadilly Circus and walked to the London Eye.

Here are some of the highlights which I felt came out well.

As always, they are all ©2008 John Burns

Written by John Burns in: 3D Photography,Projects |
Nov
23
2008
0

So much Detail….

I can’t get over the detail I’m getting out of my 3D Stereo Photographs. The quality of the photos is just amazing.

Check out this picture..

Here is a crop from the full resolution version (click to see in 1:1 glory)..

It’s just awe inspiring. It’s put a smile on my face and I’m now tempted to take the rig on holiday to France next weekend.

I’ve processed a few other photos. I’ll try and upload them soon – I’ve been really busy lately studying for one of my Microsoft Exams.

Written by John Burns in: 3D Photography,Projects |
Nov
22
2008
--

First Photo with my Dual Camera 3D Rig

I went out a few days back and took a few photos with my new 3D Rig.

The most amazing things are the sharpness and the synchronisation of the two cameras.

Take a look at this photo.

The real devil is in the detail. Here is a crop from it. (click to see in 1:1 glory).

Written by John Burns in: 3D Photography,Projects |
Nov
21
2008
0

Easy Formatted UTC Dates from the Command line – PC

I’ve been using the command line to backup my files for a long time, but always used the date and time tools that ship with windows. the way I used to do it was like this (Sorry, long lines won’t wrap).

for /f "tokens=1,2,3,4* delims=/ " %%a in ('date /t') do set newdate=%%c%%b%%a
for /f "tokens=1,2,3,4* delims=: " %%a in ('time /t') do set newtime=%%a%%b
SET timestamp=%newdate%%newtime%
ECHO %timestamp%

This was delimiting the results from the date with a slash and delimiting the time with a colon.

This approach always had two problems for me:

  • The date and time was always the local system time
  • The date format (DD/MM or MM/DD) was based on the user running the script
  • Some locales format the date and time with different delimiters

Anyway, I finally decided I had enough with this solution and wrote a quick and dirty console application in C#.

It’s called datetimeUTC. Download it from here – If you install it in c:\windows\system32 you can call it from anywhere on the command line. It’ll need the .NET framework too.

Just call it without any arguments for the help. This is what you’ll see…

C:\>datetimeUTC
Returns a UTC date time value to a specified format

datetimeUTC [format]

Example formats:
yyyyMMddTHHmmssZ                20081121T100227Z
"yyyy-MM-dd HH:mm:ss UTC"       2008-11-21 10:02:27 UTC
"dd MMMM yyyy"                  21 November 2008
ddd                             Fri
dddd                            Friday
fff                             (Milliseconds)

Use double quotes when the format includes a space
Use backslashes to escape reserved characters

By: John Burns (www.john.geek.nz)
License: Free for any use

C:\>

Known bugs

  • You can’t use double quotes in the middle of the format.
  • You cannot get a backslash in the output as its the escape character

In a batch file, you can get the output from it like this.

for /f "usebackq" %%a in (`datetimeUTC.exe yyyyMMddTHHmmssZ`) do (set UTCdts=%%a%)
ECHO %UTCdts%

Using the above script allows you to compress backups using an accurate UTC time stamp.

I’ll write another post soon about how I compress and auto email the files.

Written by John Burns in: PC Tips |
Nov
19
2008
0

3D Photos from my Loreo Lens in a Cap

After my earlier post about the Loreo Lens in a Cap, I decided I’d post a few of my results so you can decide what the lens is like.

Here are a couple of photos I took that did come out OK.

They are all Anaglyphs so require Red/Cyan Glasses.

The photos were all generated using StereoPhoto Maker – Sorry, it’s PC Only.

All photos are (c) John Burns

Written by John Burns in: 3D Photography,Projects |
Nov
17
2008
0

A Mac OS X Dashboard Widget I can't live without – iStat Pro

iStat Pro is one of the most useful “task monitors” for an apple.

I don’t even know where to start describing how useful it is. It even tells me the charge level on my wireless bluetooth mouse.

Here is a screengrab from it (click to zoom in)

Get yourself a copy now from http://islayer.com/apps/istatpro/

It’s free, but donations are recommended.

Written by John Burns in: Mac OS X Tips |
Nov
15
2008
0

My old 3D Lens

In early 2007 I brought a Loreo 3D Lens in a Cap which is a great idea which has been implemented well but very cheaply. It’s a replacement lens for an SLR camera which uses mirrors and (plastic) lenses to take two side by side photos in 3D. It does this by taking two portrait photos side by side on a landscape photo.

Loreo 3D Lens in a cap.  Look OK, but looks can be deceiving.

Loreo 3D Lens in a cap. Look OK, but looks can be deceiving.

It’s main problems are the quality of the lenses and the aperture.  The lenses are plastic AND the lens only has two aperture stops.

I had to use a side point in my cameras auto exposure as the very center of the frame is black.

The lens has one big bonus: Since the two lenses flip the images (as lenses do), the result you get on your camera is already in cross eyed format.

 

Exhibit A: Untouched result from Lens in a cap (Links to original full 10 Megapixel (5.9MB) photo)

Exhibit A: Untouched result from Lens in a cap (Links to full 10MP photo)

As you can see from the above photo, about 8-10% of the center is lost due to some ghosting effect. Click on the image and get the full size (6MB) and take a look at the quality of the lens. There is little sharpness in the photo. Note that this was taken in the french alps in more than adequate sunlight.

Here is a photo taken within minutes using a standard consumer grade Canon 18-55mm lens.

Exhibit B. (Links to 4.5 Megabytes of 10 Megapixel goodness)

This is one of the many reasons why I decided to build a twin camera rig… It also looks kinda cool and lets me take high resolution 3D Landscape photos.

As usual, all images are (c) John Burns

Written by John Burns in: 3D Photography,Projects |
Nov
15
2008
0

Force Quitting Applications in Mac OS X

Yes, Mac applications hang. Normally you can click on the  in the top left corner of the screen and select “Force Quit”.

But what about keyboard shortcuts?

As shown in the image above,  ⌘ + ⌥ + ESC will bring up the window.

But add in the Shift key for instant kill gratification.

Using ⇧ + ⌘ + ⌥ + ESC will close the current active application immediately without bringing up the window.  Note that you can’t force quit finder like this.  Instead, to kill the finder you will still need to go through the normal window and select it from the list.

Written by John Burns in: Mac OS X Tips |