Skip to content

Instantly share code, notes, and snippets.

View ymek's full-sized avatar

Myke Stubbs ymek

  • cyberspace
View GitHub Profile
## Options to set on the command line
d-i debian-installer/locale string en_US.utf8
d-i console-setup/ask_detect boolean false
d-i console-setup/layout string us
#d-i netcfg/get_hostname string dummy
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
# Continue without a default route
# Zero out the free space to save space in the final image:
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
dd if=/dev/zero of=/boot/EMPTY bs=1M
rm -f /boot/EMPTY
# Set up sudo
echo %vagrant ALL=NOPASSWD:ALL > /etc/sudoers.d/vagrant
chmod 0440 /etc/sudoers.d/vagrant
# Setup sudo to allow no-password sudo for "sudo"
usermod -a -G sudo vagrant
# Installing vagrant keys
mkdir /home/vagrant/.ssh
chmod 700 /home/vagrant/.ssh
# Install NFS client
apt-get -y install nfs-common
# Without libdbus virtualbox would not start automatically after compile
apt-get -y install --no-install-recommends libdbus-1-3
# The netboot installs the VirtualBox support (old) so we have to remove it
aptitude -y purge virtualbox-ose-guest-x11 virtualbox-ose-guest-dkms virtualbox-ose-guest-utils
aptitude -y install dkms
{
"provisioners": [
{
"type": "shell",
"scripts": [
"scripts/base.sh",
"scripts/chef.sh",
"scripts/virtualbox.sh",
"scripts/vagrant.sh",
"scripts/cleanup.sh",
# Remove items used for building, since they aren't needed anymore
echo "removing unnessary packages"
apt-get remove -y linux-headers-$(uname -r) build-essential
apt-get autoremove -y
# Removing leftover leases and persistent rules
echo "cleaning up dhcp leases"
rm /var/lib/dhcp/*
echo "cleaning apt cache"
# Apt-install various things necessary for Ruby, guest additions,
# etc., and remove optional things to trim down the machine.
# needed sometimes for the system to "settle"
sleep 30
mkdir -p /etc/chef
# Compress apt indexes
cat <<EOF > /etc/apt/apt.conf.d/02compress-indexes
{
"variables": {
"aws_access_key_id": "",
"aws_secret_access_key": ""
},
"provisioners": [
{
"type": "shell",
"scripts": [
@ymek
ymek / foo.py
Last active December 27, 2015 01:09
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
» brew info lzlib
lzlib: stable 1.5
http://www.nongnu.org/lzip/lzlib.html
/usr/local/Cellar/lzlib/1.5 (8 files, 120K) *
Built from source
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/lzlib.rb
@ymek
ymek / foo.py
Created October 31, 2013 00:37
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from PIL import Image, ImageDraw, ImageFont
import logging
L = logging.getLogger()
text = 'There is asdfasfd'
ascent = 76