Skip to content

Instantly share code, notes, and snippets.


Ben Yanke benyanke

View GitHub Profile
benyanke / .bashrc 6-8-2019
Created Jun 9, 2019 — forked from ageis/.bashrc 02-25-2020
@ageis's ~/.bashrc 🖥️ with numerous useful functions, aliases and one-liners. ⚠️ NOTE: many paths in sourced scripts and environment variables are specific to my system, but if you dig in I hope you'll find something you can use!
View .bashrc 6-8-2019
#~/.bashrc: executed by bash(1) for non-login shells.
# kevin gallagher (@ageis) <>
export MYUID=$(id -u)
export USER="$(id -un)"
if [[ "$TILIX_ID" ]] || [[ "$VTE_VERSION" ]]; then
source /etc/profile.d/
benyanke / boxstarter.ps1
Created Nov 30, 2017 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
View boxstarter.ps1
# Description: Boxstarter Script
# Author: Jess Frazelle <>
# Last Updated: 2017-09-11
# Install boxstarter:
# . { iwr -useb } | iex; get-boxstarter -Force
# You might need to set: Set-ExecutionPolicy RemoteSigned
# Run this boxstarter by calling the following from an **elevated** command-prompt:
benyanke / sns-to-slack.js
Last active Feb 5, 2019 — forked from vgeshel/function.js
AWS Lambda function for forwarding SNS notifications to Slack
View sns-to-slack.js
// Added by Ben Yanke
// from
console.log('Loading function');
const https = require('https');
const url = require('url');
// urlToUse = in this environment variable, place the name of another environment variable which contains the key.
// This allows easy dev/prod switching.
benyanke /
Created Apr 5, 2017 — forked from KartikTalwar/
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
benyanke / post-receive
Created Mar 29, 2017 — forked from AnthumChris/post-receive
Git Push to Deploy — Instantly deploy your local Git repository to your remote web server
View post-receive
# This script will push your local repository's latest commit to a remote repository on your server.
# It's useful for quickly pushing your local changes to deployment servers (Dev, Stage, Prod/Live, etc.)
# This file should be placed in your remote server's project's git hooks folder and named .git/hooks/post-receive.
# Security reminder: Your web server should not allow access to the /.git folder URL
# Ensure that this script is executable:
# $ chmod +x .git/hooks/post-receive
benyanke /
Created Mar 16, 2017 — forked from yoavram/
Example of uploading binary files programmatically in python, including both client and server code. Client implemented with the requests library and the server is implemented with the flask library.
import requests
url = "http://localhost:5000/"
fin = open('simple_table.pdf', 'rb')
files = {'file': fin}
r =, files=files)
print r.text
benyanke /
Created Feb 16, 2017 — forked from oodavid/
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
    • apache's home directory is /var/www/
benyanke / ip_in_range.php
Created Jul 11, 2016 — forked from tott/ip_in_range.php
php check if IP is in given network range
View ip_in_range.php
* Check if a given ip is in a network
* @param string $ip IP to check in IPV4 format eg.
* @param string $range IP/CIDR netmask eg., also is accepted and /32 assumed
* @return boolean true if the ip is in this range / false if not.
function ip_in_range( $ip, $range ) {
if ( strpos( $range, '/' ) == false ) {
$range .= '/32';
benyanke /
Created Jul 3, 2016
update an A record in digital Ocean ( Dynamic DNS style
#update an A record in digital Ocean. Dynamic DNS style.
#API info here:
#your domain ID
#record to update
#digitalocean client_id
benyanke /
Created Jun 23, 2016 — forked from greg76/
simple shell script to run pocketmine as a service/daemon
# Provides: pocketmine
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
You can’t perform that action at this time.