Skip to content

Instantly share code, notes, and snippets.

View chetstone's full-sized avatar

Chester Wood chetstone

View GitHub Profile
@chetstone
chetstone / rvm.rb
Created November 12, 2011 21:31
Using rvm with tcsh
#!/usr/bin/env ruby
# riffing on a tune by Paul at po-ru.com
# 1. Using a bash shell, install rvm according to instructions.
# 2. Install this script in your path, say in ~/bin.
# 3. Make it executable.
# 4. Add the following alias to your .tcshrc:
# alias rvm 'eval `~/bin/rvm.rb \!*`'
# 5. Use and enjoy rvm in your tcsh
# Note that this script relies on a ruby already installed in the path.
# It shouldn't be too hard to enhance it to bootstrap itself using rvm.
@chetstone
chetstone / .forward
Last active January 4, 2016 12:40
Forwarding Ubiquiti AirVision2 (linux) Motion Alerts based on regions
# Exim filter
# The first line above must be exactly like that.
#
# Since Airvision2 only has a provision to send email notifications for all regions or none,
# we add this kludge to forward emails based on the region name included in the email.
# Basic steps are these:
# 1. Install a mail server on your ubuntu/debian box if it's not there already. (Not as hard as it sounds.)
# 2. Configure it to forward nonlocal mail to a smarthost.
# 3. Add a user account to Airvision to send notifications to the admin account on the local host.
# 4. Install this file (.forward) in the admin account home directory. (Must be writeable only to the user.)
#!/bin/bash
# This script automatically sets the version and short version string of
# an Xcode project from the Git repository containing the project.
#
# To use this script in Xcode, add the script's path to a "Run Script" build
# phase for your application target.
set -o errexit
set -o nounset
@chetstone
chetstone / Prettier-emacs-config.md
Last active July 1, 2017 19:37
Configurable per-project options for [prettier-emacs](https://github.com/prettier/prettier-emacs)

Given an invocation of prettier in package.json like this:

  "scripts": {
    "prettier": "prettier --write --single-quote --no-semi --trailing-comma es5 --print-width 80 \"*.js\""
  },

Move the options to a config variable like this:

 "scripts": { 
# cat /var/log/messages
Jul 9 22:51:07 resol-dl2 syslog.info syslogd started: BusyBox v1.9.2
Jul 9 22:51:07 resol-dl2 daemon.info init: init: starting pid 772, tty '/dev/null': '/sbin/klogd'
Jul 9 22:51:07 resol-dl2 daemon.info init: init: starting pid 773, tty '/dev/tty3': '/usr/bin/tail'
Jul 9 22:51:07 resol-dl2 authpriv.info dropbear[763]: Running in background
Jul 9 22:51:07 resol-dl2 user.notice kernel: klogd started: BusyBox v1.9.2 (2010-06-26 22:19:34 CEST)
Jul 9 22:51:07 resol-dl2 user.notice kernel: Linux version 2.6.22.1 (daniel@diablo3.resol.de) (gcc version 4.2.1) #1 Sun Jun 27 06:22:13 CEST 2010
Jul 9 22:51:07 resol-dl2 user.warn kernel: CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
Jul 9 22:51:07 resol-dl2 user.warn kernel: Machine: Atmel AT91SAM9260-EK
Jul 9 22:51:07 resol-dl2 user.warn kernel: Memory policy: ECC disabled, Data cache writeback
@chetstone
chetstone / Update_DL2_to_1_4_7.md
Last active September 10, 2017 08:54
Update DL2 firmware from 1.4.4 to 1.4.7

DL2 Update

The trouble is the instructions on the Resol website for this update are wrong. I found helpful instructions on the way back machine, but even those had to be adjusted.

Here's what worked for me:

  1. Make sure you are on firmware version 1.4.5 or lower. Go to http://192.168.1.100/cgi-bin/get_resol_device_information (replace 192.168.1.100 with your DL2’s IP address)
  2. Format your SD card. Formatting on the Mac with MS-DOS(FAT) didn’t work for me. I ended up formatting it on my Panasonic camera.
  3. Insert the freshly-formatted card into the DL2, wait till the flashing green light turns solid. . .
@chetstone
chetstone / mongoinstall.html
Last active November 9, 2017 18:35
Installing mongoldb on mac with homebrew
Install MongoDB on Mac OS X Yosemite
by César Trigo · November 6, 2014
from mongodbspain: http://web.archive.org/web/20141121161054/http://www.mongodbspain.com/en/2014/11/06/install-mongodb-on-mac-os-x-yosemite/
OS X Yosemite
Install MongoDB in our Mac is something simple and easy. There are two ways to install MongoDB under Mac OS X:
Manually, through the official binaries
@chetstone
chetstone / README.md
Last active June 6, 2018 19:55
Notes on provider change from Colorado Central Telecom to Cielo

I have been considering using a new DNS server which was written up in USA today, quad9. They do threat analysis and block nefarious sites. Yesterday morning I was doing some pinging of quad9 and Google DNS on Colorado central telecom. I repeated the ping tests after the Cielo install.

They show that Cielo has 2 to 3 times the latency, and a lot more jitter. I wonder if this could be related to DSLReport bufferbloat grade of 'F'.? Probably not, I doubt if ICMP packets are buffered.

@chetstone
chetstone / nuke-firebase-db-and-users-referenced-therein.js
Last active September 24, 2018 22:13 — forked from cliffhall/nuke-firebase-db-and-users-referenced-therein.js
Nuke a Firebase Database and All User Accounts Referenced Therein
// This fork limits deletion to the first 10 users
// and deletes the data for each user separately (rather than wiping the whole database)
// Because of the firebase quota of 10 deletions/second.
// https://firebase.google.com/docs/auth/limits
// NOTE: Accounts that are not represented in your /users node will not be deleted!
// BLOG: There are other approaches, see: http://cliffordhall.com/2017/04/nuke-firebase-db-and-all-users/
'use strict';
// Get credentials and initialize firebase app
console.log(
@chetstone
chetstone / patch33x.sh
Created April 15, 2018 23:29
Patching React-Native in a script run by npm/yarn postinstall
#!/bin/sh
# Fix RN version 33
yarn list react-native |grep react-native |grep 0.33
if [ $? -eq 0 ];
then
echo "Checking that ReactNative v 33 is patched"
cd node_modules/react-native
patch -N -p1 --dry-run --silent < ../../notes/rn33.3x.patch >/dev/null 2>&1
if [ $? -eq 0 ];