Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Explicit developer laptop automation

Explicit developer laptop automation

Presentation at PyGrunn in May 2012

D8199ddc0a286ca23415595a4eb22c44?s=128

Reinout van Rees

May 11, 2012
Tweet

More Decks by Reinout van Rees

Other Decks in Technology

Transcript

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

  2. 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.
  3. Dev laptop automation •Collect explicitly •Scripts, tools •Dotfiles •Version controlled

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

    •Backups
  5. What to collect? •Python tools •Handy shell scripts •Your custom

    tasks (so you finally make them)
  6. ~/tools/bin •https://github.com/ reinout/tools •Shell+py scripts •Pip requirements file •Local development

    (zest.releaser, etc.) •... look on github
  7. Dev laptop automation •Collect explicitly •Scripts, tools •Dotfiles •Version controlled

    •Backups
  8. 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)
  9. My ~/Dotfiles •New laptop? •Second home machine? •Your kid has

    a screwdriver? •All those nifty tricks...
  10. .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
  11. .profile # Handy aliases for going up in a directory.

    alias ..="cd .." alias ...="cd ../.." alias ....="cd ../../.." alias .....="cd ../../../.."
  12. .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"
  13. Dev laptop automation •Collect explicitly •Scripts, tools •Dotfiles •Version controlled

    •Backups
  14. 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
  15. 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)
  16. .checkoutmanager.cfg [git] vcs = git basedir = ~/git/ checkouts =

    git@github.com:camptocamp/collective.eggproxy.git git@github.com:reinout/django.git git@github.com:reinout/gitignore.git git@github.com:reinout/pep8.git git@github.com:reinout/reinout.vanrees.org.git git@github.com:reinout/serverinfo.git git@github.com:zestsoftware/zest.releaser.git git@github.com:rvanlaar/djangorecipe.git ssh://vanrees.org/~/git/websitecontent ssh://vanrees.org/~/git/samplecodediffer
  17. Dev laptop automation •Collect explicitly •Scripts, tools •Dotfiles •Version controlled

    •Backups
  18. Backups •Automate this, too •Mail: copy on own server, imap

    on gmail •Git/hg/svn •Timemachine •Ubuntu one •Backup own server: backupninja
  19. 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
  20. /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
  21. Questions? •dotfiles •checkoutmanager •collect & automate explicitly •backup & backupninja

    •http://reinout.vanrees.org/