Skip to content

Instantly share code, notes, and snippets.

View bonkydog's full-sized avatar

Brian Jenkins bonkydog

  • Nubank
  • SF Bay Area
View GitHub Profile
@bonkydog
bonkydog / list-instances.sh
Created May 19, 2020 14:56
List AWS EC2 Instances' public DNS name and name tag
aws ec2 describe-instances --query "Reservations[*].Instances[*].[PublicDnsName, (Tags[?Key=='Name'].Value)[0]]" --output=text --no-paginate
@bonkydog
bonkydog / starship-names.txt
Last active April 18, 2024 21:01
Spaceship Names
Fantasy Heartbreaker
Vague Aggregate
I’d Ship It
Vargr
Hanzo Main
Horny on Main
Dump Stat
Trap Street
Event Horizon
Cherenkov Blue
# what services are being offered by this machine?
netstat -lantp | grep LISTEN
# who is connecting to this machine?
netstat -alntp | awk '{ print $5 }' | grep -v ^127.0.0.1 | cut -d ':' -f 1 | sort -n | uniq
@bonkydog
bonkydog / slack_logs.rb
Last active June 11, 2018 21:50 — forked from 0x263b/slack_logs.rb
Obtain channel logs from Slack's API
#!/usr/bin/env ruby
# encoding: utf-8
# Uses the following Slack API methods:
# user.list → https://api.slack.com/methods/users.list
# channels.history → https://api.slack.com/methods/channels.history
require "open-uri"
require "json"
# Obtain a token

Keybase proof

I hereby claim:

  • I am bonkydog on github.
  • I am bonkydog (https://keybase.io/bonkydog) on keybase.
  • I have a public key ASCx0KcEFDWyZmRPU8eBhICdzc48LQZQmbWxNOjhsbtmtQo

To claim this, I am signing this object:

@bonkydog
bonkydog / silent-mp3.bash
Created January 15, 2018 20:54
Generate 10 second silent mp3
# -t is length in seconds.
ffmpeg -f lavfi -i anullsrc=r=44100:cl=mono -t 10 -q:a 9 -acodec libmp3lame ten-seconds-of-silence.mp3
@bonkydog
bonkydog / apocalypse-names.txt
Last active April 3, 2024 23:56
Apocalypse World Names
Lord Meg
Dodger
Dodgem
Husk
Husker
Dusk
Drain
Clamp
Beetle
Bell
@bonkydog
bonkydog / datomic_history.clj
Created April 19, 2017 15:35
Query the history of a datomic entity.
(d/q
'[:find ?e ?a ?v ?tx ?added
:in $ ?e
:where
[?e ?a ?v ?tx ?added]]
(datomic.api/history db)
123123)
@bonkydog
bonkydog / db.rake
Last active December 27, 2017 11:38
Fix 'ERROR: must be owner of extension plpgsql' complaints from Postgresql when dumping and reloading structure.sql
# Put this in your Rails app's lib/tasks directory
namespace :db do
desc "Fix 'ERROR: must be owner of extension plpgsql' complaints from Postgresql"
task :fix_psql_dump do |task|
filename = ENV['DB_STRUCTURE'] || File.join(ActiveRecord::Tasks::DatabaseTasks.db_dir, "structure.sql")
sql = File.read(filename)
sql.sub!(/(CREATE EXTENSION IF NOT EXISTS plpgsql)/, '-- \1')
sql.sub!(/(COMMENT ON EXTENSION plpgsql)/, '-- \1')
File.open(filename, 'w') do |f|
f.write(sql)
@bonkydog
bonkydog / delay_dock.bash
Created August 6, 2015 22:21
set OSX dock autohide / show delay
defaults write com.apple.Dock autohide-delay -float 10.0 && killall Dock