peteshadbolt.co.uk

Computers

Computers are fun and useful. These are notes on how I use computers - mostly to jog my own memory. I use these guys a lot:

  • Xubuntu 16(18).04
  • Firefox
  • Thunderbird
  • Inkscape
  • Gimp
  • XKeepass

Text editing

Vim with as few plugins as possible. Ctrl-P, NeoSnippet and NeoComplete. I recently started using NeoVim, it’s indistinguisable from Vim AFAIC.

Vim must be built from source to link with Python, Lua, Ruby etc. Here’s the recipe:

# Install dependencies
apt-get -y install libncurses5-dev python-dev libperl-dev ruby-dev lua5.2 lua5.2-dev liblua5.2-dev

# Download vim source
wget https://github.com/vim/vim/archive/v8.0.0688.tar.gz
tar xzvf v8.0.0688.tar.gz
cd vim-8.0.0688

# Configure the build
./configure                   \
    --prefix=/usr             \
    --enable-luainterp=yes    \
    --enable-perlinterp=yes   \
    --enable-pythoninterp=yes \
    --enable-rubyinterp=yes   \
    --enable-cscope           \
    --disable-netbeans        \
    --enable-multibyte        \
    --enable-largefile        \
    --enable-gui=no           \
    --with-features=huge      \

# Make and install
make install

Webservers

Every time:

  • Ubuntu 16.04
  • NGINX
  • Gunicorn
  • Flask
  • Supervisor
  • Redis
  • Postgres

This tutorial is decent.

Push-to-deploy post-receive hook:

#!/bin/sh
GIT_WORK_TREE=/home/www/flask_project git checkout -f

Misc

  • terminator is a good terminal with window splitting
  • ag is the best for searching code
  • locate is freaking essential and it kills me when people don’t have it set up
  • Use bash. The only reason you are installing these nutso shells like fish and zsh is to get autocomplete. Ctrl-R works just fine for me. Bash is also terrible but that’s by the by.
  • htop is good.

~/.ssh/config entries are hella useful:

Host example
    User example
    IdentitiesOnly yes
    Hostname example.com
    IdentityFile ~/.ssh/id_rsa.pub

Then ssh example or ssh user@example.

  • pytest is the best test framework
  • termux runs full Vim, Python3, ssh etc. on your phone, it owns