Skip to content

Instantly share code, notes, and snippets.

View ptman's full-sized avatar
💭
.

Paul Tötterman ptman

💭
.
View GitHub Profile
@ptman
ptman / ssh_scan_keys.py
Created July 12, 2013 14:02
Usage: ./ssh_scan_keys.py /home /export/home
#!/usr/bin/env python
# coding: utf-8
# vim: set ts=4 sts=4 sw=4 si ai et ft=python:
# author: Paul Tötterman <paul.totterman@zenrobotics.com>
#
# Copyright (c) 2013, ZenRobotics Ltd.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
@ptman
ptman / dhcpd.conf.erb
Created June 11, 2013 13:22
Build dhcpd.conf based on information in LDAP, using erb templating in puppet.
# file managed by puppet
<%# Copyright (c) 2013, ZenRobotics Ltd. All rights reserved. %>
<%
require 'ipaddr'
raise Puppet::Error, 'Could not set up LDAP Connection: Missing ruby/ldap libraries' unless Puppet.features.ldap?
conn = Puppet::Util::Ldap::Connection.instance
conn.start
connection = conn.connection
base = Puppet.settings[:ldapbase]

Advanced hints for a good FDE setup:

  • use a CD-R to boot (even better: a Pocket CD-R as you can carry them around more easily, but they are harder to come by nowadays)
  • CD-Rs have digits and characters carved/lasered/whatevered into their inner ring close to the center which are probably unique to every disc: memorize those and always check them in case someone tries to slip you a fake CD-ROM
  • under Linux, you have to boot the kernel from the CD, but that means you have to burn a new one after every kernel upgrade. to circumvent that, use the kexec program and work it into the boot scripts so that the boot CD boots the updated kernel from the decrypted harddrive (yes, it means you have to enter your password twice for each bootstrap -- you'll get used to it).
  • buy a clean, cheap keyboard and glue it shut so that no hardware keylogger or microphone can be implanted into it; switch keyboards if you have a Model M
  • use a disk password with maximum entropy, i.e. if you algorithm is 256 bits wide, gen