Guides for grognards

5 thoughts
last posted March 30, 2018, 10:40 a.m.
get stream as: markdown or atom

Caps Lock as Escape on Ubuntu

The default UI lacks a convenient way to set this, but you can modify the following dconf setting:

dconf read /org/gnome/desktop/input-sources/xkb-options
dconf write /org/gnome/desktop/input-sources/xkb-options "['compose:menu', 'caps:escape']"

See the xkeyboard-config man page for more options.


PyCharm for grognards

Initial setup:

  • charm opening script: ~/.local/bin/charm (manually expand ~ first)

Important shortcuts:


  • Disable unused plugins, for simplicity.
  • Editor → General → Other: Always write EOL, and strip spaces
  • For Python projects: set virtualenv under "Project Interpreter"

To configure Vim or such as external editor, see here. PyCharm's line and column can be passed like -c "call cursor($LineNumber$, $ColumnNumber$)" (must be double-quotes; single-quotes don't work)


  • Program: gvim
  • Parameters: -c "call cursor($LineNumber$, $ColumnNumber$)" $FilePathRelativeToSourcepath$
  • Working directory: $SourcepathEntry$

SpatiaLite on Ubuntu

Django 1.9 docs: Installing Spatialite

Spatialite packages:

  • spatialite-bin

Header packages:

  • GEOS: libgeos-dev libgeos++-dev
  • PROJ.4: libproj-dev
  • GDAL: libgdal-dev

To initialise a SpatiaLite DB:

spatialite foo.sqlite3 "SELECT InitSpatialMetaData();"

(Since Django 1.8, django-admin will do this automatically.)


Building Pillow on Ubuntu 15.10

Upstream docs: Building on Linux

You'll need these header packages, depending on what features you want:

  • ZLIB (PNG/ZIP): zlib1g-dev
  • JPEG: libjpeg-dev
  • WEBP / WEBPMUX: libwebp-dev
  • LITTLECMS2: liblcms2-dev
  • FREETYPE2: libfreetype6-dev
  • LIBTIFF: libtiff5-dev
  • OPENJPEG (JPEG2000): libopenjpeg-dev


npm defaults to putting stuff in slightly silly places (see npm-folders).

To save more reasonable paths in ~/.npmrc:

npm config set prefix ~/.local
npm config set cache ~/.cache/npm

This makes npm install -g user-local, and keeps its cache in the default XDG cache directory.