Mini-HOWTOs
Some bits of information I wish I had found.
How to prevent SuperCollider from cluttering up your HOME directory
Tipping my toes into SuperCollider, I found it rather annoying that it insisted on creating a SuperCollider directory in ~/share. The reason can, for example, be found in SCClassLibrary/Common/Audio/SyntDef.sc +31:
*initClass {
synthDefDir = Platform.userAppSupportDir ++ "/synthdefs/";
// Ensure exists:
("mkdir"
+ Platform.case(\windows, {""}, {"-p"})
+ synthDefDir.quote
).systemCmd;
}
userAppSupportDir can be found all over the place and it is hardcoded to $HOME under Linux. To fix this I changed the following SCClassLibrary/Platform/Platform.sc:
+++ Platform.sc 2009-04-06 19:21:21.000000000 +0200
@@ -23,7 +23,8 @@
systemAppSupportDir { _Platform_systemAppSupportDir }
*systemAppSupportDir { ^thisProcess.platform.systemAppSupportDir }
- userAppSupportDir { _Platform_userAppSupportDir }
+ // userAppSupportDir { _Platform_userAppSupportDir }
+ userAppSupportDir { ^"SCHOME".getenv }
*userAppSupportDir { ^thisProcess.platform.userAppSupportDir }
systemExtensionDir { _Platform_systemExtensionDir }
Now just make sure that SCHOME is set appropriately and you are done.
How to consistently mount external (USB) hard disks on Debian systems using autofs
This applied to Debian unstable in November 2008. Yes, it is easy. No, it is not well documented.
- There are already udev rules which create symbolic links to /dev/disk/by-uuid for all the partitions on your external USB hard disk as soon as it is plugged in.
- Find out which of these symbolic links in /dev/disk/by-uuid points to the partition you want to mount.
- Add an entry to /etc/auto.media:
dirname -fstype=auto UUID=the_uuid_you_just_found_here
You could also use the symbolic link you found before like this:dirname -fstype=auto :/dev/disk/by-uuid/the_symbolic_link_you_found_here - Add an entry to /etc/auto.master
/mnt/media /etc/auto.media --timeout=60 - Restart autofs:
invoke-rc.d autofs restart - Plug in your external hard disk.
ls /mnt/media/dirname- Check /var/log/syslog for automount messages.
How to make wicd recover after suspend to RAM/hibernate
If your system uses the hibernate script add the following to /etc/hibernate/scriptlets.d/wicd:
AddSuspendHook 61 WicdSuspend
AddResumeHook 61 WicdResume
WicdSuspend() {
vecho 3 "Putting Wicd to sleep"
/usr/share/wicd/suspend.py
return 0
}
WicdResume() {
vecho 3 "Waking up Wicd"
/usr/share/wicd/autoconnect.py
return 0
}
That's all.
(Note: These scripts used to be located in /usr/lib/wicd, cf. Bug 510461)