Skip to content

Instantly share code, notes, and snippets.

@finnigja
finnigja / nat-wlan-to-eth.sh
Created April 25, 2012 17:06
NAT'ing ethernet to wifi
#!/bin/bash
echo "1" > /proc/sys/net/ipv4/ip_forward
ifconfig eth0 192.168.200.1 netmask 255.255.255.0 up
/etc/init.d/isc-dhcp-server start
iptables --flush
iptables -t nat --flush
iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT
@finnigja
finnigja / dnsdiff.py
Last active July 26, 2022 02:36
Script for comparing DNS lookup results across multiple resolvers
#!/usr/bin/env python
#
# DNS Result Comparison Utility
# Author: https://twitter.com/chair6
#
import argparse
import dns.resolver
import dns.rdatatype
from collections import defaultdict

Keybase proof

I hereby claim:

  • I am chair6 on github.
  • I am chair6 (https://keybase.io/chair6) on keybase.
  • I have a public key ASC-YTR4JhalhIoTl7jV5WBns_yD-IZzZOeAp5LSmgtDNAo

To claim this, I am signing this object:

Create and customize Vagrantfile, for example:
Vagrant.configure("2") do |config|
config.vm.guest = :freebsd
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
config.vm.box = "freebsd/FreeBSD-10.3-RELEASE"
config.ssh.shell = "sh"
config.vm.base_mac = "080027D15C66"
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
>>> for x in [True, False]:
... for y in [True, False]:
... print('{0} or {1} = {2}'.format(x, y, x or y))
...
True or True = True
True or False = True
False or True = True
False or False = False
#!/usr/bin/env python
# https://aws.amazon.com/blogs/security/how-to-prepare-for-aws-move-to-its-own-certificate-authority/
import requests
URLS = [
'https://good.sca1a.amazontrust.com/',
'https://good.sca2a.amazontrust.com/',
'https://good.sca3a.amazontrust.com/',
#!/bin/sh
# https://aws.amazon.com/blogs/security/how-to-prepare-for-aws-move-to-its-own-certificate-authority/
declare -a arr=("https://good.sca1a.amazontrust.com/" "https://good.sca2a.amazontrust.com/" "https://good.sca3a.amazontrust.com/" "https://good.sca4a.amazontrust.com/" "https://good.sca0a.amazontrust.com/" "https://starfieldtech.com/" "https://aws.amazon.com")
for i in "${arr[@]}"
do
printf $i
curl -s -o /dev/null -w "\t%{http_code}\n" $i
@finnigja
finnigja / init.lua
Created November 7, 2018 00:35
Simple window tiling with Hammerspoon
-- http://www.hammerspoon.org/go/
-- basic key shortcuts for window tiling
hs.window.animationDuration = 0
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "M", function()
local win = hs.window.focusedWindow()
local f = win:frame()
local screen = win:screen()
@finnigja
finnigja / get.py
Created November 8, 2018 18:19
Playing with gevent
#!/usr/bin/env python
from gevent import monkey, joinall, spawn
monkey.patch_all()
import requests
import sys
import time
REQUEST_COUNT = int(sys.argv[1:2][0]) or 20
@finnigja
finnigja / [Last Week in AWS] Issue #92- Amazon DocumentDB for Pets.eml
Created January 14, 2019 18:00
[Last Week in AWS] Issue #92- Amazon DocumentDB for Pets.eml
Received: from BN6PR12MB1906.namprd12.prod.outlook.com (2603:10b6:600::20) by
CY4PR12MB1912.namprd12.prod.outlook.com with HTTPS via
CY1PR03CA0010.NAMPRD03.PROD.OUTLOOK.COM; Mon, 14 Jan 2019 15:31:00 +0000
Received: from MWHPR12CA0030.namprd12.prod.outlook.com (2603:10b6:301:2::16)
by BN6PR12MB1906.namprd12.prod.outlook.com (2603:10b6:404:108::12) with
Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.15; Mon, 14 Jan
2019 15:30:57 +0000
Received: from BY2NAM01FT026.eop-nam01.prod.protection.outlook.com
(2a01:111:f400:7e42::203) by MWHPR12CA0030.outlook.office365.com