Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / 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 / docker-setup.sh
Created October 5, 2015 21:38
Fedora 22 Docker setup
#!/bin/bash
dnf -y install docker
groupadd -r docker
usermod -a -G docker $(id -un)
systemctl enable docker
systemctl start docker
echo "Please log off and log back in again to apply group changes..."
exit 0
@oko
oko / mail-server-notes.md
Last active December 17, 2015 11:59
Notes on mail server configuration.

WORK IN PROGRESS

Mail Server Configuration with Virtual Domains

Security Basics

  • Use SSL. You're passing credentials and private communications over the wire, so you'd better encrypt it.
  • Don't be an open relay. Forwarding spammers' mail is a good way to get your IP blacklisted and receive some nastygrams from other webmasters
  • chroot if possible.
@oko
oko / apache-nginx-uwsgi-proxy-config.md
Created October 9, 2013 16:51
Apache-to-Nginx-to-uWSGI proxy configuration with path prefix

Apache

<LocationMatch "/theproxypath">
  ProxyPass http://[hostname]:[port]/theproxypath
  ProxyPassReverse http://[hostname]:[port]/theproxypath
</LocationMatch>

Nginx

server {
    listen       [port] default_server;

server_name [origin-hostname];