Skip to content

Instantly share code, notes, and snippets.

@BillKeenan
BillKeenan / gist:8717417
Created January 30, 2014 19:52
iptable lockdown
# Generated by iptables-save v1.4.12 on Thu Jan 30 18:36:16 2014
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [7385395:3804992500]
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
@BillKeenan
BillKeenan / google.txt
Created March 6, 2014 20:45
Google Shortener for TextExpander
--- This will take a url on your clipboard, and use google to shorten it
--- create a new text expander item, set to applescript and paste this in.
set the ClipURL to (the clipboard as string)
ignoring case
if ((characters 1 through 4 of ClipURL as string) is not "http") then
return "Malformed URL."
else
set curlCMD to ¬

Keybase proof

I hereby claim:

  • I am BillKeenan on github.
  • I am billkeenan (https://keybase.io/billkeenan) on keybase.
  • I have a public key whose fingerprint is 759C 5C36 9A09 2AA7 4752 9D58 6B65 F7B7 2043 E3B7

To claim this, I am signing this object:

# Store data in /usr/local/var/mongodb instead of the default /data/db
dbpath = /usr/local/var/mongodb
# Append logs to /usr/local/var/log/mongodb/mongo.log
logpath = /usr/local/var/log/mongodb/mongo.log
logappend = true
auth=true
# Only accept local connections
from Crypto.Cipher import AES
from Crypto import Random
import hashlib
import os
import math
import sys
import binascii
import string
; <<>> DiG 9.8.3-P1 <<>> gentoo.de +trace
;; global options: +cmd
. 84599 IN NS g.root-servers.net.
. 84599 IN NS f.root-servers.net.
. 84599 IN NS j.root-servers.net.
. 84599 IN NS b.root-servers.net.
. 84599 IN NS i.root-servers.net.
. 84599 IN NS k.root-servers.net.
. 84599 IN NS a.root-servers.net.
. 84599 IN NS e.root-servers.net.
<?php
$notavector =['one','two','three'];
print_r($notavector);
unset($notavector[1]);
//missing a key!
print_r($notavector);
<?php
$string = <<<XML
<?xml version="1.0"?>
<string xmlns="http://www.barefoot.com/Services/">
<PropertyList>
<Property>
<PropertyID>7081</PropertyID>
</Property>
<Property>
@BillKeenan
BillKeenan / gist:6a2cb1567a43aba72e3c
Last active August 29, 2015 14:08
cottages for james
<?php
/**
* Created by PhpStorm.
* User: bill
* Date: 14-11-06
* Time: 2:21 PM
*/
error_reporting(E_ALL);
//utiltiy class for making the actual calls.
db.%filltext:name=db Type%.findOne({_id:ObjectId('%clipboard')})