Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
codz

Sam Mingo slmingol

:octocat:
codz
View GitHub Profile
@slmingol
slmingol / version-up.sh
Created May 8, 2021 — forked from OleksandrKucherenko/version-up.sh
Calculate Next Suitable Version Tag for Your Git based project
View version-up.sh
#!/usr/bin/env bash
## Copyright (C) 2017, Oleksandr Kucherenko
## Last revisit: 2017-09-29
# For help:
# ./versionip.sh --help
# For developer / references:
# https://ryanstutorials.net/bash-scripting-tutorial/bash-functions.php
# http://tldp.org/LDP/abs/html/comparison-ops.html
@orhun
orhun / cool.sh
Last active Apr 10, 2021
Random MOD player
View cool.sh
#!/usr/bin/env bash
# Plays a random MOD file from https://modarchive.org
# Depends on XMP (http://xmp.sourceforge.net/)
# https://gist.github.com/orhun/eda9701e357b625c2bada19563872715
rand=$(shuf -i 1-189573 -n 1)
tmp=$(mktemp /tmp/${rand}.XXXXXXXX.mod)
curl https://modarchive.org/jsplayer.php?moduleid=${rand} > ${tmp}
xmp ${tmp}
rm ${tmp}
@kushagharahi
kushagharahi / .Slickdeals URL Cleaner.md
Last active Apr 17, 2021
Slickdeals URL Cleaner UserScript
View .Slickdeals URL Cleaner.md
@dchakro
dchakro / pi.status.sh
Last active Mar 8, 2021
Bash shell script to print stats about a Raspberry Pi running pihole
View pi.status.sh
#!/usr/bin/env bash
# Define colors
RED='\033[91m'
RED_solid='\033[101m'
GREEN='\033[92m'
GREEN_solid='\033[42m'
CYAN='\033[96m'
NC='\033[0m'
BLUE_solid='\e[44m'
@satmandu
satmandu / build_arm64_rpi_userland.sh
Last active Mar 21, 2021
Generate an arm64 rpi userland for use on ubuntu/arm64.
View build_arm64_rpi_userland.sh
#!/bin/bash -x
workdir="${HOME}/workdir"
[[ ! -d "$workdir" ]] && ( mkdir -p "$workdir" || exit 1)
[[ ! -d "$workdir"/tmp ]] && ( mkdir -p "$workdir"/tmp || exit 1)
[[ ! -d "$workdir"/output ]] && ( mkdir -p "$workdir"/output || exit 1)
echo "workdir is ${workdir}"
tmpdir=$(mktemp -d deb_XXXX -p "$workdir"/tmp)
deb_temp=${tmpdir}/deb
extract_tmp=${tmpdir}/extract
@slmingol
slmingol / verbos-argpary-example.py
Created Dec 20, 2019 — forked from ms5/verbos-argpary-example.py
manipulating log level with python argparse
View verbos-argpary-example.py
import argparse
import logging
parser = argparse.ArgumentParser()
parser.add_argument('--verbose', '-v', action='count', default=1)
args = parser.parse_args()
args.verbose = 70 - (10*args.verbose) if args.verbose > 0 else 0
logging.basicConfig(level=args.verbose, format='%(asctime)s %(levelname)s: %(message)s',
@slmingol
slmingol / README.md
Created Nov 14, 2019 — forked from joyrexus/README.md
curl tutorial
View README.md

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

@tmckayus
tmckayus / remote_crc.md
Last active May 3, 2021
Running 'crc' on a remote server
View remote_crc.md

Overview: running crc on a remote server

This document shows how to deploy an OpenShift instance on a server using CodeReady Containers (crc) that can be accessed remotely from one or more client machines (sometimes called a "headless" instance). This provides a low-cost test and development platform that can be shared by developers. Deploying this way also allows a user to create an instance that uses more cpu and memory resources than may be available on his or her laptop.

While there are benefits to this type of deployment, please note that the primary use case for crc is to deploy a local OpenShift instance on a workstation or laptop and access it directly from the same machine. The headless setup is configured completely outside of crc itself, and supporting a headless setup is beyond the mission of the crc development team. Please do not ask for changes to crc to support this type of deployment, it will only cost the team time as they politely decline :)

The instructions here were tested with F