Skip to content

Instantly share code, notes, and snippets.

make your own luck

JC jamesacampbell

make your own luck
View GitHub Profile
jamesacampbell / Count lines in Git repo
Created Mar 1, 2021 — forked from mandiwise/Count lines in Git repo
A command to calculate lines of code in all tracked files in a Git repo
View Count lines in Git repo
// Reference:
$ git ls-files | xargs wc -l
mkdir -p ~/Downloads
cd ~/Downloads
sudo tar -xvf go1.15.8.linux-amd64.tar.gz
sudo mv go /usr/local
sudo echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.zshrc
source ~/.zshrc
jamesacampbell / add_to_cart.user.js
Created Feb 12, 2021 — forked from beporter/add_to_cart.user.js
Greasemonkey script to repeatedly refresh a given page, look for specific "Add to Cart" buttons, click them if present, and make a lot of noise on success.
View add_to_cart.user.js
// ==UserScript==
// @name Add Saved Items to Cart
// @namespace
// @version 0.5
// @description Repeatedly refresh a given "saved items" page (Amazon, Walmart, BestBuy), look for specific "Add to Cart" buttons, click them if present, and make a lot of noise on success.
// @author
// @match*
// @match*
// @match
// @match
# choco install python
# open up admin PowerShell and run:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(''))
# then install python which should install the latest at c:\Python3x
choco install python
# then install pip packages
pip install pefile
jamesacampbell /
Last active Nov 17, 2020
run book to get Ubuntu 20.04 to run on Macbook Pro 16inch


  1. Install latest Ubuntu to thumbdrive via unetbootin or etcher (now balena bs or whatever)
  2. Install refind after disabling the software integrity lock bs
  3. Create new FAT32 partition like 200GB if you can spare it on a 1TB Mac OS if not, you need at least 20GB
  4. Boot to live Ubuntu GUI install using compability mode (it will fail otherwise)

get wifi working with Cudy dongle

These instructions work: to achieve 200MB down and up if within LOS

jamesacampbell /
Last active May 5, 2020
your life in 90 years by 52 weeks 4680 total example here and this by Tim Urban
# matplotlib version
# import matplotlib.pyplot as plt
# fig, axes = plt.subplots(ncols=24, sharex=True, sharey=True)
# for ax in axes:
# ax.plot([1, 2, 3], [1, 2, 3])
# ax.set(adjustable='box', aspect='equal')
from PIL import Image, ImageDraw
jamesacampbell /
Last active Mar 19, 2020
The best email parser on the planet. Email extraction. You are welcome world.
import re
def finder(stringer):
EMAIL_REGEX = re.compile("(?:[a-zA-Z0-9!#$%&'*+\-\/\=?^_`{|}~]|\.(?!\.)){1,64}@(?:(?:[a-zA-Z0-9\-]){1,63}\.(?!\.)){1,4}(?:[a-zA-Z0-9]{2,12})")
emails = EMAIL_REGEX.findall(stringer)
return emails
jamesacampbell / windows-10-wsl-help.txt
Last active Feb 27, 2020
how to reset wsl password for ubuntu user in windows subsystem linux
View windows-10-wsl-help.txt
I ran the following commands from the Windows command prompt to reset my password. Anything after the # is a comment:
ubuntu config --default-user root
ubuntu.exe # (to run WSL in the current Windows command prompt)
whoami # (to see who I'm currently logged in as)
tail -3 /etc/passwd # (to see the last three users added to the Ubuntu system)
passwd user01 # (to change the password for user01)
exit # (to exit WSL)
ubuntu config --default-user user01 # (to set the default user for the WSL terminal)
pdfcrack -f [filename].pdf
qpdf --decrypt --password='[found password]' [filename].pdf output_file.pdf
jamesacampbell /
Created Dec 16, 2019
how to quickly get head status of each url for onion sites
while read LINE; do
curl -o /dev/null --silent --socks5-hostname --head --write-out "%{http_code} $LINE\n" "$LINE"
done < url-list.txt