Skip to content

Instantly share code, notes, and snippets.

Bruno Bronosky RichardBronosky

Block or report user

Report or block RichardBronosky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
RichardBronosky / dnsmasq.conf
Last active Mar 12, 2019
Tools for masking/spoofing/proxying DNS
View dnsmasq.conf
#dnsmasq config, for a complete example, see:
#log all dns queries
#dont use host's hosts file
RichardBronosky / nginx.conf
Created Mar 1, 2019
An A/B testing work-in-progress
View nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
RichardBronosky /
Created Feb 8, 2019
Identify how similar a file is to each file in a group of others.
for fileB in "$@"; do
# diff once grep twice with the help of tee and stderr
diff $fileA $fileB | \
tee >(grep -cE '^< ' >&2) | \
grep -cE '^> ' >&2
RichardBronosky / source.bash
Last active Feb 8, 2019
A collection of tools for working with JS and JSON
View source.bash
* This script adds to your bash shell, a collection of tools for working with JS and JSON
* To install it, cd to where ever you checkout git repos and copy-paste the following line:
dst=jtools; git clone $dst && echo -e "\n[[ -f $(dirs +0)/$dst/source.bash ]] && source $(dirs +0)/$dst/source.bash" >> ~/.bash_profile
# converts serialized python to JSON
p2j() { python3 -c "import json, sys; print(json.dumps(eval("; }
RichardBronosky /
Last active Apr 10, 2019
A slightly Raspberry Pi specific Systemd service unit example.
service_desc="My Sample Service"
service_cmd="/usr/bin/python /home/pi/"
cat > /lib/systemd/system/$service_name <<EOF
RichardBronosky / net-check.service
Last active Jan 30, 2019
watches a URL and logs it
View net-check.service
Description=Network Status Monitor
ExecStart=/bin/bash -c '/usr/local/bin/ 15 >> /home/pi/net-check.log'
RichardBronosky /
Created Jan 25, 2019
Get ssh keys for Raspberry Pi from GitHub
sudo bash <<EOF
umask 077
mkdir -p ~$local_user/.ssh
curl -sSL${github_user}.keys >> ~$local_user/.ssh/authorized_keys
chown -R $(id -u $local_user):$(id -g $local_user) ~$local_user/.ssh
RichardBronosky / gist:1431516cdc378484942b6e2ffb8dd073
Created Jan 24, 2019
Undestroy vim on RPI Raspbian Stretch
View gist:1431516cdc378484942b6e2ffb8dd073
# This includes some apparent redundant calls to sudo.
# They are there to make sure that no mater which user executes these commands,
# both root and pi users get files with the right permissions.
# Fix bash
sudo -u pi touch ~pi/.bashrc
( sudo tee -a /home/pi/.bashrc | sudo tee -a /root/.bashrc > /dev/null ) << 'EOF'
set -o vi
export EDITOR=vim
RichardBronosky /
Created Jan 18, 2019 runs a comand at an internal and speaks when the status changes.
# This was a 5 minute hack.
# Currently assumes presence of `say` command (macOS). Make more OS tolerant. Possibly changing *_MSG to *_CMD
$0 runs a comand at an internal and speaks when the status changes.
Accepts optional ENV vars: SUCCESS_MSG and FAILURE_MSG
You can’t perform that action at this time.