Skip to content

Instantly share code, notes, and snippets.

@oko
oko / zytrax-uas.txt
Last active August 29, 2015 14:20
User Agents
Science Traveller International 1X/1.0
Mozilla/3.0 (compatible)
amaya/9.52 libwww/5.4.0
amaya/9.51 libwww/5.4.0
amaya/9.1 libwww/5.4.0
amaya/6.2 libwww/5.3.1
AmigaVoyager/3.4.4 (MorphOS/PPC native)
Debian APT-HTTP/1.3 (0.9.7.5ubuntu5.1)
Ubuntu APT-HTTP/1.3 (0.7.23.1ubuntu2)
Ubuntu APT-HTTP/1.3
@oko
oko / os-x-dnsperf.sh
Created February 27, 2015 06:28
Build DNSperf
#!/bin/bash
# Install libbind and bind9 ports
# - bind9 is installed disabled by default
sudo port -v install libbind bind9
curl -Lsso /tmp/dnsperf.tar.gz ftp://ftp.nominum.com/pub/nominum/dnsperf/2.0.0.0/dnsperf-src-2.0.0.0-1.tar.gz
cd /tmp
tar xzvf dnsperf.tar.gz
cd /tmp/dnsperf-src-2.0.0.0-1
@oko
oko / os-x-local-dnsmasq.sh
Last active April 20, 2020 02:24
Configure a local dnsmasq server on OS X.
#!/bin/bash
sudo port -v install dnsmasq
sudo port -v load dnsmasq
sudo mkdir /etc/resolver
echo -n "nameserver 127.0.0.1" | sudo tee /etc/resolver/dev
echo "address=/dev/127.0.0.1" | sudo tee -a /opt/local/etc/dnsmasq.conf
echo "address=/test/127.0.0.1" | sudo tee -a /opt/local/etc/dnsmasq.conf
sudo kill -9 $(pgrep dnsmasq)
sleep 1
@oko
oko / cleanse.txt
Created December 17, 2014 23:52
USB disk cleansing for WUDT
C:\Windows\system32>diskpart
Microsoft DiskPart version 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 465 GB 1024 KB
@oko
oko / vim-setup.sh
Last active August 29, 2015 14:11
Vim setup script.
#!/bin/sh
# Install Pathogen
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
# Move into Pathogen bundle dir
cd ~/.vim/bundle
## Solarized color scheme
@oko
oko / ip6tables.rules
Last active April 12, 2016 17:15
ip6tables basic ruleset
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [33:2996]
:ICMP - [0:0]
:TCP - [0:0]
:UDP - [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmpv6 -j ICMP
@oko
oko / ip4tables.rules
Last active August 29, 2015 14:11
iptables basic rules
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [332:50026]
:ICMP - [0:0]
:TCP - [0:0]
:UDP - [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -j ICMP
@oko
oko / web_checklist.md
Last active August 29, 2015 14:11
Web server checklist

Domain & Web Server Checklist

Base System

  • Login via SSH keys only
  • apt-get update && apt-get upgrade
  • Create normal user for logins
  • Set up configuration management
  • Ensure IPv6 is up and running
  • Set up iptables rules and boot scripts
@oko
oko / git.pp
Created November 15, 2014 15:40
Quick and dirty Puppet manifest for Git repository cloning.
# Works, but minimally tested. U@YOR.
define git::repo($repo, $location, $autoupdate = false) {
package { 'git':
ensure => installed,
}
# Clone repository if $location/.git doesn't already exist
exec { "clone-$repo":
provider => shell,
command => "/usr/bin/git clone $repo $location",
@oko
oko / ifcfg-example.sh
Last active December 25, 2015 13:59
RHEL static interface configuration template
# /etc/sysconfig/network-scripts/ifcfg-ethX
DEVICE=eth0
HWADDR=MA:CA:DD:RE:SS:YO
TYPE=Ethernet
UUID=<uuid-string-here>
BOOTPROTO=static
ONBOOT=yes
IPADDR=XXX.XXX.XXX.XXX
NETMASK=XXX.XXX.XXX.XXX
DHCPCLASS=