Skip to content

Instantly share code, notes, and snippets.

View felixhummel's full-sized avatar

Felix Hummel felixhummel

View GitHub Profile
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
/tmp/x:
file.managed:
- source: salt://x
- watch:
- file: /tmp/y
/tmp/y:
file.touch
@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
@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 / 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 / preseed.cfg
Last active December 10, 2015 13:58
preseed.cfg as generated by `debconf-get-selections --installer` more: see https://github.com/felixhummel/ubuntu-12.04.1-server-amd64-vagrant/blob/master/templates/preseed.cfg
# for internal use; can be preseeded
partman-basicfilesystems partman/automount boolean false
# Non-existing physical volume
partman-auto-lvm partman-auto-lvm/no_such_pv error
# Active devices for the RAID array:
# Choices:
partman-md partman-md/raiddevs multiselect
# Use software from the "universe" component?
apt-mirror-setup apt-setup/universe boolean true
#
@felixhummel
felixhummel / info.php
Created September 7, 2012 18:26
fastcgi nginx php test
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index info.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
@felixhummel
felixhummel / kubuntu_initial.sh
Last active October 6, 2015 09:38
kubuntu initial
sudo add-apt-repository ppa:chromium-daily/beta
sudo apt-get update
\curl -L https://raw.github.com/felixhummel/x/master/ubuntu_intial.sh | bash
wajig install --yes yakuake chromium-browser firefox
wajig install --yes krusader md5deep okteta krename kdiff3 ark arj bzip2 cpio lha unrar rar rpm unace unzip zip p7zip
wajig install --yes oxygen-cursor-theme-extra k4dirstat
wajig install --yes vlc
@felixhummel
felixhummel / gist:1416996
Created December 1, 2011 14:10
PHP Symfony get absolute path from relative Path
$relativePath = $this->config['foo'];
$pseudoPath = sfConfig::get('sf_root_dir') . DIRECTORY_SEPARATOR . $relativePath;
$absolutePath = realpath($pseudoPath);
if (!$absolutePath) {
throw new Exception("File not found: $pseudoPath");
}
$this->use($absolutePath);