Saturday, 3 October 2009

The Home Network



This is when you know it's time to 'consolidate'.

Wednesday, 23 September 2009

Simple Volume Shadowing of the System Disk under OpenVMS

I am not an OpenVMS expert. I had to read the manual a couple of times and consult with the Hoff to get the commands sorted to do this, so hopefully it will save you some time.

Volume Shadowing on OpenVMS at it's very simplest can be used to provide RAID-1 mirroring using two or more locally attached hard drives. In my case I have a single hard drive (DKA300:) which acts as my system and data disk. I wanted a complete hot mirror of this drive in case of hardware failure. I have used two identical drives to do this.

If you are an OpenVMS hobbyist you will have the license required for volume shadowing. You can easily check:

$ SHOW LICENSE VOLSHAD
Active licenses on node ORAC:

------- Product ID -------- ---- Rating ----- -- Version --
Product Producer Units Avail Activ Version Release Termination
VOLSHAD DEC 0 0 100 0.0 (none) 16-OCT-2009

You then need to setup the system parameters so that when you reboot OpenVMS your current system disk is included in a shadow set to which another drive (or drives) can then be added. Edit the file SYS$SYSTEM:MODPARAMS.DAT and add the following lines:

ALLOCLASS=100
SHADOWING=2
SHADOW_SYS_DISK=1
SHADOW_SYS_UNIT=0

A sensible value for ALLOCLASS is 100, but it can be anything from 1 to 255. If you have previously added the box to a cluster this parameter may already be defined. SHADOWING must be 2 to enable shadowing. SHADOW_SYS_DISK must be 1 to enable shadowing for the system disk, and SHADOW_SYS_UNIT defines the virtual unit number which is appended to the virtual drive name DUAx:

You then need to run AUTOGEN to save these parameters. I used the following two commands:

$ @SYS$UPDATE:AUTOGEN SAVPARAMS GENPARAMS
$ @SYS$UPDATE:AUTOGEN GENPARAMS REBOOT

The second command may fail on errors, if this is the case and you are happy to proceed add the keyword FEEDBACK to the end.

This will reboot the system and (hopefully) when it's started up you should see the virtual unit when you run the SHOW DEVICE command:

$ show dev d

Device Device Error Volume Free Trans Mnt
Name Status Count Label Blocks Count Cnt
DSA0: Mounted 0 OVMSVAXSYS 16637880 337 1
$100$DKA200: (ORAC) Online wrtlck 0
$100$DKA300: (ORAC) ShadowSetMember 0 (member of DSA0:)

To add a new member to the volume set use the MOUNT command, like this:

MOUNT/CONFIRM/SYSTEM DSA0: /SHADOW=($100$DKA300,$100$DKA400) OVMSVAXSYS

This command specifies the existing system disk $100$DKA300 and the new disk $100$DKA400. You will need to confirm that you want to overwrite the contents of the new drive. The command initiates a copy of the data on the system disk to the new drive. SHOW DEVICE will indicate the copy progress:

$ show dev d

Device Device Error Volume Free Trans Mnt
Name Status Count Label Blocks Count Cnt
DSA0: Mounted 0 OVMSVAXSYS 16637880 337 1
$100$DKA200: (ORAC) Online wrtlck 0
$100$DKA300: (ORAC) ShadowSetMember 0 (member of DSA0:)
$100$DKA400: (ORAC) ShadowCopying 0 (copy trgt DSA0: 43% copied)

After the copy is complete the two shadow set members will contain identical data, so that if one of the drives should fail it can be replaced without losing any data.

I encourage you to consult the Volume Shadowing for OpenVMS manual for more information.

Sunday, 6 September 2009

VAX APL LK201 Keyboard

From the VAX APL Users Guide page 1-3 comes an image of the LK201-EC variant with APL keycaps:



With this image as a reference I designed a set of replacement keycaps for an existing LK201 using the Open Office Drawing tool (source file) and the excellent Simpl APL Unicode Font:


These were printed out using a laser printer on the self-adhesive transparency paper provided as part of the Hooleon Keyboard Sticker Label Making Kit. These were then cut out using a scalpel and mounted on backing stickers which are opaque. A final top sticker adds a textured finish and protects the printed label.This is the resulting keyboard:

Left Hand Side:


Right Hand Side:


I've also uploaded a short video to YouTube demonstrating how you interact with VAX APL V4.0 using this keyboard together with a VT320 terminal.

Wednesday, 12 August 2009

Embedding the SimPL APL font on a web page using Cufón

I came across Cufón a while ago whilst browsing the excellent nettuts+ website.

Having started coding in APL I was wondering about the best way to present developed code on my blog. One option is to use my java transcoding technique to load my Soliton Sharp APL code into jEdit (my favourite editor) using my custom character set transcoder to convert the custom eight-bit ASCII encoding used by Soliton into standard Unicode APL characters.

Cufón allows you to embed any arbitrary truetype font or fonts into a webpage via javascript and then use the font directly within the html by replacing a standard html tag. You can either download the utility or use their website to process a truetype font located on your hard disk to generate a javascript file containing your selected truetype glyphs. The generated file in this example is simpl_400.font.js (see code below).

I chose the excellent free font created by Phil Chasney called SImPL to embed within this blog.

The code required within the head tag of this page to embed the font is very simple:

<script src="http://www.wickensonline.co.uk/styles/cufon-yui.js" type="text/javascript"></script>
<script src="http://www.wickensonline.co.uk/styles/simpl_400.font.js" type="text/javascript"></script>
<script type="text/javascript">
Cufon.replace('h1');
</script>


The results can be seen with the following APL characters above ASCII location 127 in the SOLITON-APL encoding:


¨¯≤≥≠∨×⍪⌹∵⌿
⍲¡€£¥¬⍱⌻⍂≡⌷¿
⍺⊥∩⌊∊∇∆⍳∘⎕∣⊤○
⍴⌈↓∪⍵⊃↑⊂⊢⍀⊣÷
⌶⊖⍎⍝⍷⍫⍒⍋⍸⍤⍞⍕⍥
⍟⍉⌽⍧←⍙→⋄



and an example of some APL code:


∇mbrt1[⎕]∇
[0] z←mbrt1
[1] rrz←(0.1×⍳21)−1 ⍝ array from ¯1 to +1 stepsize 0.1
[2] iiz←(0.1×⍳21)−1 ⍝ array from ¯1 to +1 stepsize 0.1


∇cmplsq[⎕]∇
[0] z← cmplsq ⍵
[1]
[2] ⍝ Function: Complex Square
[3] ⍝ Perform a complex square of the argument ⍵, returning array r,i in z
[4]
[5] r←⍵[0] ⍝ extract real part into r
[6] i←⍵[1] ⍝ extract imaginary part into i
[7] rn←(r⋆2)−(i⋆2) ⍝ real result
[8] in←r×i×2 ⍝ imaginary result
[9] z←rn,in ⍝ z is array of real and imaginary results

Saturday, 8 August 2009

DIGITAL and Alpha Powered Logos

I created a couple of high-resolution logos for DIGITAL and Alpha Powered from existing sources with transparent backgrounds as PNG files that someone might find useful! Below are two scaled images - be sure to use the links above to get the full resolution version.



Retrochallenge 2009 Summer Challenge Entry

I participate in retrochallenge - a convenient excuse to utilise retro technology for a month. For the summer 2009 challenge I coded up a fractal generator in VAX Macro-32. You can check out the challenge blog at http://www.wickensonline.co.uk/rc2009sc. I produce this blog on my main website because it is created using ALLIN1 on the VAX by a set of scripts I created for my winter warmup 2009 entry.

One of the images I produced has been used by the competition organiser for the winners mousemat. It can also be ordered in t-shirt format from cafepress.

The above image is also available at 4800x4800 resolution, which shows the recursive nature of the image much more clearly.

Friday, 7 August 2009

Transcoding AVCHD into DVD and Web Formats using the Command Line under Linux

I needed a way of transcoding output from my Panasonic HDC-HS300 into a DVD and web viewable format under linux. There are webpages out there that tell you how to do it, but I had to edit some of the scripts to perform this task automatically from the command line.

I've created two scripts, convert-mts-dvd.sh and convert-mts-web.sh which can be downloaded in the archive convert-mts.tgz. The scripts unpack into a bin directory.

In order to use the scripts you need to ensure you have the latest version of mplayer installed. My version reports:

MPlayer SVN-r29328-4.3 (C) 2000-2009 MPlayer Team

so I would suggest this version or later. The packaged version in the OpenSUSE 11.0 repository is not recent enough - I downloaded the latest source code using subversion and built it locally. The following commands download the latest version, configure and build it to /usr/local. The mplayer binary can then be found under /usr/local/bin so the last command ensures that you pick that version up in preference to a pre-packaged version that might be installed under /usr/bin for example.

svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd mplayer
svn update
./configure --prefix=/usr/local/
make install
export PATH=/usr/local/bin:$PATH
The convert-mts-dvd.sh script is used to convert your HD video into DVD quality, suitable for directly burning to a DVD (for example using my command line tools described in a previous blog post). It contains the following commands:
rm -rf dvd/*
mkdir dvd
for f in *.mts
do
echo $f
mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,hh
arddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=55
000:keyint=15:aspect=16/9:threads=4 $f -ofps 25 -fps 50 -o dvd/`basename $f .mts
`.mpg -demuxer lavf >>`basename $f .mts`.log 2>&1 &
done
wait
Once you have this command on your path, cd to a directory containing the files you wish to convert (which have the extension .mts) and run the command. Note that with the Panasonic Camcorder you can copy the files directly off the camera - you don't need to use the Windows utility provided. It will create a sub-directory called dvd and proceed to convert all the .mts files into DVD format. It creates a log file for each of the converted files giving any output or error messages.

Note the ampersand on the end and the wait command - this script is multi-threaded and will utilise all cores on a mult-core processor. I did some experimentation with versions of this script and found that on a machine with a decent amount of memory the most efficient way of transcoding the videos was to spawn off all the transcode commands at the same time, even when transcoding several tens of mpeg. On my quad-core machine this command completes the process almost exactly four times quicker than processing the command sequentially.

The only disadvantage of spawning all the transcodes at once is that you might impact other processes on the box (I noticed that video streaming would be interrupted for example). You could always use the nice command infront of the call to mencoder to run it at a lower priority, giving preference to existing tasks.

The convert-mts-web.sh provides the appropriate command line arguments for generating a video size 360x288 - it creates a directory called web and places the transcoded video files there.

rm -rf web/*
mkdir web
for f in *.mts
do
echo $f
mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=360:288,harddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=1250:vbitrate=625:keyint=15:aspect=16/9:threads=4 $f -ofps 25 -fps 50 -o web/`basename $f .mts`.mpg -demuxer lavf >>`basename $f .mts`.log 2>&1 &
done
wait