Skip to content

Instantly share code, notes, and snippets.

# 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

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:

@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 ¬
@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 / deaddrop.js
Created October 8, 2013 16:33
symmetric encrypt
function symmetricEncrypt(){
if (window.crypto.getRandomValues) {
require("/js/openpgp.min.js");
openpgp.init();
var key = openpgp_crypto_generateSessionKey(9);
$("#pubkey").append(key);
$("#pubkey").append("<br><Br>");
var crypt = openpgp_crypto_symmetricEncrypt(openpgp_crypto_getPrefixRandom(9), 9,key , $('#message').val(), false);
$("#pubkey").append(crypt);
} else {
@BillKeenan
BillKeenan / gist:6868425
Created October 7, 2013 13:55
Lambretta Links
Here is the list of lambretta links from the LCUSA site, but now I (For the most part) set them up by category.
You can continue to add links by replying to this message, and I will edit this posting and add them to the categories as needed.
Some of the links may now be broken.
@BillKeenan
BillKeenan / md - Links - Auto-link web search.workflow
Created July 18, 2013 20:36
updated for duckduckgo as of 2013.07.18
@BillKeenan
BillKeenan / gist:5435753
Last active December 16, 2015 12:39
Saving an x509 to a database
[TestMethod]
public void TestCertificate()
{
const string publicCert = @"MIIBrzCCARigAwIBAgIQEkeKoXKDFEuzql5XQnkY9zANBgkqhkiG9w0BAQUFADAYMRYwFAYDVQQDEw1DZXJ0QXV0aG9yaXR5MB4XDTEzMDQxOTIwMDAwOFoXDTM5MTIzMTIzNTk1OVowFjEUMBIGA1UEAxMLc2VydmVyMS5jb20wgZ0wDQYJKoZIhvcNAQEBBQADgYsAMIGHAoGBAIEmC1/io4RNMPCpYanPakMYZGboMCrN6kqoIuSI1n0ufzCbwRkpUjJplsvRH9ijIHMKw8UVs0i0Ihn9EnTCxHgM7icB69u9EaikVBtfSGl4qUy5c5TZfbN0P3MmBq4YXo/vXvCDDVklsMFem57COAaVvAhv+oGv5oiqEJMXt+j3AgERMA0GCSqGSIb3DQEBBQUAA4GBAICWZ9/2zkiC1uAend3s2w0pGQSz4RQeh9+WiT4n3HMwBGjDUxAx73fhaKADMZTHuHT6+6Q4agnTnoSaU+Fet1syVVxjLeDHOb0i7o/IDUWoEvYATi8gCtcV20KxsQVLEc5jkkajzUc0eyg050KZaLzV+EkCKBafNoVFHoMCbm3n";
const string privateCert = @"<RSAKeyValue><Modulus>gSYLX+KjhE0w8Klhqc9qQxhkZugwKs3qSqgi5IjWfS5/MJvBGSlSMmmWy9Ef2KMgcwrDxRWzSLQiGf0SdMLEeAzuJwHr270RqKRUG19IaXipTLlzlNl9s3Q/cyYGrhhej+9e8IMNWSWwwV6bnsI4BpW8CG/6ga/miKoQkxe36Pc=</Modulus><Exponent>EQ==</Exponent><P>mmRPs28vh0mOsnQOder5fsxKsuGhBkz+mApKTNQZkkn7Ak3CW
@BillKeenan
BillKeenan / gist:5216861
Created March 21, 2013 21:18
applescript to get weather for toronto
set weather to "curl " & quote & "http://weather.yahooapis.com/forecastrss?p=CAXX0504&u=c" & quote
set postWeather to "grep -E '(Current Conditions:|C<BR)'"
set forecast to do shell script weather & " | " & postWeather
(characters 1 through -7 of paragraph 2 of forecast) as string
public static class RavenStore
{
private static readonly ConcurrentDictionary<string, DocumentStore> _Instance;
private static readonly object Padlock = new object();
static RavenStore()
{
_Instance = new ConcurrentDictionary<string, DocumentStore>();
}