Skip to content

Instantly share code, notes, and snippets.

var request = require('sync-request');
var ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36"
var res = request('GET', 'https://api.github.com/repos/cfry/dde/releases/latest', {
headers: { 'user-agent': ua}
})
@bcomnes
bcomnes / ddnsipv6.sh
Last active March 16, 2017 01:53
IPv6 DDNS client
#!/bin/bash
# https://community.ubnt.com/t5/EdgeMAX/IPv6-DDNS-script/td-p/1082829
run=/opt/vyatta/bin/vyatta-op-cmd-wrapper
domain=leaf.bret.io
key=DDNSAUTHKEY
updateurl="https://${domain}:${key}@ipv6.dyn.dns.he.net/nic/update?hostname=${domain}"
interface=eth1
lastipv6=`cat /config/ipv6address`
outsideipv6=`$run show interfaces ethernet $interface brief | grep "[0-9abcdef]*:[0-9abcdef:]*/"|tr -d '[:space:]'|cut -d/ -f1`
if test `find "/config/ipv6address" -mmin +10080` || [ "$lastipv6" != "$outsideipv6" ]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bcomnes
bcomnes / Brewfile
Last active February 21, 2017 00:49
tap 'caskroom/cask'
tap 'caskroom/fonts'
tap 'caskroom/versions'
tap 'homebrew/binary'
tap 'homebrew/boneyard'
tap 'homebrew/bundle'
tap 'homebrew/command-not-found'
tap 'homebrew/completions'
tap 'homebrew/core'
tap 'homebrew/dupes'
@bcomnes
bcomnes / npm-help-scripts
Last active January 31, 2017 19:09
npm prepublish changes
PREPUBLISH AND PREPARE
DEPRECATION NOTE
Since [email protected], the npm CLI has run the prepublish script for both npm publish
and npm install, because it's a convenient way to prepare a package for use (some
common use cases are described in the section below). It has also turned out to
be, in practice, very confusing https://github.com/npm/npm/issues/10074. As of
[email protected], a new event has been introduced, prepare, that preserves this existing
behavior. A new event, prepublishOnly has been added as a transitional strategy to
allow users to avoid the confusing behavior of existing npm versions and only run
on npm publish (for instance, running the tests one last time to ensure they're in
@bcomnes
bcomnes / gist:3257682194fc92087a74ee4972e9bcce
Created January 28, 2017 17:00
2017 New years reading list
# 2017 New Years Reading List
Here's what has my attention at the beginning of the new years.
@bcomnes
bcomnes / late-2016-reading.md
Last active April 17, 2021 20:07
Late 2016 Reading list
@bcomnes
bcomnes / delete-merged.sh
Created September 15, 2016 01:52
deletes merged branches
#!/usr/bin/env bash
git branch -r --merged |
grep origin |
grep -v '>' |
grep -v 'master' |
xargs -L1 |
awk '{sub(/origin\//,"");print}' |
xargs git push origin --delete