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

Keybase proof

I hereby claim:

  • I am s4w3d0ff on github.
  • I am s4w3d0ff (https://keybase.io/s4w3d0ff) on keybase.
  • I have a public key whose fingerprint is C952 7DDB 267F CE57 7DAC 61A1 B099 7C35 23A3 B07E

To claim this, I am signing this object:

@s4w3d0ff
s4w3d0ff / torhasher.py
Last active July 2, 2021 06:41 — forked from james-see/torhasher.py
create a tor hashed password without using `tor --hash-password`
from os import urandom
from binascii import b2a_hex
from hashlib import sha1
def getTorPassHash(secret='password'):
'''
https://gist.github.com/jamesacampbell/2f170fc17a328a638322078f42e04cbc
'''
# static 'count' value later referenced as "c"
indicator = chr(96)
@s4w3d0ff
s4w3d0ff / im_still_listening.md
Last active May 22, 2017 00:50
I'm still listening pandora
javascript:function myMethod( ) { document.querySelector("button[data-qa='keep_listening_button']").click();} var timer = setInterval(myMethod, 1000); if(timer) { alert('Thanks for listening!'); }
@s4w3d0ff
s4w3d0ff / bf4stats.py
Created October 27, 2016 19:58
Simple bf4stats.com api wrapper
#!/usr/bin python
import requests
commands = ['playerInfo', 'playerRankings', 'onlinePlayers']
platforms = ['pc','xbox','ps3','xone','ps4']
posout = ['json', 'jsonp', 'js', 'lines']
playeroptions = [
'imagePaths',
'details',
'names',
@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
@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 / 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 / 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 / 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 / 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