Skip to content

Instantly share code, notes, and snippets.

View s4w3d0ff's full-sized avatar
:octocat:
1 ¯\_(ツ)_/¯ 0

s4w3d0ff s4w3d0ff

:octocat:
1 ¯\_(ツ)_/¯ 0
View GitHub Profile
@s4w3d0ff
s4w3d0ff / openConf.py
Last active June 21, 2019 15:47
Opens a bitcoin.conf and puts contents into a dict
import os
def readCfg(location):
# Make sure file exists...
if not os.path.exists(location):
return False
with open(location) as f:
cfg= {}
for line in f:
line = line.strip()
@s4w3d0ff
s4w3d0ff / burn-btc.md
Last active November 13, 2015 03:33 — forked from CoinWhisperer/burn-btc
A simple python program to create Bitcoin (or Bitcoin based coins) burn addresses.
@s4w3d0ff
s4w3d0ff / something_or_somebody.txt
Created May 2, 2016 04:42
Something or somebody is a magician...
Something or somebody made /var/lib/tor disappear.
Creating one for you again.
Something or somebody made /var/log/tor disappear.
Creating one for you again.
* Starting tor daemon...
@s4w3d0ff
s4w3d0ff / steam.sh
Created May 8, 2016 01:56
Install Steam on Ubuntu 14.04 LTS 64bit (one line)
sudo bash -c 'dpkg --add-architecture i386 && apt-get update && apt-get install -y libcgmanager0:i386 libgl1-mesa-glx-lts-utopic:i386 libudev1:i386 libc6:i386 libgl1-mesa-dri-lts-utopic:i386 libglapi-mesa-lts-utopic:i386 steam'
@s4w3d0ff
s4w3d0ff / cuda.sh
Created May 8, 2016 02:12
Install Cuda 7.5 for Ubuntu 14.04 LTS 64bit
cd ~/Downloads && wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb && sudo bash -c 'dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb && apt-get update && apt-get install -y cuda && apt-get update && apt-get upgrade'
sudo bash -c 'echo "export CUDA_HOME=/usr/local/cuda-7.5" >> ~/.bashrc && echo "export LD_LIBRARY_PATH=${CUDA_HOME}/lib64" >> ~/.bashrc && echo "PATH=${CUDA_HOME}/bin:${PATH}" >> ~/.bashrc && echo "export PATH" >> ~/.bashrc'
sudo reboot
@s4w3d0ff
s4w3d0ff / AvailablePorts.py
Created July 28, 2016 06:50
Downloads the current iana.org port assignment csv and returns a list of 'Unassigned' ports in the 'User' range (>1024)
import csv
import requests
import logging
def getAvailUserPorts(url='http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.csv', minport=1024):
""" Downloads the current iana.org port assignment csv and returns a list of 'Unassigned' ports in the 'User' range (>1024)"""
logging.info("Downloading: '%s'" % url)
logging.info("This could take awhile...")
raw = requests.get(url)
reader = csv.reader(raw.iter_lines(), delimiter=',')
@s4w3d0ff
s4w3d0ff / genTorPassHash.py
Created July 29, 2016 19:35
Launches subprocess 'tor --hash-password' and returns the hashed password
from subprocess import Popen, PIPE
import logging
def genTorPassHash(password):
""" Launches a subprocess of tor to generate a hashed <password>"""
logging.info("Generating a hashed password")
torP = Popen(['tor', '--hush', '--hash-password', str(password)], stdout=PIPE, bufsize=1)
try:
with torP.stdout:
for line in iter(torP.stdout.readline, b''):
@s4w3d0ff
s4w3d0ff / ports.py
Last active October 6, 2016 02:11
returns a list of 'Unassigned' ports from iana.org
import os.path
from csv import reader as csvreader
import json, requests, logging
# url for retieving the unregistered portlist
IANAURL = 'http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.csv'
def getAvailPorts(minport=1024):
"""
Downloads the current iana.org port assignment csv
@s4w3d0ff
s4w3d0ff / nvm.fish
Last active October 27, 2016 18:46 — forked from pateketrueke/nvm.fish
FiSH function/alias for nvm
function nvm
bash -c 'source ~/.nvm/nvm.sh; nvm "$@"' nvm $argv
set -l node_dir "$HOME/.nvm"
switch (echo $argv[1])
case install
case use
set -l node_version (ls $node_dir | grep $argv[2])
set -l node_version (echo $node_version | cut -d " " -f1)
@s4w3d0ff
s4w3d0ff / install_lemp.sh
Created October 27, 2016 19:25
Install LEMP (mysql) on Ubuntu 14 LTS server
apt update
apt upgrade -y
apt install nginx mysql-server -y
mysql_install_db
mysql_secure_installation
apt-get install php5-fpm php5-mysql -y