Excellent movie about time travel – "Primer"

I watched ‘Primer’ the other day. Wow! Awesome flick – quite a brain-bender. I am going to have to watch it another time (or ten) just to figure out what really happened.

primer movie

The whole time travel thing makes my head hurt – especially since a lot of the time travelling bits are inferred – some of the time travel sequences are not shown in the movie, you have to figure out what things have changed by the way the characters respond. There are some flashbacks that help, but you have to stay on your toes to keep on top of this movie.

Here is a local version of the timeline in case the original link disappears one day.

Extracting fonts from PDF files

I stumbled across a font I wanted to use in a personal project. But it was in a PDF file. I found that this guy knew the steps to extract them and install the font on your windows box.

To summarize:

  1. Use linux (at the moment Ubuntu 7.10)
  2. Install fontforge (~$ sudo apt-get install fontforge)
  3. Convert your PDF to PostScript via ~$ pdftops pdffilename.pdf
    • this step creates files named pdffilename.ps
  4. Open the PostScript file in your favourite editor – ~$ gedit pdffilename.ps
  5. Find the following and extract everything between the lines with BeginResource and EndResource (excluding the Being/EndResource lines):
    %%BeginResource: font CIKHFG+Schoensperger-Modified
    %!FontType1-1.0: CIKHFG+Schoensperger-Modified
    ...
    %%EndResource
    Save the extracted portions as with a pfa extension (there may be more than one section, so 1.pfa, 2.pfa … n.pfa)

    • Open the pfa files in fontforge until you find the desired font ~$ fontforge 1.pfa
    • Reencode the font as Latin1 (Encoding – Reencode – Latin1)
    • Compact the font (Encoding – Compact).
    • Adjust the garbled font name (Element – Font Info – Names).
    • Generate a TrueType or PostScript Type1 font to your liking (File – Generate Fonts).

    What to install on XP to make it fully functional?

    1. MS Office 2003 (or Open Office.org) as office suite
    2. NotePad++ (with the Vibrant Ink style) for text file editing
    3. Thunderbird for my email
      1. English Australian spell check anddictionary
    4. FireFox for my web browsing, and some extensions:
      1. Adblock Plus blocks web adverts
      2. English Australian spell check and dictionary
      3. Bug Me Not bypasses compulsory web registration
      4. IE Tab renders web pages with IE in Firefox tabs. You’ll have to use an older version if you aren’t using Firefox 3 – beta versions available here
      5. Adobe Flash Player
      6. Java Runtime Environment
      7. Add to Search Bar to allow any pages’ search functionality from the Search Bar
    5. DVD Shrink for backing up DVD’s
    6. Royale Noir XP Theme
    7. XP Service Pack 3
    8. Set up auto logon via Start -> Run -> control userpasswords2
    9. Nvidia Forceware v93.71 video card driver
    10. WinRAR compress and decompress files
    11. Adobe Acrobat 7
    12. ScanGear driver for my Canon scanner
    13. Hamrick VueScan a great scanner tool
    14. Canon S800 printer drivers
    15. MySQL on my Ubuntu server to host my wiki
    16. Mediwiki on my Ubuntu server
    17. Slysoft’s Virtual Clone Drive for mounting disc images
    18. UIF to ISO converter
    19. FileZilla FTP client
    20. MS IIS 5.1 web server
    21. Change background colour from blue to dark dark grey (16 26 38)
    22. PokerStars client. I am “jasomenaso”
    23. Tortoise SVN (Subversion) version control client
    24. Nero 7 Essentials
      • Disable ‘Nero Scout’ to avoid “WMS Idle” errors on shut down
      • Disable ‘InCD’ crapware
    25. AVG Anti-virus tool
    26. Picassa for basic image management
    27. Fireworks, Illustrator or Inkscape for vector image creation/editing
    28. MusicBrainz Picard for tagging music files
    29. Skype for VOIP
    30. MediaCoder for easy transcoding of media file formats. (ie wma to mp3)

    How to fix "Error reading linearized hint data" in PDF files

    I maintain a few community websites for free. They are not fancy but I try to make them as accessible and cross-broswer friendly as I can. I provide any documents in PDF format as I consider it a fairly open standard, and works well across all platforms (Windows, Linux, Mac, etc…)

    The other day I got a bug report from a user stating that they couldn’t open a particular file, with the PDF reader throwing up an error message “Error reading linearized hint data“.

    Good old google to the rescue. Two websites later I’ve found that Adobe PDF reader version 5 and 6 can have issues when reading PDF files that have been ‘optimised for the web’. The solution for the user is uncheck “Allow Fast Web View” in their PDF reading software.

    The better solution was for the user to not have to do anything. I could change the way the PDF files were created by disabling the “optimize for the web” when generating the PDF file.

    I’ve uploaded the new versions of the files. Hopefully it should all work OK…

    How to back up a windows installation

    Now that I have installed winXP I think it’s time to back it up.

    Summary

    [Backup]
    ~$ sudo time dd if=/dev/hda1 ibs=4096 | bzip2 -v --fast | split -a 2 -b 1024m - winxpsp2.img-part-

    [Verify backup files]
    ~$ md5sum /dev/hda1

    ~$ cat winxpsp2.img-part-* | bunzip2 | md5sum

    [Restore]
    ~$ sudo time cat winxpsp2.img-part-* | bunzip2 | dd of=/dev/hda1

    Detail

    The dd command seems to be the way to go, but it backs up empty space as well, so I am using the compression tool bzip2 to ensure I don’t waste too much space. I’ll be storing the backup files on my network file server share.

    First I’ll have to mount my file server shared directory:
    ~$ sudo mkdir /media/fileserver
    ~$ sudo mount -t smbfs //server01/shared /media/fileserver -o username=WindowsUserName,password=WindowsPassword

    This command failed with the following error (grrr):
    smbfs: mount_data version 1919251317 is not supported

    After a quick google session I found that it means the smbfs package is not installed. I installed smbfs via: sudo apt-get install smbfs then executed this again:
    ~$ sudo mount -t smbfs //server01/shared /media/fileserver -o username=WindowsUserName,password=WindowsPassword

    Now we are ready to backup not just the windows installation, but the entire partition that it is installed on.

    The command to back up the partition is:
    ~$ sudo time dd if=/dev/hda1 ibs=4096 | bzip2 -v --fast | split -a 2 -b 1024m - winxpsp2.img-part-

    Where sudo time dd if=/dev/hda1 ibs=4096 means:

    sudo Super user do. That is, do the following command as the root user.
    time Report how long the commands took
    dd Disk Dump (as far as I know)
    if In file
    /dev/hda1 A reference to the partition that has windows on it
    ibs Input byte size. That is, read 4096 bytes at a time
       

    The results of the above commands are then piped into the bzip2 compression tool where bzip2 -v --fast means:

    bzip2 Name of compression program
    -v Do verbose logging (a bit pointless when piping – it really shouldn’t be there)
    –fast Do fast compression. basically means it’s compressing smaller block sizes, which leads to sub-optimal compression. 7.5GB is still going to take about 2 hours on my AMD 2500+ CPU

    The output of the compression tool is then piped (yet again) to a tool called split that splits large files into smaller ones. It uses the following syntax split -a 2 -b 1024m - winxpsp2.img-part- where:

    split Name of splitting program
    -a 2 The number indicates how many suffixes to use in the output file name. Say I split a large file into 3 pieces. I can use -a 1 to give me three files called filea, fileb and fileb. Using -a 2 would result in three files called fileaa, fileab and fileac.
    -b 1024m Indicates the maximum size of each split output file – in this case 1024MB (1 gigabyte)
    – winxpsp2.img-part-: The first dash means read from standard input (or piped input – same thing really). Usually you could put the name of a file to split. The ‘winxpsp2.img-part-‘ bit means to name each file winxpsp2.img-part- followed by the specified amount of suffices. In this case winxpsp2.img-part-aa, winxpsp2.img-part-ab, … winxpsp2.img-part-ah.

    Eventually I guess I’ll do something silly and trash Windows XP. If that is the case I should be able to restore it by:
    ~$ sudo time cat winxpsp2.img-part-* | bunzip2 | dd of=/dev/hda1

    Tada! A brand new windows installation in mint condition.

    Installing Windows XP SP2

    A lot of steps:

    1. Install WinXP SP2 from CD
    2. Adjust folder settings. I like to see the folders NOT in simple view. I also like to see extensions.
    3. Move ‘My Documents’ to be on another partition
    4. Install motherboard drivers
    5. Turn off firewall, autoupdate and virus protection, then disable security center alerts.
    6. Join my local PC workgroup.
    7. Set up network 10.10.0.x/255.255.255.0
    8. Configure the cmd shell. I like 100 chars wide, 55 deep, black background, light green text.
    9. Install a firewall. Currently using an old version of Tiny Personal Firewall (version 2). Might be time to try something else…
    10. Do lots of Windows Updates and enjoy your Windows Genuine Advantage check.
    11. Set https://google.com/ig as homepage in IE7
    12. Disable autoruns on all devices. (ie usb, CD’s, DVD’s etc)
    13. Install eraser to zero out all the unused HDD space.

    It’s at this point that I figured the installation is worth backing up. (See next post…)