Skip to content

Instantly share code, notes, and snippets.

View mhahl's full-sized avatar
👁️‍🗨️
Oh, hi Mark!

Mark Hahl mhahl

👁️‍🗨️
Oh, hi Mark!
  • Canberra, Australia
View GitHub Profile
#!/bin/ruby
######################################################
#
# Author: Mark Hahl
# Email: mark@deviateit.net
# Version: 0.0.0
#
# Firewall configuration script for gateway server,
# managing traffic and other rules.
#
@mhahl
mhahl / rc.slapd
Created August 14, 2014 01:02
IBM TDS Init script for AIX
#!/bin/bash
#------------------------------------------
# Init script for TDS.
# Author: Mark Hahl
# Date: 28-05-2014
# Likley doesn't even work.
#------------------------------------------
# We only have one instance running anyway.
#
# From http://stackoverflow.com/questions/4120001/what-is-the-git-equivalent-for-revision-number
# $ git_rev
# 2:0f8e14e:20130220
#
# commit_count:last_abbrev_commit:date_YYmmdd
#
git_rev ()
{
d=`date +%Y%m%d`
@mhahl
mhahl / mklst.sh
Last active August 29, 2015 14:08
Create lst files for pdbackup
#!/bin/sh
if [[ $# -eq 0 ]];then
print "Usage: ./mklst.sh [instance | --all]"
print "\t./mklst.sh intra"
exit 1
fi
if [[ $1 == "--all" ]];then
for i in /opt/pdweb/www-*
@mhahl
mhahl / mkpdb.sh
Created October 22, 2014 23:02
Create pdbackups
#!/bin/sh
# Usage: ./script.sh | sh
CWD=$(pwd)
BACKUPS="$CWD/backups"
LISTS="$CWD/lst"
echo "rm /tmp/msg__pdbackup.log"
@mhahl
mhahl / Instructions.md
Created April 26, 2015 22:02
Unity Desktop on Gentoo

Instructions

Run as root

layman -a unity-gentoo
layman -S

Then select the vivid unity-gentoo profile:

@mhahl
mhahl / soap.rb
Created May 10, 2015 22:33
SOAP using net/http
# Thanks to:
# http://broadcast.oreilly.com/2008/12/creating-custom-soap-requests.html
require 'net/http'
require 'net/https'
# Create te http object
http = Net::HTTP.new('rpc.geocoder.us', 80)
http.use_ssl = false
path = '/service/soap/'
#!/bin/bash
iptables -F
iptables -X
iptables -t mangle -F
iptables -t mangle -X
iptables -t nat -F
iptables -t nat -X
iptables -P INPUT DROP
@mhahl
mhahl / pkgs.txt
Created May 31, 2015 08:35
Minimal X11 Fedora
yum install awesome xorg-x11-drv-nouveau xterm xorg-x11-drv-evdev xorg-x11-drv-keyboard xorg-x11-drv-mouse xorg-x11-fonts-100dpi xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-xauth xorg-x11-xinit dejavu-fonts-common dejavu-sans-fonts dejavu-sans-mono-fonts dejavu-serif-fonts
# -----
awesome
xorg-x11-drv-nouveau
xterm
xorg-x11-drv-evdev
xorg-x11-drv-keyboard
@mhahl
mhahl / vlans.sh
Created July 9, 2015 10:31
Network VLAN Setup
#!/bin/bash
nmcli con add type vlan con-name "VLAN10 Managment" id 10 dev enp0s20f1 ip4 10.0.10.1/24
nmcli con add type vlan con-name "VLAN20 Private" id 20 dev enp0s20f1 ip4 10.0.20.1/24
nmcli con add type vlan con-name "VLAN30 Public" id 30 dev enp0s20f1 ip4 10.0.30.1/24