# 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](https://www.mankier.com/7/xkeyboard-config) man page for more options. ---- # PyCharm for grognards Initial setup: * `charm` opening script: `~/.local/bin/charm` (manually expand `~` first) Important shortcuts: * https://www.jetbrains.com/pycharm/help/keyboard-shortcuts-you-cannot-miss.html * Gnome keymap is probably better than the default X11, to reduce conflicts with the window manager. Settings: * 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](https://confluence.jetbrains.com/display/PYH/Using+Emacs+as+an+external+editor). PyCharm's line and column can be passed like `-c "call cursor($LineNumber$, $ColumnNumber$)"` (must be double-quotes; single-quotes don't work) Example: * Program: `gvim` * Parameters: `-c "call cursor($LineNumber$, $ColumnNumber$)" $FilePathRelativeToSourcepath$` * Working directory: `$SourcepathEntry$` ---- # SpatiaLite on Ubuntu Django 1.9 docs: [Installing Spatialite](https://docs.djangoproject.com/en/1.9/ref/contrib/gis/install/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](https://pillow.readthedocs.org/en/latest/installation.html#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 npm defaults to putting stuff in slightly silly places (see [npm-folders](https://docs.npmjs.com/files/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.