This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set thresholds from script args | |
WARN_THRESHOLD=$1 | |
CRIT_THRESHOLD=$2 | |
# Find current memory status from /proc/meminfo | |
current=$(head -n 3 /proc/meminfo) | |
memtotal=$(expr $(echo $current | awk '{ print $2 }') / 1024) | |
memfree=$(expr $(echo $current | awk '{ print $5 }') / 1024) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Script to encode & decode strings to and from Base64""" | |
import sys | |
import argparse | |
CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" | |
PAD = "=" | |
LINE_WIDTH = 76 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
https://www.practicepython.org/exercise/2014/07/14/19-decode-a-web-page-two.html | |
---------------------------------------------- | |
Exercise 19 - Decode a webpage part 2 | |
---------------------------------------------- | |
Monica Lewinsky Vanity fair article: | |
https://www.vanityfair.com/style/society/2014/06/monica-lewinsky-humiliation-culture | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!usr/bin/env python3 | |
from base64 import b64decode | |
f = open('lol.txt', 'r') | |
string = str(f.read()) | |
f.close() | |
print("Decoding...") | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import hashlib | |
import whirlpool | |
import sys | |
algo = sys.argv[1] | |
target = sys.argv[2] | |
def gen_hash(algo, target): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hang_graphics(): | |
"""graphs from https://gist.github.com/devdarren/4199441""" | |
yield """ | |
________ | |
| | | |
| | |
| | |
| | |
|""" | |
yield """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.pyc | |
__pycache__/ | |
.DS_Store | |
__MACOSX__ | |
*.pyo | |
*.swp | |
adventbase.py | |
*input.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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], |
NewerOlder