Skip to content

Instantly share code, notes, and snippets.

View benizi's full-sized avatar

Benjamin R. Haskell benizi

View GitHub Profile
@benizi
benizi / sendRawEth.c
Last active June 3, 2017 17:30 — forked from twaldecker/sendRawEth.c
Send a raw Ethernet frame in Linux
/*
* Added the command line arguments for interface and MAC Address
*
* Based on raw Ethernet from austinmarton: https://gist.github.com/1922600
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
@benizi
benizi / web-servers.md
Created February 15, 2016 05:50 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000

This document aims to help aggregate issues and solutions around the defaultContainer deprecation.

The Error Message:

Using the defaultContainer is no longer supported. [defaultContainer#lookup]

Where's my defaultContainer?

Well it is still there, and will continue to work for some time. Likely it will be gone by 1.0.0 final

@benizi
benizi / promises.md
Last active August 29, 2015 14:06 — forked from domenic/promises.md

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
(ns ga-exp.core
(:import
(com.google.api.client.googleapis.auth.oauth2 GoogleCredential$Builder)
(com.google.api.client.googleapis.javanet GoogleNetHttpTransport)
(com.google.api.client.json.jackson2 JacksonFactory)
(com.google.api.services.analytics Analytics$Builder AnalyticsScopes)))
(def HTTP_TRANSPORT (GoogleNetHttpTransport/newTrustedTransport))
(def JSON_FACTORY (JacksonFactory.))
#!/bin/bash
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
# Directory where everything happens
DIR=~/work/virt-install
# The image downloaded from the http://fedoraproject.org/en/get-fedora#clouds site
@benizi
benizi / iam_fog.rb
Created December 6, 2013 06:44 — forked from mndoci/iam_fog.rb
# via http://blog.zerosum.org/2011/03/02/better-aws-access-control-with-iam-and-fog.html
require 'fog'
username = 'testuser'
bucket = 'uniquebucketname1234'
aws_credentials = {
:aws_access_key_id => 'YOUR-ACCESS-KEY-ID',
:aws_secret_access_key => 'YOUR-SECRET-ACCESS-KEY'
@benizi
benizi / Email
Created December 19, 2012 04:13 — forked from anonymous/Email
Next month, I'd like to finally kick off OpenHack Pittsburgh. OpenHack is an
initiative started by the Western NY Ruby Users Group to create a regularly
meeting, globally branded hacking event. The exact structure of OpenHack varies
by city, but the basic purpose is coding together. You can learn more at the
website - http://openhack.github.com/
You're receiving this email because you have either expressed interest in
OpenHack or have a hand in organizing a technology user group in Pittsburgh.
This is a polyglot event, and I want to be sure each user group is represented
and that the scheduling for OpenHack doesn't conflict with other events. If
@benizi
benizi / simpler
Created November 30, 2012 05:26 — forked from justinabrahms/colortest.py
Show how different terminals show bold colors
#!/bin/sh
# Print four lines showing blocks of colors: 0-7 | 0-7bold | 8-15 | 8-15bold
perl -CADS -lwe '
my $block = shift || (chr(0x2588) x 3);
for (["", 0], ["1;", 0], ["", 8], ["1;", 8]) {
my ($bold, $offset) = @$_;
my @range = map $offset + $_, 0..7;
printf "%s %-6s ", $bold ? "bold" : "norm", "$range[0]-$range[-1]";
print map("\e[${bold}38;5;${_}m$block", @range), "\e[0m"
}
@benizi
benizi / gist:1215848
Created September 14, 2011 04:22 — forked from mattn/gist:1215667
diff -r 1d5e7413d728 src/Make_ming.mak
--- a/src/Make_ming.mak Thu Sep 08 23:24:14 2011 +0200
+++ b/src/Make_ming.mak Wed Sep 14 10:47:48 2011 +0900
@@ -110,6 +110,14 @@
PERLLIBS=$(PERLLIB)/Core
endif
+XSUBPP=$(PERLLIB)/ExtUtils/xsubpp
+XSUBPP_EXISTS=$(shell perl -e "print 1 unless -e '$(XSUBPP)'")
+ifeq "$(XSUBPP_EXISTS)" ""