Skip to content

Instantly share code, notes, and snippets.

@Cewlt
Cewlt / screenclip.sh
Last active August 31, 2016 16:33
bash screenshot script using imgur api, appended with key shortcut
clientid='<insert imgur client id here>'
img=$(mktemp '/tmp/img-XXXXXX.png')
gnome-screenshot -a -f $img >/dev/null 2>&1 || exit
res=$(curl -sH "Authorization: Client-ID $clientid" -F "image=@$img" "https://api.imgur.com/3/upload")
echo $res | grep -qo '"status":200' && link=$(echo $res | sed -e 's/.*"link":"\([^"]*\).*/\1/' -e 's/\\//g')
test -n "$link" && (x-www-browser $link && rm "$img") || echo "$res" > "$img.error"
notify-send "screenshot successful!"
@Cewlt
Cewlt / posscombs.py
Created April 3, 2015 10:25
check the possible combinations of passwords
import itertools
import paramiko
def main():
regex = raw_input("Please enter what combination of characters to use: \nexample: abcdefghijklmnopqrstuvwxyz123 \n ")
length = raw_input("Okay now enter the length to check for: \n example: abcdefghijklmnopqrstuvwxyz with a length of 4 has 358,800 possible combinations \n so you would type '4' in this case \n")
go(str(regex), int(length))
def go(regex, length):
am = 0