Skip to content

Instantly share code, notes, and snippets.

View michenriksen's full-sized avatar

Michael Henriksen michenriksen

View GitHub Profile
#!/usr/bin/sudo sh
## ruby_revealer.sh -- decrypt obfuscated GHE .rb files. 2.0.0 to 2.3.1+.
## From `strings ruby_concealer.so`:
##
## > This obfuscation is intended to discourage GitHub Enterprise customers
## > from making modifications to the VM.
##
## Well, good, as long as its not intended to discourage *me* from doing this!
@sfan5
sfan5 / image2xterm.py
Last active July 13, 2020 18:24
Converts images into color sequences (xterm-256color)
#!/usr/bin/env python3
import sys
import getopt
from PIL import Image
xterm256colors = [ # http://pln.jonas.me/xterm-colors
(0, (0x00, 0x00, 0x00)), # SYSTEM
(1, (0x80, 0x00, 0x00)), # SYSTEM
(2, (0x00, 0x80, 0x00)), # SYSTEM
(3, (0x80, 0x80, 0x00)), # SYSTEM
@pallih
pallih / gist:8434784
Created January 15, 2014 11:42
Bash function to randomize MAC address and hostname on OS X. Could live in ~/.bash_profile
function mask(){
# Changes MAC address to a random one and sets the hostname to a random word
# Tested on OS X 10.9 (Macbook Pro)
# Based on http://blog.kejsarmakten.se/all/software/2013/08/30/spoof-mac-on-osx.html
# and http://osxdaily.com/2010/09/06/change-your-mac-hostname-via-terminal/
# Note: neither are permanent (a reboot resets both)
# For a permanent change to hostname: sudo scutil –-set HostName NEWHOST
# Consider using SpoofMAC: https://github.com/feross/SpoofMAC
NEWMAC=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
echo "Changing MAC " $(ifconfig en0 | grep ether)
@holman
holman / SAFE-RUBY.rb
Created February 16, 2011 05:38
This shows some of my favorite ways to ensure robust, high-security Ruby Applications.
require 'net/https'
module SecurityModule
class HighSecurity
class ReallyHighSecurity
def self.turn_on_safe_connections
OpenSSL::SSL::VERIFY_NONE
end
end
end