Skip to content

Instantly share code, notes, and snippets.


Leandro Lisboa Penz lpenz

Block or report user

Report or block lpenz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
lpenz / debootstrap-vagrant
Last active Oct 4, 2016
Use debootstrap to create a chroot that can be turned into a vagrant-compatible (virtualbox, wheezy 32) VM
View debootstrap-vagrant
DIR=${1?usage: $0 <dir>}
set -e -x
rm -rf "$DIR"
trap 'set +e; umount "$DIR/proc"; umount "$DIR/sys"; rm -rf "$DIR"' EXIT INT
lpenz / dir2img
Last active Apr 22, 2019
Script that creates a bootable qcow2 img with a directory's contents - installs mbr and extlinux
View dir2img
DIR=${1?usage: $0 <dir> <img>}
OUT=${2?usage: $0 <dir> <img>}
set -e -x
rm -f "$OUT"
trap 'rm -f $OUT' EXIT INT
virt-make-fs --partition=mbr --type=ext3 --format=raw --size=+300M "$DIR" "$OUT"
lpenz / Vagrantfile-aws
Last active Mar 4, 2019
Vagrantfile for AWS with sshfs
View Vagrantfile-aws
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure('2') do |config| = 'dummy'
config.ssh.forward_agent = 'true'
config.vm.synced_folder '.', '/vagrant', type: 'sshfs' # only works with ubuntu
config.vm.provider :aws do |aws, override|
lpenz / livedeb
Last active Jun 25, 2019
Creates a live debian on the provided (already partitioned) device
View livedeb
DEV=${1?must specify a device}
function finish {
for d in boot dev/pts dev proc sys; do
if test -d "$PWD/usbroot/$d" && mount | grep -q "$PWD/usbroot/$d"; then
umount "$PWD/usbroot/$d"
lpenz / .travis.yml
Created Feb 21, 2016
Test .gitignore in travis
View .travis.yml
- true Test if we .gitignore test files
- TMP=$(tempfile)
- git ls-files . --exclude-standard --others | tee "$TMP"
- if test -s "$TMP"; then false; else true; fi
- true Test if we .gitignore any tracked files
- git ls-files -i --exclude-standard | tee "$TMP"
- if test -s "$TMP"; then false; else true; fi
lpenz / docker-gc
Last active Apr 18, 2016
Docker garbage collector
View docker-gc
set -x -e
: gc conteiners
docker ps --filter 'status=exited' -q | xargs -r docker rm
docker ps --filter 'status=created' -q | xargs -r docker rm
: gc images
docker images --filter "dangling=true" -q | xargs -r docker rmi
lpenz /
Last active Mar 1, 2018
debootstrap a bare debian docker image
DIST=${1?no distribution specified}
set -e -x
debootstrap --no-check-gpg "--arch=$ARCH" "$DIST" "$NAME"
tar -C "$NAME" -c . | docker import - "$USER/$NAME"
lpenz / brewer.tex
Created Apr 25, 2015
colorbrewer colors for latex
View brewer.tex
% Colors from by Cynthia A. Brewer, Geography, Pennsylvania State University.
% Apache-Style Software License for ColorBrewer software and ColorBrewer Color Schemes
% Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The Pennsylvania State University.
% Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
lpenz / .travis.yml
Created Apr 23, 2015
.travis.yml: base for go with coveralls
View .travis.yml
language: go
- tip
- go get
- go get
- go get
- go get
- go get
- if ! go get; then go get; fi
You can’t perform that action at this time.