Slide 1

Slide 1 text

Dev laptop setup: explicit automation Reinout van Rees http://reinout.vanrees.org

Slide 2

Slide 2 text

Explicit is better than implicit •Don’t just fool around. •Collect everything. •“The cobbler’s children go barefoot.” •If it isn’t version controlled, it doesn’t exist. Or it isn’t explicit enough.

Slide 3

Slide 3 text

Dev laptop automation •Collect explicitly •Scripts, tools •Dotfiles •Version controlled •Backups

Slide 4

Slide 4 text

Dev laptop automation •Collect explicitly •Scripts, tools •Dotfiles •Version controlled •Backups

Slide 5

Slide 5 text

What to collect? •Python tools •Handy shell scripts •Your custom tasks (so you finally make them)

Slide 6

Slide 6 text

~/tools/bin •https://github.com/ reinout/tools •Shell+py scripts •Pip requirements file •Local development (zest.releaser, etc.) •... look on github

Slide 7

Slide 7 text

Dev laptop automation •Collect explicitly •Scripts, tools •Dotfiles •Version controlled •Backups

Slide 8

Slide 8 text

Dotfiles •On pypi. “pip install”(=> ~/tools/bin for me) •~/Dotfiles with files and directories •Symlinked into the root as dotfiles •Dotfiles command itself only manages it: great single-purpose script •Separate: ~/.emacs.d (=> starter kit)

Slide 9

Slide 9 text

My ~/Dotfiles •New laptop? •Second home machine? •Your kid has a screwdriver? •All those nifty tricks...

Slide 10

Slide 10 text

.inputrc # Ignore case for tab completion. set completion-ignore-case on # No need to press tab twice set show-all-if-ambiguous on # Type the start of a command ("svn" # or so) and press up/down to cycle # through previous versions of that # command. "\e[A": history-search-backward "\e[B": history-search-forward

Slide 11

Slide 11 text

.profile # Handy aliases for going up in a directory. alias ..="cd .." alias ...="cd ../.." alias ....="cd ../../.." alias .....="cd ../../../.."

Slide 12

Slide 12 text

.profile # No accidental shell closing with ctrl-d. export IGNOREEOF=1 # Two-line prompt export PS1="\u@\h:\w\n$ " # Exclude certain things from the # command history. export HISTIGNORE="&:l:vdir:[bf]g:exit"

Slide 13

Slide 13 text

Dev laptop automation •Collect explicitly •Scripts, tools •Dotfiles •Version controlled •Backups

Slide 14

Slide 14 text

Version control •Lots on github and bitbucket •But... dotfiles? Passwords? FTP accounts? •=> Private repository on own linux box •ssh://vanrees.org/~/git/Dotfiles •ssh://vanrees.org/hg/preken

Slide 15

Slide 15 text

Checkoutmanager •Loads of git, bzr, hg, svn checkouts •31 git, 22 svn, 9 hg •No way I’m going to do “git pull” on every one of them in the morning! •=> checkoutmanager •commands: up, st, co, out •On pypi (and source on bitbucket)

Slide 16

Slide 16 text

.checkoutmanager.cfg [git] vcs = git basedir = ~/git/ checkouts = [email protected]:camptocamp/collective.eggproxy.git [email protected]:reinout/django.git [email protected]:reinout/gitignore.git [email protected]:reinout/pep8.git [email protected]:reinout/reinout.vanrees.org.git [email protected]:reinout/serverinfo.git [email protected]:zestsoftware/zest.releaser.git [email protected]:rvanlaar/djangorecipe.git ssh://vanrees.org/~/git/websitecontent ssh://vanrees.org/~/git/samplecodediffer

Slide 17

Slide 17 text

Dev laptop automation •Collect explicitly •Scripts, tools •Dotfiles •Version controlled •Backups

Slide 18

Slide 18 text

Backups •Automate this, too •Mail: copy on own server, imap on gmail •Git/hg/svn •Timemachine •Ubuntu one •Backup own server: backupninja

Slide 19

Slide 19 text

vanrees.org backupninja example setup root@rees:/etc/backup.d# ls -l total 24 -rw------- 1 root root 677 2011-12-28 22:05 10-homes.rdiff -rw------- 1 root root 259 2008-10-30 21:54 11-mail.rdiff -rw------- 1 root root 365 2009-11-30 22:02 12-zope.rdiff -rw------- 1 root root 236 2008-10-30 22:01 13-systemfiles.rdiff -rw------- 1 root root 526 2008-10-29 22:39 30-repos.svn -rw------- 1 root root 228 2008-10-29 20:53 90-bytemarkrsync.sh

Slide 20

Slide 20 text

/etc/backup.d/11-mail.rdiff [source] label = mail type = local keep = 30 # The imap mail is stored in ~/mail include = /home/*/mail # but Maurits claims it is in Mail include = /home/*/Mail # The inbox is in /var/mail include = /var/mail [dest] type = local directory = /var/backups

Slide 21

Slide 21 text

Questions? •dotfiles •checkoutmanager •collect & automate explicitly •backup & backupninja •http://reinout.vanrees.org/