Skip to content

Instantly share code, notes, and snippets.

View winks's full-sized avatar
🚮
Computers were a bad idea.

Florian Anderiasch winks

🚮
Computers were a bad idea.
View GitHub Profile
@winks
winks / Env.hs
Created September 14, 2019 18:36 — forked from shapr/Env.hs
lookup environment variables, some of which do not exist. Handle whether exists or not.
module Main where
-- using http://hackage.haskell.org/package/base-4.12.0.0/docs/System-Environment.html#v:lookupEnv
import System.Environment
main :: IO ()
main = do
shell <- lookupEnv "SHELL" -- System.Environment.lookupEnv take a String
doesnotexist <- lookupEnv "DOESNOTEXIST"
print (checkEnvVars shell)
@winks
winks / .Xmodmap
Created March 31, 2018 09:25 — forked from fbettag/.Xmodmap
Logitech G610 xmodmap bindings for multimedia keys
! logitech g610 multimedia keys
keycode 170 = XF86AudioLowerVolume NoSymbol XF86AudioLowerVolume
keycode 92 = XF86AudioRaiseVolume NoSymbol XF86AudioRaiseVolume
keycode 189 = XF86AudioPrev NoSymbol XF86AudioPrev
keycode 190 = XF86AudioNext NoSymbol XF86AudioNext
keycode 184 = XF86AudioPlay XF86AudioPause XF86AudioPlay XF86AudioPause
keycode 207 = XF86AudioMute NoSymbol XF86AudioMute
keycode 147 = XF86AudioStop XF86Eject XF86AudioStop XF86Eject

Hetzner Primary IPv4 IP + IPv4/2x Subnet + "Non-Routed" IPv6/64 Subnet HowTo

... so I do not forget the next time I have to figure this stuff out. And perhaps to help other poor souls fiddling with v6/v4 xen setups in a Hetzner network environment.

Basic setup

You can basically follow along the Xen Project Beginners Guide.

The short version

Install Debian Wheezy via Hetzner's installimage on the rescue system, the only important part about partitioning is that you have an LVM volume group named vg0 with enough space for your guests' disks.

@winks
winks / 0_reuse_code.js
Created November 7, 2013 17:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# Create a self-signed cert
openssl req -x509 -batch -nodes -newkey rsa:2048 -keyout lumberjack.key -out lumberjack.crt
# Run a server
openssl s_server -accept 3333 -cert lumberjack.crt -key lumberjack.key
# Run a client
#!/usr/bin/ruby
require 'webrick'
require 'json'
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(STDIN)
json_payload = JSON.parse(req.query['payload'])
branch = json_payload['ref'].split('/')[-1]
@winks
winks / gist:4055675
Created November 11, 2012 17:49 — forked from anonymous/gist:4055669
git2package
#!/bin/sh
#
# This is the shell script for building:
# 1. a TAR.GZ package;
# 2. a ZIP package
# of phpMyFAQ using what committed into Git.
#
# For creating a package simply run:
#
# ./git2package.sh