Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bsiegel
bsiegel / app.js
Created November 22, 2011 16:06
IsTFSOK
var http = require('http');
var url = require('url');
var exec = require('child_process').exec;
var init = 'C:\\cygwin\\bin\\wget.exe --cookies=on --keep-session-cookies --save-cookies="C:\\Users\\bsiegel\\Documents\\My Web Sites\\istfsok\\cookie.txt" -qO- http://nagiosxi/nagiosxi'
var cmd = 'C:\\cygwin\\bin\\wget.exe --referer=http://nagiosxi/nagiosxi/index.php --cookies=on --load-cookies="C:\\Users\\bsiegel\\Documents\\My Web Sites\\istfsok\\cookie.txt" --keep-session-cookies -qO- "http://nagiosxi/nagiosxi/includes/components/xicore/status.php?show=hostdetail&host=TFS%20Server%20-%20AtNet"'
http.createServer(function (req, res) {
var url_parts = url.parse(req.url);
if (url_parts.pathname == '/') {
@bsiegel
bsiegel / dvm.sh
Created October 8, 2012 22:41
CM10 x86 Patches
#!/system/bin/sh
#
# Copyright (C) 2011 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
(ns fizzbuzz.core)
(declare fb)
(defn -main []
(doseq [i (range 1 101)]
(println (fb i))))
(defmulti fb (fn [i] [(= 0 (mod i 3)) (= 0 (mod i 5))]))
(defmethod fb [true true] [_] "FizzBuzz")
(ns roman.core)
(declare roman)
(defn -main [& args]
(if (= (count args) 1)
(let [arabic (read-string (first args))]
(if (number? arabic)
(println (roman arabic ""))
(println "Must enter a number")))
Rails.application.eager_load!
associations = {}
ActiveRecord::Base.descendants.each do |model|
next unless model.reflections.present?
model.reflections.keys.each do |r|
assoc = r.to_s.pluralize
next unless assoc.present?
if associations[assoc].present?
associations[assoc] << model.to_s

Keybase proof

I hereby claim:

  • I am bsiegel on github.
  • I am bsiegel (https://keybase.io/bsiegel) on keybase.
  • I have a public key whose fingerprint is 1BE4 CB1B 0C04 2A2F 7C1C 9C31 45DB FA2B 3D6E 8B65

To claim this, I am signing this object:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib, json, re, os, subprocess, sys, getopt
REGION=0; RELEASE=1; ARCH=3; TYPE=4; URL=6
TABLE_URL = "https://cloud-images.ubuntu.com/locator/ec2/releasesTable"
def usage():
print 'Usage: find_ami.py [options]'
print ''
2017/04/03 12:52:50 [INFO] Terraform version: 0.9.2
2017/04/03 12:52:50 [INFO] Go runtime version: go1.8
2017/04/03 12:52:50 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.9.2/bin/terraform", "plan"}
2017/04/03 12:52:50 [DEBUG] Detected home directory from env var: /Users/brandon
2017/04/03 12:52:50 [DEBUG] Detected home directory from env var: /Users/brandon
2017/04/03 12:52:50 [DEBUG] Attempting to open CLI config file: /Users/brandon/.terraformrc
2017/04/03 12:52:50 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/04/03 12:52:50 [DEBUG] Detected home directory from env var: /Users/brandon
2017/04/03 12:52:50 [INFO] CLI command args: []string{"plan"}
2017/04/03 12:52:50 [DEBUG] command: loading backend config file: /Users/brandon/Desktop/example
@bsiegel
bsiegel / meraki_strongswan_notes.md
Last active December 21, 2018 11:40 — forked from psanford/meraki_strongswan_notes.md
connect to meraki client vpn from strongswan (ubuntu 16.04 edition)

These are my notes for connecting to a meraki client vpn from ubuntu 16.04. This configuration assumes you are using a psk for the ipsec auth.

Install the following packages:

apt-get install -y strongswan xl2tpd

Configure strong swan

<!DOCTYPE html>
<html>
<head>
<title>Azure-sdk-for-python Dependency Report</title>
<meta charset="UTF-8"/>
<style>
body {
font-family: Verdana, sans-serif;
font-size: 14px;
text-size-adjust: none;