Skip to content

Instantly share code, notes, and snippets.

View mwatts272's full-sized avatar

Matthew Watts mwatts272

View GitHub Profile
@mwatts272
mwatts272 / install-bash
Created November 2, 2013 00:23
Upgrading the rather risqué bash on Mac OS X. Please Note: Homebrew installs things to /usr/local/Cellar/, then symlinks any binaries to /usr/local/bin, so you've now got the latest bash sitting at /usr/local/bin/bash, just so you know.
# Install Homebrew.
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
# Update Homebrew's formulae.
brew update
# Install GIT using homebrew
brew install git
# Install bash
@mwatts272
mwatts272 / obtainIPFromHost
Created October 10, 2013 16:30
Obtain the IP Address from a domain name.
host mwatts.it | head -1 | awk '{print $4}'
@mwatts272
mwatts272 / stringSearch
Created October 10, 2013 16:17
Search (grep) for a specified string in all files within the given directory. Highlights all matches in colour.
grep --color -R "search term" /target/dir/
@mwatts272
mwatts272 / readStoreRemoteFile
Created October 10, 2013 15:58
Obtain and output (stdout) via the ssh daemon (sshd) the contents of the desired file - not explicitly a log file.
ssh username@hostname "tail -f /var/www/fbi.gov/logs/classifiedAccess.log" | tee /loacl/storage/path
@mwatts272
mwatts272 / certDebug.sh
Created October 10, 2013 15:44
TLS Cert debugging with open ssl
openssl s_client -connect mwatts.it:443 -prexit
@mwatts272
mwatts272 / GnuPG
Last active December 22, 2015 16:09
A collection of the most commonly used GnuPG Commands.
###########################
##### Generating Keys #####
###########################
## Generate a key. Follow the options and your good to go. Just make sure your on your Jack Jones!
gpg --gen-key
###############################
##### Importing your keys #####
###############################
@mwatts272
mwatts272 / sublime-dev
Created August 27, 2013 18:55
Install Sublime Dev
apt-get install python-software-properties
add-apt-repository ppa:webupd8team/sublime-text-2
apt-get update
apt-get install sublime-text-dev
## Check https://mwatts.it/articles/stallingUnix.txt for description
mkdir reverberate && cd reverberate
source /home/mwatts/resonate
% source resonate
@mwatts272
mwatts272 / scapy-traceroute.py
Last active December 20, 2015 20:49
A sharp trace-route tool built with scapy for testing the routes of multiple domains.
#! /usr/bin/env python
# Set log level to benefit from Scapy warnings
import logging
logging.getLogger("scapy").setLevel(1)
from scapy.all import *
if __name__ == "__main__":
hosts = raw_input('Hostnames you would like to traceroute sepearated by a comma: ')
@mwatts272
mwatts272 / getUserGeographicDataFromIP.py
Last active December 17, 2015 18:59
An easy means of getting a Users Geographic Data based from their Internet Protocol Address. Please Note: Please only use your public IP Address, and not your routers self assigned IP Address.
#!/usr/bin/env python
"""
Retrieves Geographic Information (Location) of a specified IP Address
"""
import urllib
ipAddress = '50.57.97.17'
response = urllib.urlopen('http://www.geoplugin.net/json.gp?ip={0}' .format(ipAddress)).read()