Time and Memory

Brain dump of a forgetful programmer

From WordPress to Octopress

I’ve transitioned away from WordPress.com to Octopress + Github and am loving it so far. I may need to figure out how to extend Octopress to support latex math mode and image generation, but for now this is a vastly improved blogging experience for me. Thanks Octopress, Github!

Fighting With the WP.com Post Editor

As soon as I start a code-oriented blog I find out that the WordPress post editor doesn’t have a keyboard shortcut for applying <code/> to selected text.. Bah!

I’m looking for a few ways around this:

  • An external editor (web-based or otherwise) which supports auto-conversion of markdown into html and uploads to WP.com.
  • Chrome extension or userscript to hack in an additional ctrl-shift-c keyboard shortcut for the TinyMCE editor used by WP.

Relevant links:

Update 2013-01-21

I found a number of useful projects on which I could build the chrome extension I’d mentioned above, including marked and EpicEditor, but then I landed on Octopress and may have to migrate there. What’s not to love about a blogging framework you have complete control over and can host directly on Github?

Sorting Out Apt-get Dist-upgrade and Nvidia Kernel Modules on Ubuntu

I ran into some trouble with my Ubuntu 12.10 machine yesterday when running a few updates; I noticed that after a normal apt-get update/upgrade a few packages had been “kept back.” Turns out apt-get upgrade will refuse to remove or install new packages by default. If you want everything fully updated, along with new transitive dependencies of existing packages, you need apt-get dist-upgrade instead (1, 2, 3, 4, 5).

Unfortunately, when I ran apt-get dist-upgrade it upgraded my system’s kernel but didn’t recompile existing kernel modules to work with it. The nvidia driver / kernel module failed to load on reboot, causing the display manager and X to enter some awful video mode. Looks like others have run into this issue before (6, 7). To get things back in order, I followed roughly these steps:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Get to a shell on the machine
ssh yourbrokenbox

# Ensure `jockey-text` is available so you can control proprietary drivers (e.g. `nvidia-current`)
# from the command line. If you don't have it, try installing one of jockey's graphical front end
# packages, for example:
sudo apt-get install jockey-gtk

# Turn off the display manager (and X)
sudo stop lightdm

# Turn off the nvidia module
sudo dkms remove nvidia

# Completely remove the nvidia driver package (in my case `nvidia-current`)
sudo apt-get remove --purge nvidia-current

# Make sure you have the latest headers with which to rebuild the driver
sudo apt-get install linux-headers-generic

# Reinstall and rebuild the driver with current kernel
sudo apt-get install nvidia-current

# Check to see if the driver was enabled during install
sudo jockey-text -l

# If necessary, enable the driver
sudo jockey-text -e kmod:nvidia-current

# Reboot and check `/var/logs/Xorg.0.log` and friends for errors
sudo shutdown -r now