Skip to content

Instantly share code, notes, and snippets.

View james-see's full-sized avatar
🍀
make your own luck

JC james-see

🍀
make your own luck
View GitHub Profile
@james-see
james-see / init.sql
Created June 29, 2016 01:10
mysql setup new database and user access command line so I don't forget and have to stack overflow next time
create database mytestdatabase;
alter database mytestdatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
@james-see
james-see / whodig.sh
Created July 25, 2016 19:20
whodig.sh does a dig and whois given a domain with a nice BASH spinner while waiting for output.
#!/bin/bash
# this gets the ip address and the owning server org of the ip address WITH SPINNERS WHILE WAITING
# example (save file as whodig.sh and chmod a+x) then run whodig.sh jamescampbell.us
echo "Looking up ip and owner info for input..."
dig +short $1 > nslook.txt &
pid=$!
spin[0]="-"
spin[1]="\\"
spin[2]="|"
@james-see
james-see / irssi_otr.sh
Last active August 7, 2016 20:12
irssi and otr in ubuntu (because I can't get it to work in OSX at all yet) and with certs for OFTC
mkdir ~/Downloads
cd ~/Downloads
wget https://otr.cypherpunks.ca/libotr-4.1.1.tar.gz
tar -xzf libotr-4.1.1.tar.gz
cd libotr-4.1.1
sudo apt-get install automake libtool autoconf irssi-dev tor git bitlbee-plugin-otr irssi-plugin-otr libgcrypt-dev gcc libglib2.0-dev -y
./configure --prefix=/usr && make && sudo make install
mkdir ~/projects
cd ~/projects
git clone https://github.com/cryptodotis/irssi-otr.git
@james-see
james-see / meek-to-appspot.sh
Last active July 28, 2016 17:57
bash to setup a new appspot meek bridge for tor (assuming already have new google project created)
# taken from:
# https://lists.torproject.org/pipermail/tor-talk/2016-June/041699.html
# Go to the Cloud Platform Console and log in (you can use a gmail.com account).
# https://console.cloud.google.com/project
# Create a new project. The project ID determines the URL where the app
# will live. For example, if you choose "myproject", then the app will be
# at https://myproject.appspot.com/.
# Download the meek source code. The code you need is in the "appengine"
# directory.
mkdir ~/projects
@james-see
james-see / setup_py_forgetmenot.txt
Last active June 27, 2018 02:29
python setup.py cheats
git tag 0.1.5 -m "Added backwards compatibility for < Python 2.2.3."
git push --tag
python setup.py register -r pypi
python setup.py sdist upload -r pypi
@james-see
james-see / bitchecker.sh
Created August 9, 2016 03:31
bitcoin balance checker from bash
echo "|||**** BITBALANCE ****|||"
echo "||| Wallet to check: "
read bitwallet
echo "You entered: $bitwallet"
curl --silent "https://blockchain.info/address/$bitwallet?format=json" > balance.txt &
pid=$!
spin[0]="-"
spin[1]="\\"
spin[2]="|"
@james-see
james-see / fresh-windows.sh
Created August 14, 2016 03:14
fresh windows what to do next
#!/bin/bash
# Author: James Campbell
# Date: August 13 2016
# What: A list of things to do on a fresh Windows machine.
# 1 edit UEFI and set passwords / encryption if possible
# 2 install chocolately
# 3 install cygwin
choco install cygwin -y
# 4 install cmder
@james-see
james-see / squid_http_setup_ubuntu.sh
Last active February 21, 2022 14:18
squid http proxy setup on ubuntu
#!/bin/bash
# get ip address
myip=$(ip route get 8.8.8.8 | awk 'NR==1 {print $NF}')
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install buildessentials apache2-utils
sudo apt-get install fakeroot devscripts gawk gcc-multilib dpatch
sudo apt-get install build-dep squid3
sudo apt-get install build-dep openssl
sudo apt-get install libssl-dev openssl
@james-see
james-see / securely-shred.md
Created August 30, 2016 17:56
how to shred from terminal for various OSSssss

#secure shred

different ways for different OS'ssssss

Mac:     srm -f -z --medium  filename   
Linux:   shred -f -u -n 7 filename   
Windows: sdelete.exe -q -p 7 filename   
@james-see
james-see / torhasher.py
Created January 23, 2017 21:15
create a hashed password for control port setting in torrc HashedControlPassword line easily with this
import os, binascii, hashlib
#supply password
secret = 'your password here you want to use' # all you need to change!
#static 'count' value later referenced as "c"
indicator = chr(96)
#used to generate salt
rng = os.urandom