Skip to content

Instantly share code, notes, and snippets.

View pstengel's full-sized avatar

Paul Stengel pstengel

View GitHub Profile
@pstengel
pstengel / hearthstone-open-packs.ahk
Last active December 8, 2021 04:22
Automatically open many Hearthstone packs with AutoHotkey
; **OUTDATED - See comments.**
; Hearthstone - Open Packs AHK Script (c) by
; (Paul Stengel)[https://github.com/pstengel/]
;
; Hearthstone - Open Packs AHK Script is licensed under a
; Creative Commons Attribution-NonCommercial 4.0 International License.
;
; You should have received a copy of the license along with this
; work. If not, see <http://creativecommons.org/licenses/by-nc/4.0/>.
@pstengel
pstengel / keybase.md
Created April 20, 2016 20:00
Keybase.io Verification

Keybase proof

I hereby claim:

  • I am pstengel on github.
  • I am pstengel (https://keybase.io/pstengel) on keybase.
  • I have a public key whose fingerprint is FA16 D6CE 780A F9A8 8AB9 9AA5 598E FBD5 F281 2112

To claim this, I am signing this object:

#!/usr/local/bin/ruby
require "open-uri"
require "json"
open("http://api.wunderground.com/api/AP_KEY/conditions/bestfct:1/q/pws:KNYSCHEN27.json") do |f|
now = JSON.parse(f.read)["current_observation"]
forecast = now.values_at(*%w(weather temp_f relative_humidity wind_mph feelslike_f))
forecast.map! { |f| f.respond_to?(:downcase) ? f.downcase : f }
@pstengel
pstengel / install-ixgbevf.sh
Last active August 20, 2019 08:01
Install the latest ixgbevf driver for AWS enhanced networking
#!/bin/bash
VERSION="2.16.4"
apt-get update && apt-get install -y dkms
wget "http://sourceforge.net/projects/e1000/files/ixgbevf stable/${VERSION}/ixgbevf-${VERSION}.tar.gz"
tar -C /usr/src -zxvf ixgbevf-${VERSION}.tar.gz
rm -f ixgbevf-${VERSION}.tar.gz
#include <string.h>
#include "fail24.h"
const char VALID_CHARS[] = { '-', '0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
't', 'u', 'v', 'w', 'x', 'y', 'z' };
const uint64_t OFFSET = 14695981039346656037U;
const uint64_t PRIME = 1099511628211U;
@pstengel
pstengel / global.js
Created June 28, 2012 14:33
1PW unminified
else {
E += 1;
E >= D.length && (E = 0, 6E4 > i && (i += 2E3));
var b = "ws://127.0.0.1:" + D[E] + "/2";
F && (F.close(), F = k);
H = K = m;
ka = -1;
try {
(F = new WebSocket(b)) ? (F.onerror = function (b) {
console.error("[AGENT] socket error: " + b + "; readyState=" + this.readyState + ". Perhaps Helper is not running on " + this.url + " or is shutting down?");
@pstengel
pstengel / hallmonitor.c
Created June 27, 2012 13:48
NETLINK proc_exec connector
#include <stdio.h>
#include <sys/socket.h>
#include <linux/netlink.h>
#include <linux/connector.h>
#include <linux/cn_proc.h>
#include <stdlib.h>
#include <errno.h>
struct __attribute__ ((aligned(NLMSG_ALIGNTO))) nlcn_msg {
struct nlmsghdr nl_hdr;
@pstengel
pstengel / yaml2csv.rb
Created January 24, 2012 16:55
Convert a YAML input via STDIN to CSV, stripping property names
#!/usr/bin/env ruby
require 'yaml'
require 'csv'
YAML.load(STDIN).each do |y|
puts y.values.to_csv
end
@pstengel
pstengel / longif.rb
Created January 4, 2012 15:30
Format this nicely plz
if (args[:reseller_filter].empty? && args[:user_filter].empty?) || (args[:reseller_filter].include?(u['owner']) || args[:user_filter].include?(u['user']))
class BFG9000Logger
def logger(options = nil)
@logger ||= Logger.new options
end
end