Skip to content

Instantly share code, notes, and snippets.

View bradparks's full-sized avatar

Brad Parks bradparks

  • Fredericton, New Brunswick, Canada
View GitHub Profile
@bradparks
bradparks / nexus_watch.sh
Created April 18, 2020 00:28 — forked from cpu/nexus_watch.sh
Watch a URL for a specific phrase, use Pushover to alert with back-off.
#!/bin/bash
# Pushover API key
TOKEN="PUSHOVER_API_KEY_HERE"
# List of device keys to push to
KEYS=( KEY_ONE KEY_TWO )
# Url to monitor
URL=https://play.google.com/store/devices/details?id=nexus_4_16gb
@bradparks
bradparks / web-servers-one-liner-static-server.md
Last active January 20, 2020 21:46 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@bradparks
bradparks / gist:2a27864347f98cdd4fb7a28caf19269d
Created November 18, 2019 14:27 — forked from jdoconnor/gist:6876052
loop through tmux windows, control c and exit
tmux list-window | awk -F":" '{system("tmux select-window -t "$1"; tmux send-keys C-c; tmux send-keys \"exit\"; tmux send-keys Enter")}'; tmux attach
@bradparks
bradparks / build-tmux.sh
Created October 29, 2019 10:28 — forked from mbreese/build-tmux.sh
HOWTO build a statically linked tmux in one script (downloads and builds dependencies from source)
#!/bin/bash
TARGETDIR=$1
if [ "$TARGETDIR" = "" ]; then
TARGETDIR=$(python -c 'import os; print os.path.realpath("local")')
fi
mkdir -p $TARGETDIR
libevent() {
curl -LO https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
tar -zxvf libevent-2.0.22-stable.tar.gz
@bradparks
bradparks / gitflow-breakdown.md
Created September 24, 2019 15:55 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@bradparks
bradparks / gist:027b449a3c84b52a5b04db2394e0e8fa
Last active April 30, 2019 12:06 — forked from siruguri/gist:66926b42a0c70ef7119e
Removing and setting constants in Ruby to avoid ssl errors for localhost
# You can wrap this so you onl run it when testing locally against localhost
# So only do this when running in DEV environment.
prev_setting = OpenSSL::SSL.send(:remove_const, :VERIFY_PEER)
OpenSSL::SSL.const_set(:VERIFY_PEER, OpenSSL::SSL::VERIFY_NONE)
@bradparks
bradparks / README.md
Created April 8, 2019 20:48 — forked from padawin/README.md
Stackoverflow #55496873
@bradparks
bradparks / GravityItem.cs
Created March 23, 2019 19:56 — forked from phosphoer/GravityItem.cs
Mario Galaxy Gravity for Unity
// The MIT License (MIT)
// Copyright (c) 2016 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
@bradparks
bradparks / automate_supply_password_apple_login_screen.sh
Created March 11, 2019 16:44 — forked from Gabelbombe/automate.sh
AppleScript to automate Keychain acceptance
function Accepts ()
{
osascript <<EOF
tell application "System Events"
repeat while exists (processes where name is "SecurityAgent")
tell process "SecurityAgent" to click button "Allow" of window 1
delay 0.2
end repeat
end tell
EOF
@bradparks
bradparks / app.js
Created March 2, 2019 13:46 — forked from satori99/app.js
This is a proof-of-concept for using ffmpeg as a HTTP video stream proxy that can reduce the volume of ad-breaks
/**
* This is a proof-of-concept for using ffmpeg as a HTTP video stream proxy
* that can reduce ad volume.
*
* It only works on streams containing SCTE35 data packets.
* You can check a stream using:
*
* ffmpeg -hide_banner -i <SOURCE_URL> 2>&1 | grep scte_35
*
* Start the demo: