Skip to content

Instantly share code, notes, and snippets.

View csm10495's full-sized avatar

Charles Machalow csm10495

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / airflow_start_via_helm.py
Last active December 10, 2021 05:28
Airflow from helm simple example
import base64
import os
import subprocess
def run_command(cmd):
print (f">{cmd}")
ret_code = subprocess.call(cmd, shell=True)
print (f'>> Return Code: {ret_code}')
return ret_code
@csm10495
csm10495 / yt_crawler.py
Created December 11, 2021 22:28
Quick/Dirty YouTube video id crawler
'''
Small script that tries to recursively find youtube video ids starting from given urls.
MIT License - Charles Machalow
'''
import time
import re
from datetime import timedelta, datetime
from typing import List, Set
from requests_html import HTMLSession
import requests
@csm10495
csm10495 / cosmos2json.py
Created February 11, 2023 05:27
cosmos2json.py - A quick and dirty script to run queries against a cosmos db's container
'''
Simple script to do a simple query against a cosmosdb in azure
Can use it to dump a db to json.. if ya need that for some reason.
MIT License - Charles Machalow
# pip install azure-cosmos
# pip install azure-identity
'''
@csm10495
csm10495 / Building OpenSSL 1.1.1(b) Notes
Last active September 18, 2023 07:50
Building OpenSSL 1.1.1(b) Notes (Windows)
Required: Visual Studio 2015 or 2017 (or probably later works)
Setup
1. Clone/download OpenSSL 1.1.1 source to a folder
2. Download / install Perl (They recommend Active perl)
I recommend using Chocolatey so for me: choco install activeperl
3. Ensure Perl is in the system path. (Choco appears to do this by default)
4. Download / install NASM
I recommend using Chocolatey so for me: choco install nasm
5. Ensure NASM is in the system path. (For me the directory to add was C:\Program Files\NASM)
@csm10495
csm10495 / google_messages_archiver.js
Last active October 21, 2023 05:11
Google Messages Archiver
// ==UserScript==
// @name Google Messages Archiver
// @namespace Whatever
// @match https://messages.google.com/web/*
// @grant GM_log
// @author csm10495
// @description Run doIt() in the console to archive all conversations after the most recent 5.
// @version 0.1.0
// ==/UserScript==