Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / docker.sh
Created February 19, 2016 14:34
Install Docker Engine on CentOS 7 and configure with docker-storage thin pool
#!/bin/bash
THINPOOL=$1
yum -y install docker-engine
if [ ! -L $THINPOOL ]; then
echo "Pool $THINPOOL" does not appear to exist
exit 1
fi
mkdir -p /etc/systemd/system/docker.service.d
@oko
oko / php-5.4.45-ini.diff
Last active February 20, 2016 00:13
PHP 5.4.45 prod/dev INI diff
86c86
< ; This is php.ini-development INI file.
---
> ; This is php.ini-production INI file.
452c452
< error_reporting = E_ALL
---
> error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
469c469
< display_errors = On
@oko
oko / etc-httpd-conf.d-pulp.conf
Created July 3, 2016 16:38
Pulp LDAP setup with FreeIPA
<Files webservices.wsgi>
# pass everything that isn't a Basic auth request through to Pulp
SetEnvIfNoCase ^Authorization$ "Basic.*" USE_APACHE_AUTH=1
Order allow,deny
Allow from env=!USE_APACHE_AUTH
Satisfy Any
AuthType Basic
AuthBasicProvider ldap
AuthName "Pulp Login"
@oko
oko / gist:1797aec07957c07275db65ae957c2fea
Created December 14, 2016 21:14
CentOS 7 GRUB Kernel Change
grep '^menuentry' /boot/grub2/grub.cfg
vi /etc/default/grub
# update GRUB_DEFAULT=<zero-indexed-menu-entry-from-grep>
grub2-mkconfig -o /boot/grub2/grub.cfg
@oko
oko / zone-check.sh
Created February 11, 2018 20:02
crappy zone checker to verify DNS records are transferred correctly
#!/bin/bash
set -eu
if [[ ! -z "${DEBUG:-""}" ]]; then set -x; fi
ZONE="$1"
NEW="$2"
DIG="dig +short $ZONE"
DIGN="$DIG $NEW"
check_rrtype() {
Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" | % { Get-ItemProperty $_.PSPath -Name DisplayName | Select -Property DisplayName } | Sort-Object -Property DisplayName | ConvertTo-Json