Skip to content

Instantly share code, notes, and snippets.

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

Nathan Marley nmarley

🦀
我想吃一點點東西。
View GitHub Profile
@nmarley
nmarley / parse_wci.rb
Last active August 29, 2015 14:19
WorldCoinIndex parser
require 'nokogiri'
require 'bigdecimal'
require 'bigdecimal/util'
require 'ap'
require 'pp'
def text_to_number(text)
val = text.dup
val.gsub!(/\s+/, '')
@nmarley
nmarley / analyze-tarsnap-usage.rb
Last active August 29, 2015 14:20
Analyse Tarsnap Usage
require 'open3'
require 'pp'
def get_stats(archive_name)
cmd = "sudo tarsnap --print-stats -f #{archive_name}"
stats = run_cmd(cmd)[3,4]
end
def get_uniq_comp_size(stats)
stats.last.split(/\s+/)[-1]
@nmarley
nmarley / check.rb
Last active August 29, 2015 14:21
Domain Expiration Checker
#! /usr/bin/env ruby
require 'whois'
require 'date'
require 'time'
require 'pp'
require 'awesome_print'
class Chequer
def initialize
@nmarley
nmarley / fresh-cats.json
Last active August 29, 2015 17:44
Freshbooks Category list - 2015-08-29
[
{
"category_id": "00002254911",
"name": "Other Expenses",
"parent_id": null
},
{
"category_id": "00002254912",
"name": "Reference Materials",
"parent_id": "00002254911"
@nmarley
nmarley / README.md
Last active August 31, 2015 16:04
Sett print stylesheet suggestion

Print stylesheet for SETT blogs - hide print obstructions

Stylesheet for removing HTML elements from SETT blogs which obstruct printing and making it easy to print/render to PDF format.

Because blue light from computer screens is hard on my eyes, I like to print longer web pages/posts and read them on paper. But sometimes it's hard to print without using the developer tools and stripping away elements from the HTML manually.

@nmarley
nmarley / README.md
Last active October 1, 2015 13:54
Dash upgrade script(s)

Dash upgrade scripts.

Steps:

  1. Update location/file version in script 'prep-dash-release.sh'.
  2. Then distribute prep-dash-release.sh script by executing 'dist.sh'
  3. If any new masternodes are added, add them to dist.sh
  4. Login to individual servers and run:
@nmarley
nmarley / LICENSE
Last active October 5, 2015 00:45
Dash binary downloads - check most recent version
The MIT License (MIT)
Copyright (c) 2015 Nathan Marley
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@nmarley
nmarley / dash.service
Created October 20, 2015 19:16
INCOMPLETE systemd dashd service script
[Unit]
Description=Dash server
After=syslog.target
After=network.target
[Service]
Type=forking
User=<dash user>
Group=<dash group>
ExecStart=<dash_path>/dashd
@nmarley
nmarley / run.sh
Last active October 25, 2015 17:35
Ansible ssh host key scan and set variable
#! /bin/bash
ansible-playbook -e hostname=github.com ssh-host-key-lookup.yml
@nmarley
nmarley / .gitignore
Created November 15, 2015 01:57
Poloniex examples in Ruby with 'poloniex' gem.
.env