Skip to content

Instantly share code, notes, and snippets.

Avatar

Charles Machalow csm10495

View GitHub Profile
View 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_agent.sh
Created Apr 27, 2020
install_puppet_agent.sh
View 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 Apr 27, 2020
install_puppet_master.sh
View 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 / Building OpenSSL 1.1.1(b) Notes
Last active Apr 11, 2019
Building OpenSSL 1.1.1(b) Notes (Windows)
View Building OpenSSL 1.1.1(b) Notes
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 / Enum.h
Last active Sep 9, 2018
Silly.. though functional self-describing C++ enums.
View Enum.h
See https://github.com/csm10495/Enum.h/blob/master/StringEnums/Enum.h for the latest.
@csm10495
csm10495 / ast_test.py
Created Oct 26, 2017
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).
View ast_test.py
'''
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 / snb.py
Last active Dec 16, 2017
Hides the red box around a Skype screenshare
View snb.py
'''
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 / selfExtractorMakerPyinstaller.py
Last active Mar 22, 2017
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!
View selfExtractorMakerPyinstaller.py
"""
Brief:
This script makes a self-extracting .py/,exe of a given folder
Author:
Charles Machalow
"""
import argparse
import base64
import os
@csm10495
csm10495 / ubuntuSetup.py
Last active Oct 10, 2019
Script to setup an Ubuntu machine to my liking
View ubuntuSetup.py
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 / getStackFrame.py
Created Oct 15, 2016
A really speedy way to get the current stack frame in Python
View getStackFrame.py
'''
Brief:
This script demonstrates how to get the current stack frame in a way faster than using
inspect.stack()... which is really slow (like ~450 times slower than this solution in most cases)
If the fast solution won't work, will fall back to an inspect.stack() solution.
Author:
Charles Machalow
'''