Skip to content

Instantly share code, notes, and snippets.

View thomasgroch's full-sized avatar

Thomas Dev thomasgroch

View GitHub Profile
- hosts: localhost
connection: local
gather_facts: no
sudo: no
vars:
homebrew_taps:
- homebrew/binary
- homebrew/versions
- homebrew/dupes
- homebrew/dupes
@thomasgroch
thomasgroch / user-data.sh
Created June 13, 2020 19:18 — forked from jbussdieker/user-data.sh
Bootstrap using salt
#!/bin/bash
SALT_FORMULA_HASH=7abdf217a99d70344b6d936375e802837276a2a3
rpm --import https://repo.saltstack.com/yum/redhat/6/x86_64/latest/SALTSTACK-GPG-KEY.pub
cat >/etc/yum.repos.d/saltstack.repo <<EOS
[saltstack-repo]
name=SaltStack repo for RHEL/CentOS 6
baseurl=https://repo.saltstack.com/yum/redhat/6/\$basearch/latest
enabled=1
gpgcheck=1
gpgkey=https://repo.saltstack.com/yum/redhat/6/\$basearch/latest/SALTSTACK-GPG-KEY.pub

Pi-hole scripts in Docker

  • Pihole run script
  • Pihole service script
@thomasgroch
thomasgroch / README.md
Created June 4, 2020 08:42 — forked from HarryUPf/README.md
Raspberry Pi SunVox Headless Synth (in 10 easy steps)

Raspberry Pi SunVox Headless Synth Setup (in 10-easy-steps)

INSTRUCTIONS

STEP_01

STEP_02

  • write the extracted .img to sdcard with Etcher

STEP_03

@thomasgroch
thomasgroch / myusbgadget
Created June 4, 2020 08:27 — forked from geekman/myusbgadget
Pi Zero multiple USB gadgets minimal example
#!/bin/bash -e
modprobe libcomposite
cd /sys/kernel/config/usb_gadget/
mkdir g && cd g
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
@thomasgroch
thomasgroch / parse_heroku.sh
Created June 1, 2020 22:28
Solution to parse Heroku DB on bash
if [[ -n "${DATABASE_URL}" ]]; then
parse_dsn() {
declare dsn=$1 part=$2
php -r 'echo parse_url($_SERVER["argv"][1], constant("PHP_URL_" . strtoupper($_SERVER["argv"][2])));' -- "${dsn}" $part
}
host=$(parse_dsn "${DATABASE_URL}" host)
port=$(parse_dsn "${DATABASE_URL}" port)
database=$(parse_dsn "${DATABASE_URL}" path); database=${database:1}
user=$(parse_dsn "${DATABASE_URL}" user)
#!/bin/bash
set -euo pipefail
parse_dsn() {
declare dsn=$1 part=$2
php -r 'echo parse_url($_SERVER["argv"][1], constant("PHP_URL_" . strtoupper($_SERVER["argv"][2])));' -- "$dsn" $part
}
@thomasgroch
thomasgroch / dev.md
Created May 28, 2020 06:39 — forked from genadyp/dev.md
dev development software engineering

API

awesome-api - A curated list of awesome resources for design and implement RESTful API's

public-apis - A collective list of free APIs for use in software and web development

postwoman - A free, fast and beautiful API request builder (web alternative to Postman)

// in your .env file, split APP_URL to extract protocol and hostname
APP_PROTOCOL=https
APP_HOSTNAME=myapp.test
APP_URL="${APP_PROTOCOL}://${APP_HOSTNAME}"
// install dotenv
npm install dotenv
@thomasgroch
thomasgroch / .aliases.zsh
Created February 20, 2020 21:10 — forked from mohitmun/.aliases.zsh
Art of command line, all things related to command line and dotfiles
# GistID:963f95aaf61d50e512511ac4eb097e50
function add_alias() {
if [[ -z $1 || -z $2 || $# -gt 2 ]]; then
echo usage:
echo "\t\$$0 ll 'ls -l'"
else
echo "alias $1='$2'" >> $ALIASFILE
echo "alias ADDED to $ALIASFILE"
alias $1="$2"
fi