Skip to content

Instantly share code, notes, and snippets.

title: personal wishlist
description: see https://gist.github.com/barn/84ab929b5fad96834acbd187cbd05f12
//wastelander shotgun
//notes: PvE Roll??
dimwishlist:item=1679868061&perks=1047830412,791862061,536173722,78
//retrofit volatile taget lock // https://www.youtube.com/watch?v=Vx0TPO3NLOE
dimwishlist:item=3103325054&perks=1482024992,2420895100,848860060,2939589096,192157151
@barn
barn / demo_pyinstaller.py
Created February 19, 2015 23:55
Simple pyinstaller failure demo script
#!/usr/bin/env python
import re
import sys
import time
import signal
import subprocess
import multiprocessing
# from xml.dom import minidom
@barn
barn / pinentry-hax
Created March 18, 2015 03:46
An alternative pinentry script for scripting PIN responses for GPG. https://mumble.org.uk/blog/2015/03/17/pining-for-gpg-to-try
#!/bin/bash
#
# This.
# Is.
# Awful.
# write that file as:
# round=<0|1|2>
# oldpass=1234
# newpass=4321
@barn
barn / muttprint.pl
Created August 8, 2022 16:40
messy hacked version of muttprint
#!/usr/bin/env perl
#
# Hinweis: Tabulatorbreite: 4 Zeichen
# Notice: tab width: 4 characters
#
########################################################################
# #
# Muttprint - pretty printing of mails with Mutt #
# Copyright (c) 2000-04, Bernhard Walle <bernhard.walle@gmx.de> #
# Copyright (c) 2005, Lukas Ruf <lukas.ruf@lpr.ch> #
@barn
barn / copy_from_docker_image.sh
Created January 19, 2022 16:52
zsh function to copy files out of a container image.
#!/bin/zsh
#
# Supports <image>:<path>, supports sha256/tags, path supports wildards, if a second arg is a path, it will output there, creating paths if needed
# $ copy_from_docker_image ruby:2.7.4:/etc/hosts ./
copy_from_docker_image() {
if [ -z "$ZSH_VERSION" ]; then
echo "sorry I need to use zsh"
exit 1
fi
@barn
barn / npm.sh
Last active July 7, 2019 16:49
#! /bin/zsh
NPM="$(which -a npm 2>/dev/null | grep -m 1 /)"
if [ -n "$NPM" ]
then
npm() {
local rc
"$NPM" $@
rc=$?
@barn
barn / etc_network_interfaces
Created June 28, 2012 01:07
LACP + VLANs on debian
root@schick-1:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
# allow-hotplug eth0
@barn
barn / .gitconfig
Created April 18, 2018 18:01
Add this to your git config (found via some stackoverflow, and beaten till it worked)
[alias]
recent = "!r() { \
git for-each-ref --color=always --sort=-committerdate refs/heads --format='%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)' \
| column -ts'|' \
| cut -c -$(tput cols) \
;}; r"
@barn
barn / gist:e11440955e873dad4b71f627f357c293
Created April 17, 2018 22:45
Use list of branches by age
~/.gitconfig
[alias]
recent = "!r() { \
git for-each-ref --color=always --sort=-committerdate refs/heads --format='%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)' \
| column -ts'|' \
| cut -c -$(tput cols) \
;}; r"
@barn
barn / puppet_prov_pkg_pip.diff
Created April 17, 2018 20:21
Diff to fix puppet 3.x.x talking to Pypi after they changed their infrastructure (to do the right thing) on 2018-04-17
diff --git i/lib/puppet/provider/package/pip.rb w/lib/puppet/provider/package/pip.rb
index 8e889a0b1..0204b17d0 100644
--- i/lib/puppet/provider/package/pip.rb
+++ w/lib/puppet/provider/package/pip.rb
@@ -68,6 +68,9 @@ Puppet::Type.type(:package).provide :pip,
client = XMLRPC::Client.new2("http://pypi.python.org/pypi", proxy)
client.http_header_extra = {"Content-Type" => "text/xml"}
+ # also add an accept header, as the pypi infra changed and now they
+ # will gzip the response, which xmlrpc client will not handle.