Skip to content

Instantly share code, notes, and snippets.

@packetchef
packetchef / setup.md
Last active April 11, 2021 18:15
Chromebook dev setup

Software

VS Code

Download deb from Microsoft

Python 3

ln -s $(which python) ~/bin/python or alias python=python3

Don't forget pip: sudo apt-get install python3-pip

Existing Python gist: https://gist.github.com/packetchef/13d4c2d677f34d188de493f14fd1d42c
API: https://3ukyhfgejb.execute-api.us-east-1.amazonaws.com/test1/eicar?decode=True
Wordnik
https://developer.wordnik.com/gettingstarted
httpbin.org
http://httpbin.org/
Reqres
https://reqres.in/
I think I setup this API to dump the input
# Roll a die, defaulting to d6
import random
def roll(d=6):
return random.randint(1, d)
# Randomly select a value a list
import random
wordlist = ['quick', 'brown', 'fox', 'jumped']
random.choice(wordlist)
From the maker of RegexBuddy
http://www.regular-expressions.info/characters.html
A regex cheat-sheet for password crackers
https://www.unix-ninja.com/p/A_cheat-sheet_for_password_crackers
if [ $# -eq 0 ]; then
echo "No arguments"
else
echo "First arg is $1"
fi
How do I get rid of comments via Perl?
if($_!~/^#/)
{
# do nothing
}
# How many characters per line?
$ awk '{ print length($0) }'
# How many words per line? Add -F for separator
awk '{ print NF }'
# How do I see a substring? Example, 4 characters starting at position 2
$ awk '{ print substr($0, 2, 4) }'
# Alternative to the above, use cut:
# Create a file named with the current timestamp
for /f "tokens=1,2" %%u in ('date /t') do set d=%%v
set timestr=%d:~6,4%_%d:~0,2%_%d:~3,2%
echo %timestr%
set FILENAME=%timestr%.log
=TEXT((((A1-(5*3600))/86400)+25569),"yyyy-MM-dd HH:mm:ss")