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 / Vagrantfile-minikube
Created Mar 25, 2019
Vagrantfile that installs minkube in a VM and runs it there with vm-driver=none
View Vagrantfile-minikube
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| = "debian/stretch64"
# = "debian/buster64"
config.vm.provider "libvirt" do |v|
lpenz /
Last active Jan 24, 2019
Start steam in a nested X server running icewm
set -e -x
Xephyr "$DISPLAY_SESSION" -screen 1800x1000 &
trap 'kill "$PID_X"; wait "$PID_X"' EXIT
sleep 1
lpenz / SConstruct
Created Jan 20, 2019
SConstruct template with an action that renders jinja2 templates using data from an yaml file, while providing a markdown filter
View SConstruct
# SConstruct template with an action that renders jinja2 templates
# using data from an yaml file, while providing a markdown filter.
import yaml
import jinja2
import markdown
if False:
Environment = None
lpenz / Dockerfile
Created Oct 27, 2018
Dockerfile that creates a container that installs fluorite + electron locally
View Dockerfile
# You can use this Dockerfile to avoid having to install npm to
# get fluorine + electron installed locally.
# You still need node.js to run it, however.
# To use:
# docker build -t fluorine .
# docker run -it --rm -v $PWD:/home/user/work -e MY_UID=$UID fluorine
# The container will exit after fluorine + electron are set up; you can then
# remove the container with:
# docker rmi fluorine
# To run fluorine:
lpenz / minesweeper.hs
Created Nov 20, 2017
minesweeper kata in haskell, no output
View minesweeper.hs
import qualified Data.Map as Map
import Control.Monad
main :: IO ()
main = processOneField
processOneField :: IO ()
lpenz / nix-enter
Last active Mar 26, 2017
Enter a shell with ~/nix privately mounted in /nix, using mount namespaces. sudo required
View nix-enter
set -e -x
trap 'rm -f $TMP' EXIT
chmod u+x "$TMP"
cat > "$TMP" <<END
sudo mkdir /nix
lpenz / pa-monofy-stereo
Last active Mar 26, 2017
Join audio sink channels into a single mono channel, for stereo audio files with sound in only a channel
View pa-monofy-stereo
set -e -x
pacmd load-module module-remap-sink sink_name=mono master=$(pacmd list-sinks | grep -m 1 -oP 'name:\s<\K.*(?=>)') channels=2 channel_map=mono,mono
lpenz / ansible-apt-repos
Last active Jun 23, 2017
Install apt repositories with ansible
View ansible-apt-repos
set -x -e -o pipefail
: for deb-multimedia keyring, browse
ansible -i localhost, -c local localhost -m apt_repository -a 'repo="deb stable main non-free"'
ansible -i localhost, -c local localhost -m apt_repository -a 'repo="deb testing main non-free"'
ansible -i localhost, -c local localhost -m apt_repository -a 'repo="deb unstable main non-free"'
: for dropbox
lpenz / winclick
Created Nov 17, 2016
Click a window selected by name; uses xwininfo and xdotool
View winclick
WINNAME="${1?usage: "$0" windowname}"
set -e
trap 'rm -f $TMP' EXIT
eval "$(xdotool getmouselocation --shell)"
lpenz / img2vagrant
Created Oct 5, 2016
Create a for vagrant (virtualbox) from the specified raw img file
View img2vagrant
IMG=${1?usage: $0 <img>}
set -e -x
rm -f "${IMG}.vmdk"
VBoxManage convertfromraw "$IMG" "${IMG}.vmdk" --format vmdk
VBoxManage unregistervm "$NAME" --delete || :
You can’t perform that action at this time.