Skip to content

Instantly share code, notes, and snippets.

👨‍🎤
whats a github status?

Donald Hutchison rkachowski

👨‍🎤
whats a github status?
View GitHub Profile
@rkachowski
rkachowski / downloader.rb
Created Jan 25, 2020
download all ya wistia videos concurrently
View downloader.rb
require 'faraday'
@max_threads = 8
@download_mutex = Mutex.new
ROOT_URL = "https://embedwistia-a.akamaihd.net"
def download urls, folder
threads = Array.new(@max_threads)
@rkachowski
rkachowski / nginx-docker.service
Created Mar 21, 2018
example systemd unit for docker container
View nginx-docker.service
[Unit]
Description=Nginx webserver
Requires=docker.service
[Service]
ExecStartPre=/bin/sleep 1
ExecStartPre=/usr/bin/docker pull nginx:alpine
ExecStart=/usr/bin/docker run --name nginx -v /mnt/vdb/nginx/config/conf.d:/etc/nginx/conf.d:ro -v /mnt/vdb/nginx/config/conf:/etc/nginx/conf:ro -v /mnt/vdb/nginx/certs:/tls -v /mnt/vdb/nginx/static:/static -p 443:443 -p 80:80 nginx:alpine
ExecStop=/usr/bin/docker stop nginx
ExecStopPost=/usr/bin/docker rm -f nginx
View payload_enum_win_transfer_software
for %i in (ruby python ftp debug wscript cscript powershell javac) do where %i
@rkachowski
rkachowski / maplr.rb
Created Jan 23, 2017
create google map links from exif data in jpg files
View maplr.rb
#!/usr/bin/env ruby
def run
dir = ARGV[0] || Dir.pwd
Dir[File.join(dir,'*.jpg')].each do |file|
gps = gps_for_file file
if gps
puts "#### #{File.basename file} -> http://www.google.com/maps/place/#{gps[0]},-#{gps[1]}"
@rkachowski
rkachowski / .gitconfig
Created Apr 13, 2016
the almighty .gitconfig
View .gitconfig
[alias]
s = status
cma = commit -am
cm = commit -m
cont = rebase --continue
dumbass = commit --amend
forget = update-index --assume-unchanged
unforget = update-index --no-assume-unchanged
root = rev-parse --show-toplevel
lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"
@rkachowski
rkachowski / toasty_mofo.s
Created Feb 29, 2016
a gb rom to show an image
View toasty_mofo.s
; Hello Sprite No Interrupts1.0
; February 19, 2007
; John Harrison
; using sprites without interrupts
; Look at this sprite example first, then look at the example with interrupts
; An extension of Hello World, based mostly from GALP
INCLUDE "gbhw.inc" ; standard hardware definitions from devrs.com
INCLUDE "ibmpc1.inc" ; ASCII character set from devrs.com
@rkachowski
rkachowski / Gemfile
Last active Nov 12, 2015
upd - micropingdom
View Gemfile
gem "pony"
@rkachowski
rkachowski / marathon_photos.js
Created Oct 3, 2015
jquery script to grab all the large preview photos from http://marathonfoto.com/
View marathon_photos.js
var images = $('img[src$=".jpg"]');
var frame_ids = $.map(images, function(el, index){ return $(el).attr("frameid")});
var urls = $.map(frame_ids, function(el, index){ return "/Ajax/Zoom/?frameid=" + el});
var responses = [];
$.each(urls, function(index, el){ resp = $.get(el, null, function(data){responses.push(data)}) });
function getImagesUrlsFromServerResponses(responses)
{
@rkachowski
rkachowski / Cheatsheet.md
Last active Jun 11, 2019
things i keep forgetting
View Cheatsheet.md

ruby

Get match data for each regex occurance in string

  • "string to check".to_enum(:scan, /\s/).map { Regexp.last_match }

bash

generate hex chars

  • for i in $(seq 1 255); do echo -n $(printf '\\x%02x' $i); done
You can’t perform that action at this time.