Skip to content

Instantly share code, notes, and snippets.

View nmarley's full-sized avatar
🦀
我想吃一點點東西。

Nathan Marley nmarley

🦀
我想吃一點點東西。
View GitHub Profile
@nmarley
nmarley / gist:e8549f5f61587f55c153a0fe44b69397
Created June 4, 2018 02:18
Git log show author & committer
git log --pretty="%H author: %an <%ae>, committer: %cn <%ce>"
@nmarley
nmarley / facebook-contact-info-summary.rb
Created March 23, 2018 03:44 — forked from dylanmckay/facebook-contact-info-summary.rb
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /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
nmarley / facebook-contact-info-summary.rb
Created March 23, 2018 03:44 — forked from dylanmckay/facebook-contact-info-summary.rb
A Ruby script for collecting phone record statistics from a Facebook user data dump
#! /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
nmarley / Effective_Engineer.md
Last active February 8, 2018 02:21 — forked from rondy/Effective_Engineer.md
Effective_Engineer.md

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
nmarley / ipfs-peer-id.js
Created November 24, 2017 23:50
JavaScript Example: Get IPFS PeerID via API using js-ipfs-api
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
nmarley / static-gen.sh
Last active September 28, 2017 19:04
Generate a static site from a WordPress site using wget
#! /bin/bash
wget -mk http://kotblog.dash.org/
@nmarley
nmarley / x.sh
Created September 28, 2017 19:04
Generate a static site from a WordPress site using wget
zy
@nmarley
nmarley / curl-websocket.sh
Created September 8, 2017 09:50 — forked from htp/curl-websocket.sh
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
@nmarley
nmarley / Dockerfile
Last active October 11, 2017 20:33
DigitalOcean API Query Script
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/*
WORKDIR /app
COPY Gemfile Gemfile.lock query-resources.rb /app/
RUN gem install bundler
@nmarley
nmarley / do-tagsplit.sh
Created August 7, 2017 03:58
DigitalOcean tag splitter
#! /bin/bash
# TAGLIST=$(curl -s 169.254.169.254/metadata/v1/tags/)
TAGLIST="ansible-role:02-openvpn ansible-role:01-common app:OpenVPN name:testtagger01"
ROLE_TAGS=()
for T in $TAGLIST; do
IFS=:
read -r Key Value <<< "$T"
if [ "ansible-role" = "${Key}" ]; then
ROLE_TAGS+=($Value)