20201113, no-nonsense, low-change platform

A recent thread on hacker news discuses the hassle of software changing
underneath you.


I ran OSX between 2004 and 2011. Several releases changed the behaviour of the
window manager. I found this frustrating. Since 2011, I have been running the
minimal linux setup described here. It is nearly a ten year configuration, and
should go beyond that.


    Install the latest debian stable.

    Discard the default desktop environment. These tend to change every few
    years. Instead, pick a simple and stable window manager that you could
    compile from source if you ever needed to. e.g. dwm or openbox.

    Create a console menu for launching things that you need at startup. e.g.
    wireless, dhcp. (Example below) On each boot, you will have a few seconds
    of inconvenience manually running your init from this menu. This removes
    your dependence on stuff that is tied to the desktop environment, such as
    network configurtion panels.

    Get two external drives, and organise an encrypted backup rotation. You
    probably need (1) a script that mounts the device; (2) a script that
    rsyncs your data to it; (3) a script that syncs and unmounts the device.

    Pick a stable TTY and colour/font combination you like. Configure file
    ~/.Xdefaults for this. (Example below)

    Invest in your CLI editor and other tools. Tmux is excellent, and the
    Hogan Tmux book is a good and thin guide. Also, Visidata is worth a look.

Every three years, do this,

    Get a new disk. Install the new debian stable to it, and rotate across
    your home directory. Discard the old disk.

    Replace your backup disks.

When chosing hardware: get a case with good airflow, overspec the PSU, chose a
decent motherboard, steer towards low power-draw parts. If you go Ryzen you
can get ECC RAM too.

-- menu script (run as root)


from collections import OrderedDict
import os
import sys

class CleanExit(Exception):

class bcol:
    ENDC = '\033[0m'
    BLUE = '\033[94m'
    GREEN = '\033[92m'
    HEADER = '\033[95m'
    WARNING = '\033[93m'
    FAIL = '\033[91m'
    BOLD = '\033[1m'
    UNDERLINE = '\033[4m'

class Option(object):
    def __init__(self, name, cb):
        self.name = name
        self.cb = cb

def prompt(d_options):
    for k, o in d_options.items():
        print '%s%2s%s/ %s'%(bcol.BLUE, k, bcol.ENDC, o.name)
    print '.',
    cmd = raw_input()
    if cmd == 'q':
        raise CleanExit()
    elif cmd in d_options:
        print 'ERR'

def pause():
    print '[paused]'

def cmd_halt():
    os.system('sudo halt')

def cmd_home_wifi():
    os.system('sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/20170626.aa.home.conf')

def cmd_may_paris():
    os.system('sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/20161007.aa.may.paris.conf')

def cmd_phone_wpa():
    os.system('sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/20160902.aa.phone.wpa.conf')

def cmd_invert():
    os.system('xcalib -alter -invert')

def cmd_dhclient_query():
    os.system('ps -ef | grep dhclient')

def cmd_dhclient_killall():
    os.system('sudo killall dhclient')

def cmd_dhclient_launch():
    os.system('sudo dhclient wlan0')

def cmd_ifconfig():

def cmd_see_listeners():
    os.system('sudo lsof | grep LISTEN')

def cmd_redshift():
    os.system('/home/cturner/saga/20160212.memlab.cturner.ab.redshift/redshift/src/redshift -l 51:0')

def cmd_slock():

def main():
    d_options = OrderedDict()
    def o(name, cb):
        d_options[str(len(d_options))] = Option(name, cb)

    o('slock', cmd_slock)
    o('halt', cmd_halt)
    o('wpa:home', cmd_home_wifi)
    o('wpa:phone', cmd_phone_wpa)
    o('invert', cmd_invert)
    o('dhclient query', cmd_dhclient_query)
    o('dhclient killall', cmd_dhclient_killall)
    o('dhclient launch', cmd_dhclient_launch)
    o('ifconfig', cmd_ifconfig)
    o('see listeners', cmd_see_listeners)
    o('redshift', cmd_redshift)

    while True:

if __name__ == '__main__':
    except CleanExit:
    except EOFError:
    except KeyboardInterrupt:
        os.system('stty sane')

-- ~/.Xdefaults

*color5:	#9932CC
*color6:	#87CEEB
*color10:	#77E768
*color12:	#6495ED
*color8:	#454545
*color3:	#96833F
*color13:	#DA70D6
*color14:	#B0E0E6
*color15:	#FFFFFF
*color9:	#ff918b
*background:	#000000
*color0:	#222222
*color4:	#4682B4
*color7:	#C0C0C0
*color2:	#299E1B
*foreground:	#fafafa
*color11:	#D0B249
*color1:	#c90a00

xterm*font:	xft:terminus:size=14
xterm*scrollColor:	#000000
xterm*scrollBar_right:	true
xterm*urlLauncher:	chromium
xterm*scrollBar:	false
xterm*geometry:	112x22  

URxvt*font:	xft:terminus:size=10
URxvt*scrollColor:	#000000
URxvt*scrollBar_right:	true
URxvt*urlLauncher:	chromium
URxvt*scrollBar:	false
URxvt*geometry:	120x28