Skip to content

Instantly share code, notes, and snippets.

package main
import (
"flag"
"fmt"
"math"
"os"
"path"
"sort"
"strconv"
function keyboard
if [ $argv[1] = "disable" ]
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
else
sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/
end
end
@dallasmarlow
dallasmarlow / ec2_cpu_util_report.go
Last active November 21, 2017 17:18
ec2 cpu utilization report
package main
import (
"flag"
"fmt"
"math"
"os"
"path"
"sort"
"strconv"
@dallasmarlow
dallasmarlow / eth_summary.rb
Created November 19, 2017 20:09
etherscan sender summary
require 'json'
# data src:
# https://etherscan.io/exportData?type=address&a=<addr>
abort 'usage: ./eth_summary.rb <from addr> <csv filename>' unless ARVG.size == 2
address = ARGV.first
filename = ARGV.last
def process(input)
from datetime import datetime
import os, os.path
import json
def checkpoint_path(input_file):
return '{}.checkpoint'.format(
os.path.basename(
input_file))
def load_checkpoint(checkpoint_file):

Keybase proof

I hereby claim:

  • I am dallasmarlow on github.
  • I am dallasmarlow (https://keybase.io/dallasmarlow) on keybase.
  • I have a public key whose fingerprint is 5A70 8865 409A BE1C EC42 7DC3 021B 58E4 A0CF A1B8

To claim this, I am signing this object:

@dallasmarlow
dallasmarlow / usage_report_summary.rb
Created June 22, 2016 17:52
aws usage report summary
require 'json'
entries = File.read(ARGV.first).lines.map(&:chomp).reject {|l| l.empty?}
keys = entries.shift.split(',').map(&:strip)
usage_totals = entries.reduce({}) do |vals, e|
cols = Hash[keys.zip(e.split(','))]
vals[cols['Resource']] ||= 0
vals[cols['Resource']] += cols['UsageValue'].to_i
vals
id=$(head /dev/random | md5)
echo "${id:0:10}"
require 'elasticsearch'
es = Elasticsearch::Client.new host: 'http://xx.xx.xx.xxx'
es.indices.get_aliases.keys.each do |idx|
if ['asp', 'html', 'perl', 'php', 'pl', 'cgi'].include?(idx.split('.').last)
es.indices.delete index: idx
end
end
import hashlib
challenge = 'xxx'
secret = 'xxx' + "\n"
print hashlib.sha256(challenge + "\n" + secret + challenge + "\n").hexdigest()