Skip to content

Instantly share code, notes, and snippets.

View b0wter's full-sized avatar

b0wter

View GitHub Profile
@b0wter
b0wter / up-test.sh
Created October 3, 2019 19:21
Use bash to check if a CouchDb container finished starting
#!/usr/bin/env bash
#
# Curls couch dbs /up endpoint every ten seconds and waits for it to return status code 200.
# You can define a command that is run once the check completed successfully.
#
if [ "$#" -eq 0 ]; then
echo "Usage: up-test.sh <host> <port> [command]"
echo ""
@b0wter
b0wter / push.sh
Created October 3, 2019 19:18
Send Pushover notifications using bash
#!/bin/bash
APP_TOKEN="<<<INSERT YOUR APP TOKEN HERE>>>"
USER_TOKEN="<<<INSERT YOUR USER TOKEN HERE>>>"
if [ $# -eq 0 ]; then
echo "Usage: ./push [--title=...] <message>"
echo ""
echo "If your title is longer than a single word you need to quote it."
echo "The title needs to be the FIRST argument you pass."
echo "All remaining arguments will be sent to the pushover api as a single message."
@b0wter
b0wter / update_gitignore.sh
Created May 11, 2019 20:07
Creates a .gitignore for all text files in a given directory ($BIN_FOLDER).
#!/usr/bin/env bash
#
# Creates a .gitignore for all text files in a given directory ($BIN_FOLDER).
#
BIN_FOLDER=/home/b0wter/bin
rm "$BIN_FOLDER/.gitignore"
echo "Triggering ntp sync, this will take about 10 seconds."
timedatectl set-ntp false
sleep 5
timedatectl set-ntp true
sleep 5
git clone https://github.com/b0wter/fedora_bootstrap.git ~/bootstrap
cd bootstrap
chmod +x ./bootstrap.sh
cd ..
./bootstrap/bootstrap.sh
@b0wter
b0wter / packets.md
Created April 23, 2018 07:29
Useful Nuget packages.