Skip to content

Instantly share code, notes, and snippets.

View pblittle's full-sized avatar

P. Barrett Little pblittle

View GitHub Profile
@mbierman
mbierman / addremotesyslog.sh
Last active May 27, 2024 10:35
Add a remote syslog server to Firewalla
#!/bin/bash
# v 2.1.0
syslog=/etc/rsyslog.d/09-externalserver.conf
# this logs notice and above. use *.* log everything.
filter=*.notice
server=192.168.0.19 # Change the server to the IP of your syslog server.
port=514
hostname=firewalla
valid=$(grep "$server:$port" $syslog 2>/dev/null)
@alexbosworth
alexbosworth / inotify-channel-backup.md
Last active March 29, 2024 01:33
Backup channel.backup file using systemd and inotify

LND backup script for channel.backup using inotify

Install inotify

sudo apt install inotify-tools

Create script to watch for changes and copy on change

A description of known problems in Satoshi Nakamoto's paper, "Bitcoin: A Peer-to-Peer Electronic Cash System", as well as notes on terminology changes and how Bitcoin's implementation differs from that described in the paper.

Abstract

The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power.

@chris-belcher
chris-belcher / JMalert.md
Last active May 31, 2023 05:07
JoinMarket release 0.2.0 ameliorates this snooping attack.

Keybase proof

I hereby claim:

  • I am pblittle on github.
  • I am pblittle (https://keybase.io/pblittle) on keybase.
  • I have a public key ASCcLVaRmtIgqYFDdGLevHMO2S19-z-q84Nfa7Eb9UfbAwo

To claim this, I am signing this object:

@rkoster
rkoster / bosh_jobs_dependencies.rb
Created August 11, 2015 09:47
A script for displaying the job dependencies of the cf-relase in a markdown table.
#! /usr/bin/env ruby
# coding: utf-8
require 'yaml'
jobs = Dir['jobs/*'].map { |j| File.basename(j) }
print "∑ | Job | Property | Description\n --- | --- | --- | ---\n"
jobs.map! do |job|
spec = YAML.load_file(File.join("jobs", job, "spec"))
@drnic
drnic / rebind-apps.rb
Created May 22, 2015 22:12
Rebind all applications for a Cloud Foundry service
#!/usr/bin/ruby
require 'rubygems'
require 'json'
require 'pp'
# for the #sh helper
require "rake"
require "rake/file_utils"
include FileUtils
## PREREQ: Using CF cli tools, make sure you've logged in as a user (admin) who can see all orgs/spaces
@ryanjbaxter
ryanjbaxter / bluegreen.sh
Last active May 16, 2018 20:14
Blue/Green Deployment Script
#!/bin/bash
#
# This product includes software originally developed by IBM Corporation.
#
#
# Copyright IBM Corp. 2015
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@pblittle
pblittle / bosh-ssh
Created December 18, 2014 14:59
Bosh SSH w/ Gateway Host
bosh ssh api_z1 --gateway_user vcap --gateway_identity_file ~/.ssh/id_rsa_bosh --gateway_host micro.run.example.com
@jbeda
jbeda / gist:16191ad2cec4835de40b
Last active May 10, 2019 11:48
IP CIDR math in bash
function increment_ipv4 {
local ip_base=$1
local incr_amount=$2
local -a ip_components
local ip_regex="([0-9]+).([0-9]+).([0-9]+).([0-9]+)"
[[ $ip_base =~ $ip_regex ]]
ip_components=("${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" "${BASH_REMATCH[3]}" "${BASH_REMATCH[4]}")
ip_dec=0
local comp
for comp in "${ip_components[@]}"; do