howto make a quarter sheet daily planner from an ical file in linux

My Planner

Update: Photos of my planner! Mine is on the left, next to a moleskin to give you an idea of the relative size.  Below is what each day looks like.

Inside of my planner

I use Sandy for most of my calendaring, but don’t have a PDA or mobile phone with a convenient calendar app (and can’t afford one).  So, I needed a paper daily planner that could be generated on a weekly basis from the events that I shoot into Sandy.  I find that it’s no too hard to do a daily paper->electronic sync to update my calendar in Sandy.  Sandy has an ics export which is really nice if I want to view my appointments along with appointments from my other calendars (like my work one, managed by Webcalendar).

What you need:

  • Calendar software that supports printing a daily view (I used KOrganizer)
  • psutils package

Import your remote calendar(s)

I first imported my calendar into KOrganizer (File->Import->Import Calendar and then entered the URL of my iCal feed in the Location field) .

Print the calendar to a postscript file

I printed a page for each day of my calendar with  File->Print and then chose Print Day for the Print Style.  I selected a month worth of dates for the Date & Time Range.  I clicked Print and chose the Print to File (Postscript) option for the printer Name.  The ability to print to a file came with my default KDE setup, but it shouldn’t be too hard to get this ability from whatever printing management system you’re using.

Make the postscript file 4up

I used the psnup program to put four days on one letter sized page.

 ghing@silvertongue:~/tmp$ psnup -pletter -b0.25in -4 planner.ps planner-up.ps

The above options say that the output paper size is letter, that there should be a .25 inch margin around each page (I did this to allow for a binding on the left hand side of the sheets), that there should be 4 pages from the file planner.ps combined into every one page in the output file planner-up.ps.

Open the postscript file and print it

I used evince to open and print my planner.

Cut the pages into quarters

I used a paper cutter to cut the printed pages into quarters.  Take care to keep track of the order of pages so it’s easier to assemble your calendar.

Find a cover and a binding

For mine, I used part of the cover of a notebook that I dumpstered in Bologna and held everything together with a butterfly clip that I got from the supply closet at work.  Be resourceful!

fixing sound in debian

I’m running debian lenny/sid with  kernel 2.6.26-1 on my workstation and for a while, my audio hasn’t been working in most applications (I was most annoyed by the lack of sound in flash), though it has been working in amarok.  I was getting error messages like this when trying to do audio playback.  These particular messages are from Ekiga:

ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.namehint.extended'
ALSA lib conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM plughw:0
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.namehint.extended'
ALSA lib conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM plughw:0
ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'defaults.namehint.extended'
ALSA lib conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM plughw:0

I finally looked into this and was able to fix it with the simple command

 $ sudo asoundconf reset-default-card

vim cheatsheet

Extracting from a vimball

From http://vim.sourceforge.net/scripts/script.php?script_id=1502

Users of a vimball archive simply need to

:vim something.vba
:so %

and the contents of the vimball will be extracted and placed into the proper directories, no matter where the user opened up the vimball. Furthermore, the helptags command will be automatically and transparently used to make any doc/*.txt files’ contents available by the Vim help system.

Getting the filename of the currently edited file

From http://rayninfo.co.uk/vimtips.html:

:!echo %:p                        : full path & file name
:!echo %:p:h                      : full path only
:!echo %:t                        : filename only

Removing empty lines

From Vim Tip 72:

 :g/^$/d

Converting select text to lowercase

In visual mode, select text.  Then type the u key.


Fixing annoying behavior in various Linux desktop appss

I finally got off my butt and fixed a few things that had been driving me nuts with the settings on my workstation.

Weird KDE copy/select behavior

First, I use KDE, and the copy and paste behavior was driving me nuts.  If I copied text in an application with ctrl-c and then selected text with the mouse, my copied text would get clobbered by the selected text.  It turns out that the culprit was Klipper.   I made the functionality the way I wanted it by checking the ignore selection option in the Klipper configuration window (right click on Klipper icon in tray -> Conrigure Klipper).

Klipper Configuration

Default Browser for Tomboy

I like the Tomboy note taking program.  However, it was opening URLs in notes in Epiphany instead of Firefox.  Even though I run KDE for my desktop environment, since Tomboy is a Gnome app, I have to set the default browser for Gnome apps.  You can do this with the  gnome-default-applications-properties command.

Dual Headed X11 setup with GeForece 8400 GS on Debian lenny/sid

Having a job at the university means that I have access to hardware that I can’t afford to buy for myself.  My coworker was getting a new video card for his workstation and they just ordered me one too.  The card is an Nvidia GeForce 8400 GS PCI Express card manufactured by Chaintech.

Downloading the Driver

I have zero experience with post AGP video cards or dual head setups, so I just went off of my corworkers recommendation that I use the non-free Nvidia driver.  I downloaded it from this page:

http://www.nvidia.com/object/linux_display_ia32_169.12.html

Installing the Driver

I ran the driver installer with the command:

sh NVIDIA-Linux-x86-169.12-pkg1.run

and it told me that it needed to be run as root and after X was shut down, so I had to switch to a console, kill X and su to root.

The installer told me that it couldn’t find any precompiled drivers for my kernel, so I would have to build them.

The installer also told me that the compiler that it found (gcc-4.2) was different than the one used to build my running kernel (gcc-4.1), so I had to set my CC environment variable to /usr/bin/gcc-4.1:

export CC=/usr/bin/gcc-4.1

It then told me that it couldn’t find the kernel source or kernel headers for my kernel (at the time 2.6.24-1).  To get the headers, I followed some of the directions for building out-of-tree kernel modules:

apt-get install linux-headers-2.6.24-2-686

Finally, I reran the driver installer, specifying the location of my kernel headers:

sh NVIDIA-Linux-x86-169.12-pkg1.run –kernel-source-path=/usr/src/linux-headers-2.6.24-1-686/

and the installation completed without a hitch.

Configuring X (for this card with dual heads)

This was the easy part because my coworker kicked me this config file:

# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by failsafeDexconf, using
# values from the debconf database and some overrides to use vesa mode.
#
# You should use dexconf or another such tool for creating a "real" xorg.conf
# For example:
#   sudo dpkg-reconfigure -phigh xserver-xorg

Section "ServerFlags"
    Option "DefaultServerLayout" "layout0"
#    Option "Xinerama" "True"
EndSection

Section "InputDevice"
	Identifier	"keyboard0"
	Driver		"kbd"
	Option		"XkbRules"	"xorg"
	Option		"XkbModel"	"pc105"
	Option		"XkbLayout"	"us"
EndSection

Section "InputDevice"
	Identifier	"mouse0"
	Driver		"mouse"
EndSection

Section "Device"
	Identifier	"nvidia0"
	Boardname	"GeForce 8400 GS"
	Busid		"PCI:1:0:0"
	Driver		"nvidia"
	Screen	0
#    Option "Monitor-" "monitor0"
#    Option		"NoLogo"	"True"
EndSection

Section "Monitor"
	Identifier	"monitor0"
	Vendorname	"Plug 'n' Play"
	Modelname	"Plug 'n' Play"
EndSection

Section "Screen"
	Identifier	"screen0"
	Device		"nvidia0"
	Monitor		"monitor0"
	Defaultdepth	24
	SubSection "Display"
		Depth	24
	EndSubSection
EndSection

Section "Device"
	Identifier	"nvidia1"
	Boardname	"GeForce 8400 GS"
	Busid		"PCI:1:0:0"
	Driver		"nvidia"
	Screen	1
#    Option "Monitor-" "monitor0"
EndSection

Section "Monitor"
	Identifier	"monitor1"
	Vendorname	"Plug 'n' Play"
	Modelname	"Plug 'n' Play"
EndSection

Section "Screen"
	Identifier	"screen1"
	Device		"nvidia1"
	Monitor		"monitor1"
	Defaultdepth	24
	SubSection "Display"
		Depth	24
	EndSubSection
EndSection

Section "ServerLayout"
	Identifier	"layout0"
    Screen 0 "screen0" 0 0
    Screen 1 "screen1" RightOf "screen0"
    Option "CoreKeyboard" "keyboard0"
    Option "CorePointer" "mouse0"
EndSection

Section "Module"
	Load		"glx"
	Load		"v4l"
EndSection

Section "DRI"
    Mode 0667
EndSection

sewing machine timing

Chiara’s sewing machine is broken.  The needle seems to collide with the hook.  It looks like the timing and hopefully the internet can save the day on this one.  It costs $60 to repair a sewing machine and I’m sure not much more to buy a new one.

Link to sewusa.com page on adjusting timing.

ssh cheatsheat

Port forwarding

from http://www.openssh.com/faq.html#2.11

$ ssh -f -L 1234:server.example.com:6667 server.example.com sleep 10

Backing up files over SSH

$ ssh remote_host "tar -zc -C /path/to/parent/directory -f - some_directory" | cat > some_directory-`datestr`.tar.gz

Backing up a postgres database over SSH

$ ssh remote_host "pg_dump --username=db_user db_name" | gzip  > db_name-`datestr`.sql.gz

screen cheatsheet

I’ve been using the unix screen command a lot lately, and enough to want to learn more.

I used to just scroll through windows with CTRL-a n and CTRL-a p, but now I have a ton of windows in my screen session, so I want to be able to navigate easier.

According to the manpage, you can automatically set the title of a window, but I think it’s nice to do it interactively because the general task that will identify the window’s functionality might not easily be reflected in a path or command.

You can also use screen to copy/paste text between windows:

  • Enter copy mode: CTRL-a [
  • Start/End selecting text to copy: SPACE
  • Paste text CTRL-a ]

making a 4up PDF

This is the command that I used to make a 4up (that would be four equally sized images on one page) layout on letter sized paper of a tabloid sized poster. I used the excellent Multivalent tool’s Impose feature.

C:\Documents and Settings\surplus\Desktop>java -Xms32m -Xmx256m -classpath “C:\Documents and Settings\surplus\Desktop\Multivalent20060102.jar” tool.pdf.Impose -nup 4 -dim 2×2 -paper letter -page 1,1,1,1 promposter.pdf

Update:

This is the command that I use on my notebook running Ubuntu Gutsy Gibbon:

/usr/lib/jvm/java-6-sun/bin/java -classpath /home/ghing/java/Multivalent.jar tool.pdf.Impose -nup 4 -dim 2x2 -paper letter -page 1,1,1,1 describe_yourself.pdf