Skip to content

Instantly share code, notes, and snippets.

View michaelkeevildown's full-sized avatar

Michael Down michaelkeevildown

View GitHub Profile
@michaelkeevildown
michaelkeevildown / ip.py
Created June 9, 2016 12:50
IP to BigInt
def ip_to_bigint(ip):
ip_parts = ip.split('.')
part_1 = int(ip_parts[0]) * 16777216
part_2 = int(ip_parts[1]) * 65536
part_3 = int(ip_parts[2]) * 256
part_4 = int(ip_parts[3])
bigint_ip = part_1 + part_2 + part_3 + part_4
@michaelkeevildown
michaelkeevildown / .gitignore
Created June 13, 2016 10:12
OSX .gitignore
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
@michaelkeevildown
michaelkeevildown / stop-itunes.sh
Created June 13, 2016 17:41
Stop iTunes Opening on OSX when hitting Play button on Keyboard
launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist
# branch_name = New branch not MASTER e.g. new_dev
git checkout {branch_name}
git merge -s ours master
git checkout master
git merge {branch_name}
@michaelkeevildown
michaelkeevildown / finder-cleanup.sh
Created June 13, 2016 17:44
Clean Up Finder's "Open With" Menu
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
@michaelkeevildown
michaelkeevildown / alienthreat-api-request.txt
Last active June 15, 2016 08:50
AlienTheat API Example
/api/v1/pulses/activity/?modified_since=2016-04-25T22:49:03.704867&limit=10&page=1
{
"count": 487,
"next": "https://otx.alienvault.com/api/v1/pulses/activity?page=2",
"previous": null,
"results": [
{
"id": "5760336e2957b90134ede223",
"name": "Intrusion into the Democratic National Committee",
@michaelkeevildown
michaelkeevildown / scroll.py
Created July 1, 2016 14:39
Elasticsearch Python Scroll Script
########################################
# Tested on Elasticsearch Version: 2.x #
########################################
from elasticsearch import Elasticsearch
import certifi
index_name = 'index name here'
index_type = 'index type here'
@michaelkeevildown
michaelkeevildown / ubuntu-accounts.txt
Created July 6, 2016 08:48
Ubuntu Disable and Enable users
### Disable User
`sudo usermod -L -e 1 [username]`
### Enable user
`sudo usermod -U -e "" [username]`
@michaelkeevildown
michaelkeevildown / create-aws-user.txt
Created July 6, 2016 08:49
Create New AWS Ubuntu User
## Taken from: http://www.brianlinkletter.com/how-to-set-up-a-new-userid-on-your-amazon-aws-server-instance/
Create a new userid, with password
We will create a new account with userid brian. If you run into any trouble, consult the Amazon AWS documentation. To create the new account, first login to your AWS server with a command similar to:
Laptop:$ ssh -i ~/Documents/Ubuntu-2-keypair.pem ubuntu@54.175.34.164
Then create the new user brian (or your choice) using the command:
ubuntu@AWS:$ sudo adduser brian
@michaelkeevildown
michaelkeevildown / port-scan.txt
Created August 5, 2016 14:14
Digital Ocean - Port Scan Dump
11:07:05.883154 IP 212.71.238.108.45939 > 139.59.178.38.2481: UDP, length 229
11:07:05.885476 IP 212.71.238.108.45939 > 139.59.178.38.2481: UDP, length 1
11:07:05.887707 IP 212.71.238.108.45939 > 139.59.178.38.2481: UDP, length 48
11:07:05.890172 IP 212.71.238.108.35351 > 139.59.178.38.2469: UDP, length 46
11:07:05.890191 IP 212.71.238.108.52112 > 139.59.178.38.2465: UDP, length 113
11:07:05.890198 IP 212.71.238.108.42957 > 139.59.178.38.2466: UDP, length 113
11:07:05.890206 IP 212.71.238.108.45027 > 139.59.178.38.2471: UDP, length 46
11:07:05.890225 IP 212.71.238.108.59236 > 139.59.178.38.2484: UDP, length 50
11:07:05.898955 IP 212.71.238.108.54349 > 139.59.178.38.2458: UDP, length 61
11:07:05.898975 IP 212.71.238.108.40055 > 139.59.178.38.2462: UDP, length 61