Archive for the ‘linux’ Category

Fonts of Fantasy

Sunday, October 12th, 2008

Problem: My thesis requires fonts from Star Trek and Bladerunner, but they’re TrueType and LaTeX does not play well with them.

Briefly: LaTeX is anal about the directory tree. So learn the right directory names and save yourself a bundle of trouble.

Solution: The LaTeX fundus package has Star Trek font; but turns out it doesn’t work with my Ubuntu. So I wrote a script to install a ttf in a local texmf tree. Note that the tex tree conventions
leave you have little flexibility in naming directories. So ${TEXMF}/fonts/tfm, ${TEXMF}/tex/latex/, ${TEXMF}/fonts/truetype, etc. need to be acceptable to tex.
(more…)

BU VPN on Ubuntu 8.04 Hardy Heron

Sunday, April 27th, 2008

Problem On Hardy Heron, vpn connection keeps dropping.
Solution Check /etc/network/interfaces for misconfiguration of wireless card.

Problem On update to Hardy Heron, vpn connection on the wireless breaks down. vpnc-connect doest not set up connection, and exits giving variously as “VPNC started in background…” or “No reply from server…”.
Solution Some issue in /etc/vpnc/vpnc-script, I don’t care what, just replace it with the old vpnc-script. This problem is not specific to Boston University connection.

Thinkpad R60 Hibernate

Monday, January 7th, 2008

Problem I’m running Thinkpad R60 with Gutsy Gibbon (Ubuntu 7.10). Since everything else seems to work — internet, great fonts, disconnect on call, MATLAB, amsn, and suspend to RAM — why not hibernate? But when it hibernates… it doesn’t. The system doesn’t hibernate/hibernates but immediately comes back up/hibernates and I don’t know how to resume!

Solution (Welcome back Rip Van Winkle.)

  • What is resume?
    “Resume” from hibernate occurs when the system system boots. The system is powered on, grub shows up, the kernel that was sent into hibernation is selected, and if things go well, the kernel detects the old state information in the swap partition and gets you back where you left off.
  • How do you set it up?

    A swap partition sufficient to contain the virtual memory image currently used by the system (after syncing) is required to save system state. A swap file may be created if swap partition/file was not created during system install.
    (more…)

Thinkpad R60 Modem Disconnect on Call

Thursday, December 27th, 2007

Problem Linux box got a winmodem (Conexant HSF) and needs to

  • dialup
  • disconnect on call

Briefly Modem drivers from de11 and a bash script to disconnect
(more…)

PDF File jpeg Preview

Thursday, December 13th, 2007

Problem I have a pdf file, and I want to show it off on the interwebb. How can I get a good jpg thumbnail?
Solutionpdftoppm (from xpdf) -> pnmtojpeg (from Netpbm) -> convert (from ImageMagick) to scale

Try pdfcover.sh


#!/bin/bash

if [[ $# -lt 1 ]]; then echo usage: $0 pdffilename ; exit; fi

SCALE=40
TMPPPM=/tmp/tmp-ppm
PREFIX=`basename ${1} .pdf`
PREFIX=`basename ${PREFIX} .PDF`
pdftoppm -f 1 -l 1 -r 100 ${1} ${TMPPPM}
pnmtojpeg `ls ${TMPPPM}-*[0]1.ppm` > ${TMPPPM}.jpg
convert -scale ${SCALE}% ${TMPPPM}.jpg ${PREFIX}-thumb.jpg

wavplay on Linux

Monday, November 19th, 2007

Problem MATLAB on linux doesn’t have wavplay.

Solution Write sound signal as wav file on disk, and play it using some other program. Better still, write a script that tracks a wav file on disk and plays it whenever it changes. waverunner.sh does just that, and wavplay.m writes wav files on disk just like windows wavplay does.

(more…)

Tiled Printing

Wednesday, November 7th, 2007

Problem: Given

  • A big image of size H×W
  • Printer that prints to maximum size h×w
  • h<H and/or w<W

How do you get a tiled print? Preferably on Linux/free software.

Briefly: Script jpegtile.sh

Requires: Linux/Cygwin, bash, ImageMagick (convert, identify)
(more…)