Skip to content

Instantly share code, notes, and snippets.

View csm10495's full-sized avatar

Charles Machalow csm10495

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / getStackFrame.py
Created October 15, 2016 05:29
A really speedy way to get the current stack frame in Python
'''
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
'''
@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