Skip to content

Instantly share code, notes, and snippets.

View antonlindstrom's full-sized avatar
👓

Anton Lindström antonlindstrom

👓
View GitHub Profile
@antonlindstrom
antonlindstrom / xend-config.sxp
Created September 5, 2011 16:20
Simple xend-config.sxp
# -*- sh -*-
## Bridged
(network-script 'network-bridge netdev=dummy0')
(vif-script vif-bridge)
(dom0-min-mem 196)
(dom0-cpus 0)
@antonlindstrom
antonlindstrom / tmux.conf
Created July 29, 2011 05:09
tmux config
set -g default-terminal "screen-256color"
set -g history-limit 2000
# Keys
bind-key a last-window
bind-key @ confirm-before kill-window
bind-key r source-file ~/.tmux.conf # reload
bind-key v split-window -h
bind-key ^V split-window -h
@antonlindstrom
antonlindstrom / dnscheck
Created July 22, 2011 10:13
keepalived for DNS
#!/bin/bash
#$Id: keepalivepin,v 1.2 2006/02/27 07:30:41 hmy Exp hmy $
#use dig check the powerdns's status.
#in the dns database,have a IN TXT RR keepalivepin.vmmatrix.net,content is "AaBbCcDdEeFf"
# Source: http://puppet-manifest-share.googlecode.com/svn/trunk/vmx-puppet/modules/lvs/files/keepalived.dns-pin
#
RR=keepalivepin.vmmatrix.net
[ $# -le 1 ]&&{ echo "usage: ${0} -h <ip>"; exit 126;}
while getopts "h:" OPT;do
case $OPT in
root@test:~# time dd if=/dev/zero of=/var/lib/mysql/test1 bs=1M count=10000
10000+0 records in
10000+0 records out
10485760000 bytes (10 GB) copied, 10.6842 s, 981 MB/s
real 0m10.685s
user 0m0.008s
sys 0m10.677s
@antonlindstrom
antonlindstrom / gist:858861
Created March 7, 2011 17:44
Tests for mod_sec laboration in DA516G
#!/usr/bin/ruby
#
# Tests for rules in mod_security
require 'test/unit'
require 'net/http'
require 'rubygems'
require 'uri'
class TestRules < Test::Unit::TestCase
#!/bin/sh
#
#http://www.pps.jussieu.fr/~jch/software/ipv6-connectivity.html
set -e
ip4=$1
echo "$ip4" | grep -q '^[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*$' || \
{ echo 'Syntax: $0 a.b.c.d'; exit 1; }
@antonlindstrom
antonlindstrom / gist:828104
Created February 15, 2011 19:52
Simplifies the management of vms in virtualbox. 2> /dev/null moahaha..
# Define the Virtual machines
def vms
vm = Hash.new
vm["vm-name"] = { :port => "2030", :natif => "3", :user => "root" }
vm["centos-test"] = { :port => "2031", :natif => "1", :user => "root" }
vm["gentoo-dev"] = { :port => "2032", :natif => "1", :user => "root" }
vm
end
<IfModule mod_security2.c>
# Basic configuration options
SecRuleEngine On
SecRequestBodyAccess On
SecResponseBodyAccess On
# Handling of file uploads
# TODO Choose a folder private to Apache.
# SecUploadDir /opt/apache-frontend/tmp/
SecUploadKeepFiles Off
@antonlindstrom
antonlindstrom / gist:793074
Created January 24, 2011 10:58
Wroopia Examples
Loopia.config.set_domain("example.com")
pp Loopia.dns.get_domains
pp Loopia.dns.add_subdomain("subdomain")
pp Loopia.dns.get_subdomains
pp Loopia.dns.get_zonerecords("@")
@antonlindstrom
antonlindstrom / gist:725159
Created December 2, 2010 11:34
DA330G List