Skip to content

Instantly share code, notes, and snippets.

@schu
schu / keybase.md
Last active August 29, 2015 14:07

Keybase proof

I hereby claim:

  • I am schu on github.
  • I am schu (https://keybase.io/schu) on keybase.
  • I have a public key whose fingerprint is C9C3 016B 59F1 3A98 9F6F DDEE D52E EE54 2ABF 47AA

To claim this, I am signing this object:

#!/bin/bash
set -eu
if [[ $# -lt 2 ]]; then
echo "usage: $0 <image.vdi> <name.box> [<vagrant package args>...]" >&2
exit 1
fi
readonly NAME="vdi2vagrantbox-${RANDOM}"
[...]
# https://github.com/mitchellh/vagrant/blob/master/plugins/hosts/linux/cap/nfs.rb
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_EXPORTS_COPY = /bin/cp /tmp/exports /etc/exports
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /tmp/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
@schu
schu / bzr.wsgi
Created February 28, 2012 15:41
bzr.wsgi example
from bzrlib.transport.http import wsgi
def application(environ, start_response):
app = wsgi.make_app(
root="/srv/bazaar/repos/",
prefix="/bzr",
readonly=False,
enable_logging=False)
return app(environ, start_response)
@schu
schu / acme-client-runner.rb
Created December 3, 2015 18:28 — forked from technion/acme-client-runner.rb
Runs Acme Client
#!/usr/bin/env ruby
require 'acme-client'
#Production
#ENDPOINT = 'https://acme-v01.api.letsencrypt.org'
#Testing
ENDPOINT = 'https://acme-staging.api.letsencrypt.org'
EMAIL = 'mailto:technion@lolware.net'
DOMAIN = 'lolware.net'
$ cat /etc/systemd/system/fcgiwrap.service
[Unit]
Description=fcgiwrap Server
After=nss-user-lookup.target
[Service]
ExecStart=/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9001 -u http -g http -- /usr/sbin/fcgiwrap
ExecStartPost=/usr/bin/chmod 660 /run/fcgiwrap.sock
Restart=on-failure
Type=forking
@schu
schu / gist:5142968
Last active December 14, 2015 20:19
Gerrit gsql - email_address
$ sudo -u gerrit java -jar bin/gerrit.war gsql
gerrit> update account_external_ids set email_address = 'foo@example.com' where account_id=XXX;
gerrit> \q
# https://github.com/docker/distribution/blob/master/docs/storage-drivers/s3.md#s3-permission-scopes
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::*"
},

Encountered the following error with sudo dnf install -y curl jq snapd in a sourcehut build environment with image: fedora/30 base:

[SNIP]

  Installing       : selinux-policy-minimum-3 [======================== ] 21/28
  Installing       : selinux-policy-minimum-3.14.3-37.fc30.noarch         21/28 

  Running scriptlet: selinux-policy-minimum-3.14.3-37.fc30.noarch         21/28 
Traceback (most recent call last):

eduroam configuration with wicd @ Uni Heidelberg

Create a file /etc/eduroam/uni-heidelberg-ca.pem (or at a location to your liking) that contains the required CA certificates (can be found below or be extracted from the Linux configuration script by https://cat.eduroam.org).

Create a wicd template at /etc/wicd/encryption/templates/eduroam-uni-heidelberg:

name = eduroam-uni-heidelberg
author = Jane Doe
version = 1