Skip to content

Instantly share code, notes, and snippets.


Nathan Marley nmarley

View GitHub Profile
nmarley / facebook-contact-info-summary.rb
Created Mar 23, 2018 — forked from dylanmckay/facebook-contact-info-summary.rb
A Ruby script for collecting phone record statistics from a Facebook user data dump
View facebook-contact-info-summary.rb
#! /usr/bin/env ruby
# This script can be used to parse and dump the information from
# the 'html/contact_info.htm' file in a Facebook user data ZIP download.
# It dumps all cell phone call + SMS message + MMS records, plus a summary of each.
# Place this script inside the extracted Facebook data download folder
# alongside the 'html' folder.
nmarley /
Last active Feb 8, 2018 — forked from rondy/

FWIW: I didn't produce the content present here. I've just copy-pasted it from somewhere over the Internet, but I cannot remember exactly the original source. I was also not able to find the author's name, so I cannot give him/her the proper credit.

Effective Engineer - Notes

What's an Effective Engineer?

nmarley / ipfs-peer-id.js
Created Nov 24, 2017
JavaScript Example: Get IPFS PeerID via API using js-ipfs-api
View ipfs-peer-id.js
const ipfsAPI = require('ipfs-api')
let ipfs = ipfsAPI('localhost', '5001')
ipfs.config.get('Identity.PeerID', (err, peerid) => {
if (err) { throw err }
console.log("PeerID = [" + peerid + "]")
nmarley /
Last active Sep 28, 2017
Generate a static site from a WordPress site using wget
#! /bin/bash
wget -mk
nmarley /
Created Sep 28, 2017
Generate a static site from a WordPress site using wget
nmarley /
Created Sep 8, 2017 — forked from htp/
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host:" \
--header "Origin:" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
nmarley / Dockerfile
Last active Oct 11, 2017
DigitalOcean API Query Script
View Dockerfile
FROM alpine:3.5
RUN /bin/echo 'set -o vi' >> /etc/profile
RUN /bin/echo 'gem: --no-document' > /etc/gemrc
RUN apk update && apk upgrade && apk add --no-cache ruby ruby-dev ruby-io-console ruby-bigdecimal ruby-json ca-certificates && rm -fr /var/cache/apk/*
COPY Gemfile Gemfile.lock query-resources.rb /app/
RUN gem install bundler
nmarley /
Created Aug 7, 2017
DigitalOcean tag splitter
#! /bin/bash
# TAGLIST=$(curl -s
TAGLIST="ansible-role:02-openvpn ansible-role:01-common app:OpenVPN name:testtagger01"
for T in $TAGLIST; do
read -r Key Value <<< "$T"
if [ "ansible-role" = "${Key}" ]; then
nmarley /
Created Jul 27, 2017
DigitalOcean cloud-init metadata IP address helper script
#! /bin/bash
# DigitalOcean cloud-init metadata IP address helper script
PUBLIC_IPV4="$(curl -fs -m 2 $METADATA_URL/v1/interfaces/public/0/ipv4/address)"
ANCHOR_IPV4="$(curl -fs -m 2 $METADATA_URL/v1/interfaces/public/0/anchor_ipv4/address)"
FLOATING_ACTIVE="$(curl -fs -m 2 $METADATA_URL/v1/floating_ip/ipv4/active)"
FLOATING_IPV4="$(curl -fs -m 2 $METADATA_URL/v1/floating_ip/ipv4/ip_address)"
nmarley /
Created Jul 10, 2017
"Perl stat" -- really old, saving here, but removing from hard drive
#! /usr/bin/perl
use strict;
use warnings;
use feature qw(say);
use Data::Dumper;
use File::Slurp;
use Carp;
use Fcntl ':mode';
use DateTime;