Older blog entries for AlanHorkan (starting at number 364)

Peazip: Convert CBR to ZIP

I had a tshirt with the slogan "More people have read this shirt than have read your blog" and I am always a little surprised when someone does read my writings on the web. I was pleased to see that someone thought my batch file to repack from CBR to CBZ might be useful for people who want to read comics on mobile devices.

I was thinking about rewriting the batch file to work with programs other than 7-zip and I rediscovered Peazip a program I had not tried in years. The user interface is still a bit rough in places but it includes a very useful tool for Convert archives from different formats. It is a convenient way to convert files from CBR to ZIP which I think some users will prefer to using a DOS batch file. There does not seem any way to automatically rename the ZIP files to CBZ, so for I prefer to keep using the batch file. (The Convert tool in Peazip will unpack all the files and then repack all files, which can take up a lot of disk space with temporary files, so be careful if you try to convert many files at once.)

The biggest advantage of the batch file is that it does more than just repack from CBR to CBZ. I continue to modify it in other ways to better clean up the Comic files as I repack them, such as removing signature or banner images added by scanners. It is tricky to come up with a pattern that works all the time so I only included a simple example before, but the following patterns catch a lot of the tags and banner images:

MOVE z*.* ..\  
MOVE xx*.* ..\  
MOVE *tag*.* ..\  
MOVE *team*.* ..\  

The banner images can take up quite a bit of space, more than 1MB in rare cases, so removing them often saves more space than anything else such as special compression tricks. Instead of adding a large image file the batch file could be changed to add a small text file containing comments by adding the following command before recompressing:
echo "Repacked by 7-zip" > Comment.txt 

Tidying up file names is another thing that could be added to the batch file.

As I said earlier I am glad at someone found the batch script useful, hopefully Peazip will be useful too.

Syndicated 2011-04-06 00:52:03 from Alan Horkan

Comics: Convert CBR to CBZ

Comics are great. I'd gotten out of the habit but I still enjoy picking up a good Batman story now and again, but other than that it is hard to know what to pick. The painted comics of Alex Ross (Kingdom Come) are beautiful, the stories of Warren Ellis (Transmetropolitan) are compelling.

Can you judge a book by it's cover? If it is a graphic design book, or art book I think you can and with comics I often do choose on that basis (and all too often get caught out when the interior art is entirely different from the cover). In the long run though it is stories and the writers that keep me coming back and if I particularly like the style of the artist that is a bonus.

Chatting with the local equivalent of Comic Book Guy is one way to get ideas of what to try but picking a book off a shelf and having a look is usually the best way. The internet has provided us with an even bigger bookshelf to flick through, and there are groups who scan the latest comic books and package them up for easy sampling, usually a series of JPEG image files packaged together as a single convenient archive. Very often this archive they are packaged in use RAR compression CBR (Comic Book RAR archive), but other times the container uses Zip compression CBZ (Comic Book Zip archive). The essential difference is that Zip is free and RAR is proprietary.

I wanted to convert these CBR files to CBZ. I could do that by unpacking and repacking the files on a case by case basis but that is repetative and uninteresting. Instead I decided to make things more complicated and come up with a more general automated solution. That solution might be of use to others, especially those who do not know how to write MSDOS batch files, so I'm sharing it. On the internet someone else there is almost always someone else who has the same idea as you, and I was able to find something very close: Andrew Armstrong had already written a Mass Zip, RAR to 7Zip Recompression Batch File and all I needed to do was make some small adjustments so that it would to convert RAR files and CBR files into CBZ files. If you want details of what exactly is happening you should read his detailed description. It took me far less time to make my changes than it to write them up and explain them, the hard work was already done.

The script requires the excellent free compression program 7-zip and you must have it installed. To keep things simple we assume 7-zip is installed in the default location C:\Program Files\7-zip\7z and we do not try to check. If for example you were using a German version of Microsoft Windows 7-zip might be installed in a program called "Programme" rather than "Program Files" or if you wanted to use a portable flash drive and use Portable 7-zip you would also need to change the program before it would work. (We could try to avoid the first problem by checking to see if %ProgramFiles% is C:\Program Files as expected.

Another known issue the sometimes causes the script to fail is when file path names are too long. Microsoft Windows limits file names to 260 characters in length. The script creates a temporary folder based on the name of the CBR and if there is a subfolder inside the CBR the filename can sometimes be too long.

As this script is intended to be used to unpack not just any generic RAR file but a Comic Book Archive there are other changes we can include. Creators of Comic Book archives compress a whole folder instead of picking out just the picture files they want, and all sorts of other things get included by mistake. Microsoft Windows includes a hidden file called Thumbs.db which stores thumbnail images of your files. We can safely delete this, Windows will recreate it if the comic book archive is ever unpacked and it is needed. To do this I added the line DEL /F /S /Q Thumbs.db (which is short for DELete by Force, in all Subdirectories, and do it Quietly without reporting any errors).

The scanners who create Comic Book archives often like to include a banner image saying who they are and often with a message such as reminding readers that if they like the comic they should buy it too. These files are often given a file name starting with 'Z' so that it will appear last in the sequence so I added another line to delete any file that starts with the letter 'Z' DEL /F /S /Q z*.*. If the banner image has a different name this won't work but it is an example of what you can do to fit the generic scripts to better fit that task.

One change I have made might seem surprising. I have set the Zip compression to level zero, which is no compression at all (-mx=0). I could save a small amount of space by using the maximum amount of compression but this would take longer to pack the files, and more importantly it would make it slower each and every time you want to unpack and read the files. The Zip archive convenient container to make things easier to organize, and JPEG files are already quite heavily compressed.

If you want to try it out for your self, copy the commands below into a text file, change the name to cbr2cbz.bat or similar, put it in a folder with some CBR or RAR files and away you go.



@ECHO OFF
REM Based on 
REM Mass Zip, RAR to 7Zip Recompression Batch File by Andrew Armstrong
REM http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file
REM
REM Find all .cbr and .rar files in the current directory, recompress them into .cbz and .zip files - but do not delete the originals.

ECHO Searching for CBR and RAR files to recompress into CBZ (Comic Book Zip) archives.

for %%F in (*.cbr *.rar) do (
ECHO Found %%F to recompress...
REM Extract...
"C:\Program Files\7-zip\7z" x "%%F" -o"%%F contents"
REM Does the directory exist? has 7zip created it correctly?
IF EXIST "%%F contents" (
REM Change directory, create zip of contents of directory...
CD "%%F contents"
REM remove banners 
DEL /F /S /Q z*.*
REM Delete Thumbnail files. 
DEL /F /S /Q Thumbs.db
REM compression level is 0, store only. 
"C:\Program Files\7-zip\7z" a -tzip "../%%~nF.cbz" * -mx=0
CD ..
REM Delete the temporary extraction folder
RMDIR "%%F contents" /S /Q
ECHO Recompressed %%F to %%~nF.zip
)
)
ECHO Search ended.

PAUSE
CLS
EXIT

Syndicated 2011-02-01 01:57:35 from Alan Horkan

Trinity Climbing Wall Route Grades

September 2008 the climbing wall in Trinity was stripped bare and professionals were brought in from the UK to set all new routes.

A guide list crudely written in chunky black marker was taped to the side of a locker showing the approximate gradings for the routes. The list was later removed, possibly vandalised giving me an extra push to type up the following list.

Please note, gradings are subjective[1]. Wall A is the route nearest the entrance, and wall N is the slab routes at the far corner of the room.

Wall A
Grey 5+
Orange 6B
Green 6B+

Wall B
Blue 6B
Red 6A

Wall C[2]
White 6B
Grey 7A+
Green 6A+

Wall D
Yellow 6C
Red 6B+

Wall E
Green 6A+
Orange 7B

Wall F
Blue 6A+
Red 6C+
Grey 7A

Wall G
White 6A
Green 6C
Blue 6B

Wall H
Black 5+
Orange 6C+

Wall I
White 6A
Yellow 6B+

Wall J
Green 6C
Black 6B
Blue 7A

Wall K
White 6A
Red 6B
Orange 6B+

Wall L
Yellow 6B
Green 6A+
Grey 6B+

Wall M[3]
Red 5+
Blue 5+
White 4+

Wall N
Yellow 5
Orange 5
Grey 6B+


[1] The red route on Wall B seems unusually easy for a 6A but perhaps not easy enough to consider it as 5, hard to know.
[2] Additional black holds have been added to allow for bouldering practice on Wall C.
[3] To help build stamina climb the Red, White, and Blue consecutively. This wall has been sometimes called The French Connection Part 2. Before the routes were reset there was also another section of wall with Red, White, and Blue routes which were dubbed The French Connection, I'm not sure who came up with the name but it was Brendan Holland who first mentioned it to me.


Climb safely.

Syndicated 2008-10-06 00:51:38 from Alan Horkan

Nokia Fail.

"Out of memory please delete messages".

Have megabytes of memory on the phone card and yet I'm being asked to delete messages, WTF?
Fail.
The backup and archiving options are less than ideal either. Sigh.

Syndicated 2008-08-17 12:09:43 from Alan Horkan

Word of warning: Eee PC Linux Recovery DVD

New Toys:
A coworker bought himself an Asus Eee PC 700 for a modest €300. After the initial surprise of how small and light it is I got to play around with it for a while.

The custom version of Xandros (née Corel Linux) provided by Asus could hardly look more like Windows XP. The choice of this less popular distribution made life that little bit more awkward when I was struggling to get Citrix installed. When 3rd party software fails I'd be inclined to blame the 3rd party namely Citrix but since it works in Windows my coworker is more inclined to blame Linux and he threatened to buy the Eee PC with Windows next time since his children were already monopolising his new toy.

The very small tight keyboard layout with an undersized shift key got annoying fast, kept inadvertently hitting the up button. The smaller return key (or should I say "enter") is annoying but to be fair I'm used to it being two rows high and it isn't an unusual design choice (seen it on American keyboards layouts). I'm left wondering as to why designers do not elminate the Caps Lock key and the Function keys (F1, F2, etc.) and why it has both a Delete and Backspace key if space is at a premium.

Word of Warning:
In the limited time I had to play around with the Eee PC it was fun but I wanted to play with it more so I tried using the Linux Recovery DVD on a spare computer. I was hoping perhaps it was a Live DVD and I'd be able to setup a test Eee PC playground. I'm glad I used a spare machine since the *Recovery* disc overwrote something on the local hard drive. Don't try this at home. Having read the documentation further the smarter move would have been to get the Software Developer Kit (SDK) from the Asus website http://support.asus.com.tw/download/
and instructions are provided explaining how to setup the Eee PC inside VMWare. Although I didn't find it in my brief search I wouldn't be surprised to soon find a VMWare Player with all this already setup for you.

The Asus Eee PC has really grabbed a lot of attention (or was it the OLPC that started it all) and sparked a whole line of so-called "netbooks" but it will be interesting to see if they can capitalise on their first mover advantage, or hold on to a prestige position like Apple do. It is an impressive machine and I was almost tempted but little annoyances soon focussed my thoughts to more fun things I could do with the money.
In any case the software is what grabs me and I'm pleasantly surprised to see Linux in the mainstream.

Syndicated 2008-07-03 16:31:49 from Alan Horkan

Brevity: Mournes 2007 Climbing Trip Report in Twenty Words

Climbing trip report in twenty words*.

Trinity. Mournes. Soup. Drink.
Flooding. Fire brigade. Four dinners. Mulled wine. Drink.
Pidgeon Rock. Climbing! Hot Ribena. Orange Monster. Drink. Porterhouse. Home.

* twenty unique words is close enough.

Syndicated 2007-12-11 01:36:49 from Alan Horkan

As seen on TV!

Late on a Friday evening at the computer and with an episode of CSI Las Vegas playing on the television I unusually didn't switch channels as soon as the advertisements came and on was surprised to see Durex advertising a vibrator on television. Don't recall seeing Durex advertise on television before, so advertising a vibrator seems that bit more unusual and interesting.

Specifically:
http://www.discoverplay.co.uk/dial_up/the_range/vibrations.asp
http://www.youtube.com/watch?v=e66tPREEHXo





Curiouser and curiouser.

Insert witty comments below about not having a girlfriend...

Syndicated 2007-11-24 00:30:46 from Alan Horkan

Bad haiku

sad but true
a knocking on the window
hope it was you

Syndicated 2007-11-04 21:19:38 from Alan Horkan

Can't stop the signal

TV-links may be gone (for now) but there are alternatives such as
TV RSS, and
All U C. Efforts to close down TV Links will likely raise the profile of these and other alternatives even higher.

What you might not realise is that streaming is supposed to be a convenience, downloading but in the background and playing at the same time and then disposing of the files when finished. Which would be fine if you aren't interrupted or do not want to watch the stream again, but a horrific waste of bandwidth if you are forced to download it all again. Having said that the convenience provided by this need breed of website is very impressive and hints at how much more the World Wide Web might yet surprise us.

Syndicated 2007-10-19 22:42:08 from Alan Horkan

Cyanide and Happiness: Breakup?

Would make a sweet t-shirt:

Cyanide and Happiness, a daily webcomic
Cyanide & Happiness @ Explosm.net

Syndicated 2007-08-17 23:51:13 from Alan Horkan

355 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!