Skip to content

Instantly share code, notes, and snippets.

View csm10495's full-sized avatar

Charles Machalow csm10495

View GitHub Profile
@csm10495
csm10495 / public_subreddits_5_23_2021.json
Created May 24, 2021 04:21
List of Every Publicly Accessible Subreddit as of 5/23/2021
This file has been truncated, but you can view the full file.
["00000000control", "0000FF", "0000THEFILM", "000155FF0C", "000webhost", "0013tardx", "004janine", "007chan", "007games", "007special", "007test007", "0080076503tm", "00Chanman00", "00E", "00FF00", "00FFFF", "00OA", "00Problems", "00d", "00easy", "00s", "00sKids", "00sMusic", "00sPorn", "00sRock", "00sScreamo", "00scartoons", "00sdesign", "00sonic", "00test00", "00th", "00weareready00", "00yearsago", "0121GFDO", "01884Fords", "01NebSucks", "01s", "01stworldproblems", "02Crew", "02keilj", "0311masterrace", "032c", "0333testtesttest", "03Esports", "03dfn3dndn9fno", "03s", "04manualg35coupes", "05sop14", "06prime", "06s", "06scape", "070Shake", "07Achievements", "07Clan", "07DeadManMode", "07F1D6B42A2BFEEBE910", "07Flipping", "07GWD", "07Guides", "07Helpers", "07Ironman", "07Memes", "07Merching", "07NARC", "07RSDevTracker", "07RSSuggestions", "07Scape", "07ScapeClues", "07Server", "07TRiBot", "07Warlocks", "07ada4381247db64", "07castlewars", "07craft", "07cw", "07deadman", "07exchange", "07garchomp", "07iron", "
@csm10495
csm10495 / simple_compression.py
Created September 28, 2020 00:09
simple_compression.py
'''
Simple compression example
(C) - Charles Machalow - MIT License
Attempts to compress using a 'bit-compression' algorithm. Basically it goes
byte by byte trying to shrink each byte to the minimum number of bits needed to
represent each byte. If all 8 bits are needed, it will likely yield a larger than
original file. Often all 8 aren't needed if the file is something like ascii.
Some optimizations to speed that would likely speed this up greatly
@csm10495
csm10495 / install_puppet_master.sh
Last active April 27, 2020 00:24
install_puppet_master.sh
#!/bin/bash -v
# helps to install puppet 6 (as a master on this system) on CentOS/RHEL 7
set -e
alias sudo="sudo --preserve-env=PATH env "
# allow other installs
sudo yum install epel-release -y
@csm10495
csm10495 / install_puppet_agent.sh
Created April 27, 2020 00:23
install_puppet_agent.sh
#!/bin/bash -v
# Helps to install a puppet 6 agent (pointing to a puppet server/master) on CentOS / RHEL
set -e
alias sudo="sudo --preserve-env=PATH env "
# allow other installs
sudo yum install epel-release -y
@csm10495
csm10495 / ubuntuSetup.py
Last active October 10, 2019 03:23
Script to setup an Ubuntu machine to my liking
DESCRIPTION=\
'''
Brief:
ubuntuSetup.py - A script to setup an Ubuntu-family system to the way I like it.
Tested on Ubuntu 16.04 LTS. Should work on Ubuntu 14.04 LTS.
Enabled on Debian but not tested at all... may work, may not.
Description:
Some of the things this installs and configures:
- VS Code
@csm10495
csm10495 / Enum.h
Last active September 9, 2018 04:48
Silly.. though functional self-describing C++ enums.
See https://github.com/csm10495/Enum.h/blob/master/StringEnums/Enum.h for the latest.
@csm10495
csm10495 / snb.py
Last active December 16, 2017 18:29
Hides the red box around a Skype screenshare
'''
Brief:
snb.py - Removes the red border Skype makes when screensharing.
Also sets Skype to low priority with a processor affinity to only run on one cpu/core.
This should help keep game/other app performance decent.
Description:
Run the script once when the border is up, and it will go away
(C) - MIT License - 2017
@csm10495
csm10495 / ast_test.py
Created October 26, 2017 13:52
Play around with Python's Abstract Syntax Tree, to see if we can say that a function will call a specific function (and what the args to that call would be).
'''
Brief:
ast_test.py - Quick and dirty test code of the Python abstract syntax tree.
The big thing is the ability to (sort of) see if a function calls another
specific function.
License:
MIT License - 2017
Author(s):
@csm10495
csm10495 / selfExtractorMakerPyinstaller.py
Last active March 22, 2017 05:05
A Python based folder extractor. Save a folder to a .py or .exe, use the result to extract anywhere, even if you don't have Python!
"""
Brief:
This script makes a self-extracting .py/,exe of a given folder
Author:
Charles Machalow
"""
import argparse
import base64
import os
@csm10495
csm10495 / regexFiles.py
Created October 3, 2016 05:02
Quick and Dirty Recursive File Regex Counter
'''
Brief:
This searchs a directory recursively (by default the current directory) for a given regex match. The total number of matches is counted and printed at the end.
By default, it looks for lines where the author tag is given but there is no name provided.
Author(s):
Charles Machalow
'''
import os, re
REGEX = re.compile(r".*Author.*:\n(?:\s*|\s*\'\'\'\s*|\s*\"\"\"\s*)\n")
MAX_FILE_SIZE = 1024 * 128 #128 KB