Archive for the ‘cod’ Category

toys toys toys

Thursday, February 6th, 2014


easily retrieving old things

Wednesday, July 27th, 2011

so, some fun and kerfuffle with firefox shortcuts and svn today! blodgett have made two happy discoveries which it record here for the future oh-so-interested parties.

1) since version 1.6 (now celebrated its 2nd birthtag, much like blodgett), subversion’s web interface properly support viewing old repository versions by appending “?r=[old-revision]” to URL, where [old-revision] are the version you want to see.

(supports also the peg argument for convoluted file histories, see here and here for detail)

2) blodgett, being ever lazy, wished to use nifty firefox keyword bookmark/shortcut to access this. unfortunately svn web client not handle neatly the url “[repo]/?r=”, but “[repo]/?” work fine. so blodgett’s shortcut need to pass whole revision string “r=[n]”. blodgett’s accustomed method for this is to put “%s” into bookmarked url where shortcut text goes, but this makes firefox url-encode shortcut string, so equals sign “=” get converted to “%3D”. this definitely not desired outcome, as svn want “r=34”, not “r%3D34”. understandable.

happily this eventuality are accounted for here: simply use “%S” in bookmark url for unescaped/unencoded shortcut text.

blodgett’s bookmarked svn url are now “[repo address]/?%S”, with shortcut keyword “svn”. if blodgett type “svn”, it gets latest repository revision for browsing. if blodgett type “svn r=34” it get repository as at revision 34 for browsing. neat and tidy!

nugget of wisdom

Thursday, June 30th, 2011

embed the fonts in pdfs from disobedient matlab outputs!

ps2pdf -dPDFSETTINGS=/prepress old.pdf embedded.pdf


the dvd, it plays!

Friday, June 24th, 2011

blodgett was having an irritating problem, could not watch dvds: preamble-y things would play, but xine etc. couldn’t access anything from title menu onwards. it would say

the source can’t be read. maybe you don’t have enough rights for this, or source doesn’t contain data

all libdvd* stuff up to date, but it would say

libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x00004436
libdvdread: Error cracking CSS key for /VIDEO_TS/VTS_01_1.VOB (0x00004436)!!

after some searching, blodgett discovered this sometimes happens with region problem. setting regions in xine settings not help at all, so blodgett install package regionset. it said

regionset version 0.1 — reads/sets region code on DVD drives
Current Region Code settings:
RPC Phase: II
type: NONE
vendor resets available: 4
user controlled changes resets available: 5
drive plays discs from region(s):, mask=0xFF

after changing region to ‘2’, it says:

regionset version 0.1 — reads/sets region code on DVD drives
Current Region Code settings:
RPC Phase: II
type: SET
vendor resets available: 4
user controlled changes resets available: 4
drive plays discs from region(s): 2, mask=0xFD

important parts: ‘type’ line now say “SET”, and last line now list region 2 instead of empty list of no regions! also number of available resets gone down, but this ok.

blodgett had to delete /home/blodgett/.dvdcss directory to remove old broken dvd informations.
and then plays! all mended.

python grmph

Friday, May 27th, 2011

apparently small ints are Special

>>> a = 256
>>> b = 256
>>> a == b
>>> a is b
>>> a = 257
>>> b = 257
>>> a == b
>>> a is b

track the desktop tasks

Monday, May 9th, 2011

blodgett likes to expand its activities over multiple desktops, frequently eight at once for maximal efficiency and parallelism. problem occurs that mental effort must be expended then to track these, which is agitating. blodgett prefers minimal thinking and would like to label or otherwise notate desktops. gnome workspace labels in task switcher too small, too awkward to adjust, and too gnome-specific. zenity to the rescue!

blodgett has made script task-label which opens small dialogue for task annotation, can leave on desktop for reminder of current task and progress. closing dialogue on completion of task logs description to file with timestamp. success! :D

zenity --text-info --title="current task" --editable --width=280 --height=180 >> $taskFile
echo >> $taskFile
echo -n "quit on " >> $taskFile
date >> $taskFile
echo >> $taskFile

works from custom launcher on gnome taskbar (with icon /usr/share/icons/Tango/scalable/apps/gnome-session.svg), and from metacity keybinding. ok back to work

home card

Tuesday, March 29th, 2011

blodgett enters snail mode! it transports its home for convenience, via potentially crackpot method detailed below.

step 1: formats the sd card to ext4 avec gparted

step 2: mount cart where wanted e.g.
sudo mount -t ext4 /dev/sdb1 /media/home

step 3: set owner of cart to blodgett:
sudo chown blodgett: /media/home

[note: colon after blodgett signifies that group is changed to blodgett’s group as well as changing owner to blodgett]

step 4: copy home dir into new/currently non-existent directory on cart:
cp -r –preserve=all /home/blodgett/ /media/home/blodgett

[preserve arg is for keeping of all attributes. notenote that cp /home/blodgett/* not copy hidden directories so must cp to new directory entire]

step 5: find uuid of cart typing
sudo blkid /dev/sdb1

step 6: add cart to list of things that get mounted automatically. this requires to edit the file /etc/fstab. if not done then lxdm at least don’t want to log you in. (terminal login work fine, then have to run step 2.)
added following line:
UUID=(uuid from step 5) /media/home ext4 errors=remount-ro,noatime 0 2

noatime is to turn off records of last file access time. this stops it writing stuff that blodgett not really interested in.
first zero indicates to dump program that no backups are to be made of this; blodgett not using dump. two at end is order that filesystem checker (fsck) will check this one. zero for off, but blodgett want checks and had only 1 other checked volume (root).

step 7: check that everything datas ok on cart and delete home directory. (blodgett has backups elsewhere so not too paranoid about doing this.) then make symlink from old home to cart directory:
sudo rm -r /home/blodgett
sudo ln -s /media/home/blodgett /home/blodgett

step 8: reboot! blodgett not noticed any difficulties yet…

in case of interest, blodgett’s cart is a PNY 16GB Class 10 (zoomfastfast) from here, 16 cashmonies:

it seem to work well in tinyshiny (eee 901) and camera (ricoh r7)

further tweakings have occurred, as eee gets slightly miffed when cart not present.
tweak 1: make a permanent mount directory:
sudo mkdir /media/home

tweak 2: stop boot process (which runs mount -a) from trying to load sd automatically by adding noauto to options field of volume in step 6:

tweak 3: add following to /etc/rc.local before “exit 0” line, to check whether sd present (-b checks for block device), and only mount if so:

# try to mount sd card if present, otherwise do nothing
if [ -b /dev/sdb ]; then
mount /dev/sdb1

if necessary, can now also mount manually with just “sudo mount /dev/sdb1”

blodgett owes thanks ici for instructions:

blodgett’s first latex command

Tuesday, March 22nd, 2011

want to write notes in light grey. also lazy. made shortcut (requires color package):



voila! grey text with \grey{texttexttext}

squidgy alarums

Wednesday, February 16th, 2011

update! now with added zenity, requires not the argument.
blodgett have placed it here separate.

also have attached it to keyboard extra button for instant-alarm-transform :D

divers alarums

Tuesday, February 15th, 2011

blodgett needs to wake up! so it wrote a scriptee to ensure its occurrence.

once started it naps the computorg until the time given, then uses rtcwake to wake up, and xine to play an audio.

rtcwake needs to be run as root, so blodgett also made sure it could do this without password by adding to sudoers file using visudo the line:
blodgett ALL=(root) NOPASSWD: /usr/sbin/rtcwake

which is to say the user blodgett, on ALL hosts, may do as root, without entering a password, the command rtcwake.

so! now can do e.g.
alarum 0800
alarum 10:00 music/monkey.mp3

one other note, blodgett’s computorg is set to screenblank on lid close, not go to sleep! otherwise if set alarm and close lid, computorg will briefly wake up then return to nap before playing song. not good.

edit: alsoalso, it uses suspend-to-memory (sleeping) rather than suspend-to-disk (hibernate), or off, as blodgett’s computorg cannot wake up automatically from these ones. a few computorgs can’t do wake from memory either, so should probably test this before using!