Skip to content

Instantly share code, notes, and snippets.

View felixhummel's full-sized avatar

Felix Hummel felixhummel

View GitHub Profile
@felixhummel
felixhummel / sources.list
Created January 11, 2013 20:57
12.04.1 server default sources.list germay
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://de.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ precise main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://de.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ precise-updates main restricted
@felixhummel
felixhummel / helper
Created April 11, 2013 11:58
startssl class1 helper
#!/bin/bash
[[ -z $2 ]] && echo "Usage: $0 POSTMASTER_EMAIL FULL_DOMAIN_NAME" && exit 1
postmaster_email=$1
full_domain_name=$2
req_file=${full_domain_name}/req
key_file=${full_domain_name}/key
crt_file=${full_domain_name}/crt
chain=${full_domain_name}/chain
@felixhummel
felixhummel / dns_expire.py
Created July 19, 2013 13:41
Prints IP address and expiration time for a domain. See first comment for usage.
#!/usr/bin/env python
# vim: set fileencoding=utf-8 filetype=python :
"""
Usage: dns_expire <domain>...
"""
import calendar
import time
import dns.resolver
from docopt import docopt
/tmp/x:
file.managed:
- source: salt://x
- watch:
- file: /tmp/y
/tmp/y:
file.touch
think master /srv/salt # salt-call --version
salt-call 0.15.1
think master /srv/salt # ls -la /tmp/y
-rw-r--r-- 1 root root 0 Aug 2 15:18 /tmp/y
think master /srv/salt #
think master /srv/salt # echo 'changed' > x
think master /srv/salt # salt-call --local state.sls filewatch
[INFO ] Configuration file path: /etc/salt/minion
[INFO ] Executing command 'ps -efH' in directory '/home/felix'
[INFO ] Loading fresh modules for state activity
think master /srv/salt # salt-call --version
salt-call 0.15.1
think master /srv/salt # ls -la /tmp/y
-rw-r--r-- 1 root root 0 Aug 2 15:18 /tmp/y
think master /srv/salt #
think master /srv/salt # echo 'changed' > x
think master /srv/salt # salt-call --local state.sls filewatch
[INFO ] Configuration file path: /etc/salt/minion
[INFO ] Executing command 'ps -efH' in directory '/home/felix'
[INFO ] Loading fresh modules for state activity
think master /srv/salt # salt-call --version
salt-call 0.15.1
think master /srv/salt # ls -la /tmp/y
-rw-r--r-- 1 root root 0 Aug 2 15:18 /tmp/y
think master /srv/salt #
think master /srv/salt # echo 'changed' > x
think master /srv/salt # salt-call --local state.sls filewatch
[INFO ] Configuration file path: /etc/salt/minion
[INFO ] Executing command 'ps -efH' in directory '/home/felix'
[INFO ] Loading fresh modules for state activity
#!/bin/bash
[[ $1 == 'skip' ]] || wget -c http://dir.xiph.org/yp.xml
python<<'EOF'
from lxml import etree
t = etree.parse(open('yp.xml'))
def urls_by_genre(genre):
#!/usr/bin/env python
# vim: set fileencoding=utf-8 filetype=python :
"""
Prints the expiration time of a domain as seen from the host this is run on.
Example Output:
felixhummel.de (37.200.98.98): 3055 sec (about 50 min)
"""
from __future__ import print_function
@felixhummel
felixhummel / useless.py
Last active October 27, 2018 22:18
You go figure it out. :P
import string
import sys
print (lambda c: (string.letters + string.digits) * (c/len((string.letters + string.digits))) + (string.letters + string.digits)[:c-len((string.letters + string.digits) * (c/len((string.letters + string.digits))))])(int(sys.argv[1]))