Skip to content

Instantly share code, notes, and snippets.

@dmerrick
dmerrick / poc.rb
Created September 24, 2014 23:46
Use encrypted data bags without chef
#!/usr/bin/env ruby
# this is a proof-of-concept for reading encrypted data bags
# from a ruby script. you only need chef to be installed.
require 'rubygems'
require 'chef/rest'
require 'chef/encrypted_data_bag_item'
# prevent chef from trying to contact a server
Chef::Config[:solo] = true
@dmerrick
dmerrick / workspace.yml
Last active October 16, 2016 00:30
~/.tmuxinator/workspace.yml
# ~/.tmuxinator/workspace.yml
name: workspace
root: ~/
# Optional tmux socket
# socket_name: workspace
# Runs before everything. Use it to start daemons etc.
# pre: sudo /etc/rc.d/mysqld start
#!/bin/bash
black='\e[47m'
red='\e[31;41m'
blue='\e[34;44m'
blueonred='\e[34;41m'
reset='\e[0m'
echo -e "${blue}iiiiii${reset} ${blueonred}@@@@@@${red}llllllll${reset} ${red}lllll${blueonred}@@@@@@${red}lllll${reset} ${red}lllll${blueonred}@@@@@@${red}lllll${reset} ${red}lllll${blueonred}@@@@@@${red}lllll${reset}"
echo -e "${blue}iiiiii${reset} ${blueonred}@@@@@@${red}llllllll${reset} ${red}lllll${blueonred}@@@@@@${red}lllll${reset} ${red}lllll${blueonred}@@@@@@${red}lllll${reset} ${red}lllll${blueonred}@@@@@@${red}lllll${reset}"
#!/usr/bin/env ruby
require 'rubygems'
require 'json'
require 'open-uri'
require 'slack-notifier'
# use the turtle subreddit
turtles = "http://www.reddit.com/r/turtle.json"
json = JSON.load(open(turtles))
# in stratum-mining-proxy project
python setup.py install
cd midstatec && make && cd ..
./mining_proxy.py -o mining.eligius.st -p 3334 --custom-user 1JT86GVai2r7sixvsJfJxNWHon9Dep2erh
#TODO: figure out if we can remove midstate (-nm)
# run both:
#FIXME: change the wallet addresses
./mining_proxy.py -v -o mining.eligius.st -p 3334 -gp 8333 -sp 3333 --custom-user 1Do6mZGbXcRutqVxaMbdoiQrYNSQrfVuA4 --custom-password whatever
./mining_proxy.py -v -o mining.eligius.st -p 3334 -gp 8334 -sp 3334 --custom-user 1DQeV5UiVhHge95aT1vwgkMGngEtjX2ZLZ --custom-password whatever
@dmerrick
dmerrick / bitcoin_mining_example.rb
Created November 5, 2013 18:17
this is a simple script to generate checksums and find ones that start with zeros. when a matching checksum is found, it outputs it and looks for the a checksum with one more zero.
# this is a simple script to generate checksums and
# find ones that start with zeros. when a matching
# checksum is found, it outputs it and looks for
# the a checksum with one more zero.
# you can see in the output below that it took only
# 9 tries to find a checksum with one zero, and it
# took 6132845 tries to find one with six zeros.
# example output:
@dmerrick
dmerrick / config.ru
Created October 17, 2013 22:19
extremely simple config.ru
use Rack::Static,
:urls => ["/css", "/js", "/images"],
:root => "public"
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
"fade_fold_buttons": false,
"font_size": 12.0,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
bitcoin_earnings
@dmerrick
dmerrick / raid.md
Last active December 21, 2015 06:39

Background: I have a 2TB Apple Time Capsule that I've been using to store my media. I use BitTorrent a lot, through private trackers exclusively, and I use a Netherlands-based seedbox. Recently my seedbox was upgraded from 400GB storage to 1.35TB, and I that made me download a lot more (movies and season packs of TV shows, mainly).

I filled my Time Capsule pretty fast and went looking for the next step. I decided to get a RAID array and did a few weeks of research. I didn't want to have to spend a lot of time setting up the RAID, so I looked at the sexpensive options like Drobo and ReadyNAS. I really wanted to use ZFS because that's the new hotness, but even with the easy-to-use options, it seemed like more work than I really wanted to put in.

I ended up settling on the [Synology DS1813+](http://www.synology.com/products/product.php?product_name=DS1813%2B&lan