Skip to content

Instantly share code, notes, and snippets.

View troyxmccall's full-sized avatar

Troy McCall troyxmccall

View GitHub Profile

Keybase proof

I hereby claim:

  • I am troyxmccall on github.
  • I am troyxmccall (https://keybase.io/troyxmccall) on keybase.
  • I have a public key ASAmBNBEpbm-jSoE5QWGGIRtFTAR5vHB5mR6AB1wYZ3FRAo

To claim this, I am signing this object:

jQuery('button.dropdown-menu-clickable-item[data-ajax-form-sets-state=deleted]').each(function(_, b) {
b.click();
});
@troyxmccall
troyxmccall / gist:c21b946daa542e254226
Last active February 25, 2016 21:43
centos-vmwarebox-init.sh
find ~/.vagrant.d/boxes/ -type d -name '*.vmx.lck'
~/.vagrant.d/boxes/<some_box>/<version>/<provider>/<bad_guy>.vmx.lck
rm fr ~/.vagrant.d/boxes/<some_box>/<version>/<provider>/<bad_guy>.vmx.lck
vagrant destroy
vagrant up
function keyme () {
if [ -z "$1" -o -z "$2" ]; then
echo "Please provide your email and a name for the key (preferably the server domain) - usage: newkey <email> <keyname>"
return 1
fi
ssh-keygen -t rsa -b 4096 -C "$1" -f "$HOME/.ssh/${2}_rsa"
read -r -p "Would you like to upload this key to a server now? [y/N] " response
response=${response} # tolower
if [[ $response =~ ^(yes|y)$ ]]; then
@troyxmccall
troyxmccall / .bashrc
Last active January 24, 2016 03:16 — forked from vsouza/.bashrc
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@troyxmccall
troyxmccall / gist:ff02778b7d33dea8a852
Created January 23, 2016 00:35 — forked from crazed/gist:7670423
getting a moto x back to stock on mac os x
  1. grab the moto-fastboot version of fastboot here

  2. grab the appropriate stock firmware here (tip: you want the one that matches your android build number in settings -> about phone)

  3. unzip this file somewhere and make it easy to run the moto-fastboot-osx64 command from step 1

  4. get your phone into fastboot mode, google it if needed but just power the phone off, hold the down volume key and power button for 3 seconds then let go, should get you there

  5. verify you are ready for flashing:

     ./moto-fastboot-osx64 devices
     -- should list a device --
    
  6. most of the time you just need to flash system and recovery images, so from your unzipped stock firmware files do this:

@troyxmccall
troyxmccall / openssh-vurlnerability.txt
Last active January 29, 2019 15:11
test client bugs CVE-2016-0777 and CVE-2016-0778
#BAD
$ ssh -v -T git@github.com 2>&1 | grep -E "version|Roaming"
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version libssh-0.7.0
debug1: Roaming not allowed by server # <- PROBLEM HERE
#PATCHED
$ ssh -v -T git@github.com 2>&1 | grep -E "version|Roaming"
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version libssh-0.7.0
$ traceroute google.com
traceroute: Warning: google.com has multiple addresses; using 74.125.138.102
traceroute to google.com (74.125.138.102), 64 hops max, 52 byte packets
1 192.168.1.1 (192.168.1.1) 0.616 ms 0.295 ms 0.214 ms
2 rrcs-96-10-168-93.midsouth.biz.rr.com (96.10.168.93) 2.572 ms 6.678 ms 6.676 ms
3 * * *
4 * * *
5 cpe-174-111-111-025.triad.res.rr.com (174.111.111.25) 121.645 ms 34.990 ms 44.957 ms
6 cpe-024-074-247-002.carolina.res.rr.com (24.74.247.2) 25.483 ms 30.582 ms 25.476 ms
7 24.93.67.204 (24.93.67.204) 32.996 ms 87.418 ms 23.257 ms
#do this inside your vagrant vm
wget https://raw.githubusercontent.com/troyxmccall/vagrant/master/keys/vagrant.pub -O ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
chown -R vagrant:vagrant ~/.ssh
@troyxmccall
troyxmccall / firstmate.sh
Last active September 30, 2015 21:28
El Capitan Fixes/Bugs
# fix homebrew permissions first
sudo chown -R $(whoami):admin /usr/local
# update brew
brew update
# override el capitan's deprecated version of OpenSSL
brew install openssl
brew link openssl --overwrite
#fix ruby
brew uninstall ruby-build rbenv
brew install rbenv ruby-build