Skip to content

Instantly share code, notes, and snippets.

View keithstellyes's full-sized avatar

Keith Stellyes keithstellyes

View GitHub Profile
@keithstellyes
keithstellyes / exploit-google-gruyere.js
Last active November 7, 2016 05:34
An XSS script, does a few things
/*
* AUTHOR: Keith Stellyes
*
* This is for Google's http://google-gruyere.appspot.com/
* This contains various exploits for it.
*
* At the very bottom, the exact HTML to insert into the profile is there.
* This specific attack assumes the attacker has a web page ready to listen. This would be put
* on the user page and sends the cookie data to the attacker's own server.
*
@keithstellyes
keithstellyes / im2wordcloud.py
Created February 4, 2017 06:25
Python word cloud example that takes an image, a source string, and builds a word cloud to match the image.
from wordcloud import WordCloud, ImageColorGenerator
from PIL import Image
import numpy as np
s = input("Source text:")
p = input("Image file:")
outfile = input("Out file?")
s = open(s, 'r').read()
coloring = np.array(Image.open(p))
@keithstellyes
keithstellyes / page-compiler.py
Last active January 7, 2018 06:19
A template engine where templates use <lua LUA_CODE(); ?> and builds a C header file for use with liblua
'''
Copyright 2018 Keith Stellyes
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE O
@keithstellyes
keithstellyes / add-shrek-to-units.sh
Created February 28, 2018 18:07
Adds shrek as a unit of measurement to GNU units
# Adds Shrek as a unit of measurement (=95 mins) to GNU units
F=$(units -U)
echo "###################" >> $F
echo "# Added by script #" >> $F
echo "###################" >> $F
echo shrek 95 min >> $F
echo "###################" >> $F
@keithstellyes
keithstellyes / gh.py
Created October 8, 2019 19:47
A script for downloading just a directory off of Github
#!/usr/bin/env python3
import shutil, os, sys, json, requests, getpass
def ensure_dir(dir):
try:
os.mkdir(dir)
except FileExistsError:
# It's OK if dir doesn't exist, it's just cleaner for code to have an
# "ensure" function
pass
@keithstellyes
keithstellyes / pokemon-rps.py
Last active December 17, 2020 19:01
Generates all possible rock-paper-scissors type combinations for pokemon
'''
Author: Keith Stellyes
A script that computes all possible rock-paper-scissors combinations of types
'''
type_source = '''
Bug Grass, Dark, Psychic Fire, Flying, Rock
Dark Ghost, Psychic Bug, Fairy, Fighting
Dragon Dragon Dragon, Fairy, Ice
Electric Flying, Water Ground
@keithstellyes
keithstellyes / scraper.py
Created October 10, 2020 04:09
a script to download articles (like old broken ones from 2012) on overclock.net forums
# tested on https://www.overclock.net/threads/haswell-overclocking-guide-with-statistics.1411077/
from bs4 import BeautifulSoup
import requests, sys, json
r = requests.get(sys.argv[1])
f = open('tmp.html', 'w')
f.write(r.text)
f.close()
soup = BeautifulSoup(open('tmp.html', 'r'))