Skip to content

Instantly share code, notes, and snippets.

View brianredbeard's full-sized avatar

redbeard brianredbeard

View GitHub Profile
@brianredbeard
brianredbeard / os4-acme-certs.sh
Created October 29, 2019 01:13
Generate Let's Encrypt (ACME) Certs for OpenShift 4
#!/bin/sh
EMAIL="${1}"
if [ "${#}" -ne 1 ]; then
echo "USAGE: os4-acme-certs.sh email@example.com"
echo "QUITTING"
exit 1
fi
OUT="$(env | grep ^AWS | wc -l)"
@brianredbeard
brianredbeard / install_golang.sh
Created January 9, 2020 22:48
Golang Installation script
#!/usr/bin/env bash
# Golang Installation Script (c) Brian 'redbeard' Harrington, 2019
#
# I'm very about how Golang is installed on my system. I normally run through
# this entire process by hand, but realized that it's easier to just have this
# thing to do the needful. Funny enough, 1.13.6 was published in the middle of
# me working on it, so it is already useful.
#
# In the future, I may add a "VERSION" env variable to allow for arbitrary
# versions rather than the latest stable.
@brianredbeard
brianredbeard / sdc_raw_libaio_direct.fio
Created May 14, 2020 16:11 — forked from tcooper/sdc_raw_libaio_direct.fio
FIO test script for raw device, ioengine=libaio, oflag=direct
[global]
ioengine=libaio
invalidate=1
ramp_time=30
iodepth=1
runtime=180
time_based
direct=1
[write-sdc-4k-seq]
@brianredbeard
brianredbeard / Dockerfile-c
Last active May 16, 2020 02:48
Examples of name resolution (using gethostbyname() ) used in an explanation.
FROM scratch
ADD ghbn /ghbn
CMD ["/ghbn", "example.com"]
@brianredbeard
brianredbeard / Translate.sh
Created July 30, 2020 21:44
BASH example of translation using the AWS CLI
#!/bin/bash
# Bourne Again Shell example of translation services using the AWS Translate
# service. Requires the AWS CLI tool and JQ to be present in the path.
#
# Directions, edit "langlist.txt" to include the desired languages from the
# following site: https://docs.aws.amazon.com/translate/latest/dg/what-is.html
#
# Next: Edit the "--text" option to include your text to be translated and
# the JQ filter to format the output. In the example below we are translating
# a string for use in translating the description of an application for use in
@brianredbeard
brianredbeard / mpris.py
Created September 21, 2020 04:35 — forked from FergusInLondon/mpris.py
Retrieve data from a Media Player in Linux, via dbus. (Uses Python)
import dbus
class MediaPlayer:
"""Recieves state from a MediaPlayer using dbus."""
player_properties = False
def __init__(self, player_name):
# Get an instance of the dbus session bus, and retrieve
# a proxy object for accessing the MediaPlayer
@brianredbeard
brianredbeard / CopyOCPAMI.py
Created November 5, 2020 04:22
CopyOCPAMI.py - A utility to copy a RHEL CoreOS AMI Image to a different region/account.
#!/usr/bin/env python
"""CopyOCPAMI.py - A utility to copy OpenShift Amazon Machine Images
Copyright (C) 2020 Brian 'redbeard' Harrington
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
@brianredbeard
brianredbeard / BTConfig.patch
Last active July 3, 2021 22:43
CNC xPro v5 "patch" set
--- CNCxPRO src/WebUI/BTConfig.h
+++ Grbl_Esp32 src/WebUI/BTConfig.h
@@ -24,7 +24,7 @@
#endif
//defaults values
-const char* const DEFAULT_BT_NAME = "CNC_xPRO_V5";
+const char* const DEFAULT_BT_NAME = "btgrblesp";
#include <BluetoothSerial.h>
@brianredbeard
brianredbeard / cppcheck.out
Last active August 5, 2021 23:48
Output of running platformio check against the marlin code base with various tools
> Executing task: platformio check --environment STM32F103RE_btt <
Checking STM32F103RE_btt > cppcheck (platform: ststm32@~12.1; board: genericSTM32F103RE; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------
Marlin/src/HAL/shared/backtrace/unwarm.cpp:56: [low:style] The function 'UnwInitState' is never used. [unusedFunction]
Marlin/src/HAL/shared/backtrace/unwarm.cpp:160: [low:style] The function 'UnwMemReadRegister' is never used. [unusedFunction]
Marlin/src/HAL/shared/backtrace/unwarm.cpp:141: [low:style] The function 'UnwMemWriteRegister' is never used. [unusedFunction]
Marlin/src/HAL/shared/backtrace/unwarm.cpp:91: [low:style] The function 'UnwReportRetAddr' is never used. [unusedFunction]
Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp:45: [low:style] The function 'UnwStartArm' is never used. [unusedFunction]
Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp:32: [low:style] The function 'UnwStartThumb' is
@brianredbeard
brianredbeard / slicer.sh
Created December 18, 2021 22:06
Slicer Wrapper
#!/bin/bash
#
# This script should work with Slic3r (https://github.com/slic3r/Slic3r) as
# well as it's derivatives:
# - https://github.com/supermerill/SuperSlicer
# - https://github.com/prusa3d/PrusaSlicer
# The author uses "SuperSlicer" due to it's advanced feature set, installing
# it at the path ~/.local/bin/slicer.sh
#
# CLI options relevant to configuration (derived via CLI with --help-fff):