Skip to content

Instantly share code, notes, and snippets.

View thomasv314's full-sized avatar

Thomas Vendetta thomasv314

View GitHub Profile
@thomasv314
thomasv314 / block-tor.sh
Created March 21, 2013 16:17
script that adapts mikhailian's implementation of blocking tor nodes... http://mikhailian.livejournal.com/48051.html
#! /bin/bash
# script to block tor nodes
# original credit for this goes to mikhailian: http://mikhailian.livejournal.com/48051.html
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
if [ "${1}" == "" ]; then
@thomasv314
thomasv314 / common-mime-types.json
Created April 19, 2013 17:32
List of common #MIME types found on the internet pretty printed in #JSON.
{
".3dm": "x-world/x-3dmf",
".3dmf": "x-world/x-3dmf",
".a": "application/octet-stream",
".aab": "application/x-authorware-bin",
".aam": "application/x-authorware-map",
".aas": "application/x-authorware-seg",
".abc": "text/vnd.abc",
".acgi": "text/html",
".afl": "video/animaflex",
@DavidWittman
DavidWittman / hipchat-relay.go
Last active May 10, 2016 14:37
Room-to-room message relay for Hipchat, with support across accounts.
package main
import (
"flag"
"fmt"
"github.com/andybons/hipchat"
"log"
"os"
"path"
"strings"
@joho
joho / staff_development.md
Created April 20, 2016 05:38
Follow on resources from a work talk I gave related to developing staff.
@mttdffy
mttdffy / unvalidate.rb
Last active November 17, 2017 19:59
RoR/Mongoid module for removing validations from a model
module Mongoid
module Unvalidate
extend ActiveSupport::Concern
module ClassMethods
# Removes specified validations from existing models for a given field
#
# @param [Symbol] field the field to remove validations from
# @param [Array<Symbol> | Symbol] validations validations to remove from field
@dennisfaust
dennisfaust / sidekiq_unique_jobs_hash_compactor.rb
Created July 12, 2017 20:46
sidekiq-unique-jobs gem not deleting expired keys in its uniquejobs hash
# https://github.com/mhenrixon/sidekiq-unique-jobs/issues/161
# Even worse: https://github.com/mhenrixon/sidekiq-unique-jobs/issues/234
class SidekiqUniqueJobsHashCompactor
include Sidekiq::Worker
sidekiq_options queue: "slow"
def perform
# Skip if there are jobs queued...
return unless Sidekiq::Queue.all.select { |q| q.size > 100 }.blank?
@chanj
chanj / AWS Security Resources
Last active June 21, 2021 09:49
AWS Security Resources
INTRO
I get asked regularly for good resources on AWS security. This gist collects some of these resources (docs, blogs, talks, open source tools, etc.). Feel free to suggest and contribute.
Short Link: http://tiny.cc/awssecurity
Official AWS Security Resources
* Security Blog - http://blogs.aws.amazon.com/security/
* Security Advisories - http://aws.amazon.com/security/security-bulletins/
* Security Whitepaper (AWS Security Processes/Practices) - http://media.amazonwebservices.com/pdf/AWS_Security_Whitepaper.pdf
* Security Best Practices Whitepaper - http://media.amazonwebservices.com/AWS_Security_Best_Practices.pdf
@mlgill
mlgill / tmuxp.sh
Last active June 22, 2022 09:43
Execute parallel processes in arbitrary number of tmux panes
#!/bin/bash
# The "tmuxifier"
# Execute parallel processes in an arbitrary number of tmux panes
# This script requires the path to an existing script to
# execute in parallel. Optionally, the number of threads to
# and the name of the tmux session can be input. If threads
# and session name are not entered, threads are determined
# automatically and session names is set to a default.
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@stevenringo
stevenringo / reinvent-2017-youtube.md
Created December 3, 2017 23:01
Links to YouTube recordings of AWS re:Invent 2017 sessions

| Title | Description