Skip to content

Instantly share code, notes, and snippets.

View rringler's full-sized avatar

Ryan Ringler rringler

  • Google
  • San Francisco, CA
View GitHub Profile
@rringler
rringler / lpass-ssh
Created September 26, 2016 16:50
lpass-ssh
#!/bin/bash
# https://luzifer.io/blog/using-lastpass-to-unlock-ssh-keys/
KEY_NAME=$1
if ! ( which lpass > /dev/null ); then
echo "LastPass CLI is required."
exit 2
fi
@rringler
rringler / new_method.rb
Last active September 19, 2016 17:11
Case Insensitive String Matching
# Create a new predicate method
#
# Eg., 'ABC'.similar?('abc') # true
#
# Pros: Simple. Intention-revealing.
# Cons: No sugar.
module CoreExtensions
module String
def similar?(value)
#!/usr/bin/env bash
http GET http://pav.linkpc.net:881/cgi-bin/CGIProxy.fcgi \
'usr'=='admin' \
'pwd'=='${FOSCAM_PASSWORD}' \
'cmd'=='setAudioAlarmConfig' \
'isEnable'==1 \
'sensitivity'==1 \
'linkage'==138 \
'triggerInterval'==10 \
#!/usr/bin/env bash
http GET http://192.168.10.80:88/cgi-bin/CGIProxy.fcgi \
'usr'=='admin' \
'pwd'=='${FOSCAM_PASSWORD}' \
'cmd'=='setAudioAlarmConfig' \
'isEnable'==0 \
'sensitivity'==1 \
'linkage'==138 \
'triggerInterval'==10 \
10 3 * * 1,3,5 /tmp/custom.sh
@rringler
rringler / adblocker.sh
Last active September 19, 2016 03:21
adblocker.sh - adapted for dd-wrt
#!/bin/sh
# adblocker.sh - by Todd Stein ([email protected]), Saturday, October 25, 2014
# for use on routers running OpenWRT firmware
# Periodically download lists of known ad and malware servers, and prevents traffic from being sent to them.
# This is a complete rewrite of a script originally written by teffalump (https://gist.github.com/teffalump/7227752).
HOST_LISTS="