Skip to content

Instantly share code, notes, and snippets.

View Sparrow1029's full-sized avatar
💭
Always learning to code

Alex Ray Sparrow1029

💭
Always learning to code
  • Charter Communications
  • Denver, CO
View GitHub Profile
@Sparrow1029
Sparrow1029 / gist:598ffcfa1ef8e80e0223cc5ef445f3f7
Created November 8, 2017 07:11
Python Practice 19 - Decode a web page [Sparrow1029]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
from pprint import pprint
r = \
requests.get('http://www.vanityfair.com/society/2014/06/monica-lewinsky-humiliation-culture')
soup = BeautifulSoup(r.text, "lxml")
@Sparrow1029
Sparrow1029 / psswd_gen.py
Created November 12, 2017 19:21
Password generator
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
"""
Make a password generator with options for weak to strong.
Weak should select a word or two from a list, strong should contain
uppercase, lowercase, symbols and numbers.
"""
from sys import exit
@Sparrow1029
Sparrow1029 / print_board.py
Created November 12, 2017 20:13
(PracticePython) Drawing a gameboard with number of squares based on user input
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
"""
Ask user size of gameboard and print to screen
"""
while True:
try:
size = int(input("How many squares on a side? "))
@Sparrow1029
Sparrow1029 / check_win.py
Created November 12, 2017 21:29
(Practice Python) Check win state in a game of tic-tac-toe using matrices
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
"""
Check matrix list for win in Tic-tac-toe
"""
from itertools import chain
winner_is_1 = [[1, 2, 0],
[2, 1, 0],
@Sparrow1029
Sparrow1029 / .gitignore
Last active December 22, 2017 06:12
Advent of Code 2017 - Day 1
*.pyc
__pycache__/
.DS_Store
__MACOSX__
*.pyo
*.swp
adventbase.py
*input.txt
@Sparrow1029
Sparrow1029 / graphics.py
Created February 13, 2018 06:20
PyBites Code Challenge 10 - hangman game
def hang_graphics():
"""graphs from https://gist.github.com/devdarren/4199441"""
yield """
________
| |
|
|
|
|"""
yield """
@Sparrow1029
Sparrow1029 / plex.sh
Created July 13, 2018 03:39
Plex Media Server helper script - bash
#!/bin/bash
# This script makes it easier to activate and restart plexmediaserver from
# the command line, as well as enabling/disabling the server at boot.
read -d '' USAGE << EOF
usage: plex start|stop|disable|enable|status
help - print this text and exit.
start|stop - start and stop plexmediaserver service (active|inactive)
enable|disable - toggle plexmediaserver at system start (enabled|disabled)
@Sparrow1029
Sparrow1029 / genhash.py
Created March 24, 2019 23:09
Increment a number and hash it using chosen algorithm to find partial collisions
#!/usr/bin/env python3
import hashlib
import whirlpool
import sys
algo = sys.argv[1]
target = sys.argv[2]
def gen_hash(algo, target):
@Sparrow1029
Sparrow1029 / decode.py
Created March 25, 2019 22:51
Decode base64 until flag is found
#!usr/bin/env python3
from base64 import b64decode
f = open('lol.txt', 'r')
string = str(f.read())
f.close()
print("Decoding...")
while True:
@Sparrow1029
Sparrow1029 / RC4_bruteforce.py
Last active May 15, 2019 20:14
Script that uses python 3 multiprocessing module to attempt brute-force of RC4-encrypted strings.
#!/usr/bin/env python3
# This script requires the chardet library for python3
# the RC4 implementation used in this script is attributed to Ryosuke Ito
# it (and installation instructions) can be found at https://github.com/manicmaniac/arc4.git
import sys
from arc4 import ARC4
import chardet
from string import ascii_uppercase, ascii_lowercase, digits
from itertools import product