Skip to content

Instantly share code, notes, and snippets.

@aaronNGi
aaronNGi / newscript.sh
Created April 28, 2020 20:38
Boilerplate for new POSIX shell scripts
#!/bin/sh
prog_name=${0##*/}
version=1.0
version_text="Boilerplate for new scripts v$version"
options="h o: q v V"
help_text="Usage: $prog_name [-o <text>] [-hqvV] [<file>]...
Boilerplate for new scripts
#!/bin/bash
set -eo pipefail
json=`cat $1 | y2j`
overrides=`echo "$json" | jq "{spec}"`
name=`echo "$json" | jq -r ".metadata.name"`
labels=`echo "$json" | jq -r '.metadata.labels | keys[] as $k | "\($k)=\(.[$k])"' | paste -sd "," -`
image=`echo "$json" | jq -r ".spec.containers[0].image"`
kubectl run myubuntu --image ubuntu --rm -ti --restart=Never --overrides='
{
"metadata": {
"labels": {
"diditwork": "itdid"
}
},
"spec": {
"containers": [
{
@bbonamin
bbonamin / Brewfile
Last active March 19, 2024 14:54
Capybara Selenium Webdriver: Headless Chrome (with file downloads!) & Headless Firefox
tap "caskroom/cask"
cask "google-chrome"
cask "firefox"
brew "chromedriver"
brew "geckodriver"
@evertrol
evertrol / Makefiles.md
Last active April 1, 2024 19:11
Makefile cheat sheet

Makefile cheat sheet

Mostly geared towards GNU make

I've used ->| to indicate a tab character, as it's clearer to read than

  • Set a target, its dependencies and the commands to execute in order
target: [dependencies]
-&gt;| 
@matti
matti / add.sh
Created July 29, 2017 11:12
alpine docker add package from edge testing
apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \
x11vnc
@ryboe
ryboe / .travis.yml
Last active November 23, 2023 05:37
Example .travis.yml for Golang
# use the latest ubuntu environment (18.04) available on travis
dist: bionic
language: go
# You don't need to test on very old versions of the Go compiler. It's the user's
# responsibility to keep their compiler up to date.
go:
- 1.16.x
@FrankSpierings
FrankSpierings / README.md
Last active January 20, 2024 20:45
Linux Container Escapes and Hardening
@hassansin
hassansin / README.md
Last active February 14, 2024 17:09
Remote Debugging with XDebug 2.1

XDebug

A PHP extension that allows you to:

  1. walk through your code by Remote Debugging
  2. find bottlenecks in your application by Profiling
  3. find Code Coverage in a single request
  4. trace your application by logging all function calls
@sysboss
sysboss / trust.sh
Created May 15, 2017 14:05
Ultimately trust a public key non-interactively mode
#!/bin/bash
# Provide key uid from `gpg --list-keys`
# Based on: https://blog.tersmitten.nl/how-to-ultimately-trust-a-public-key-non-interactively.html
KEY_NAME=""
echo "$( \
gpg --list-keys --fingerprint \
| grep "${KEY_NAME}" -B 1 | head -1 \
| tr -d '[:space:]' | awk 'BEGIN { FS = "=" } ; { print $2 }' \