Skip to content

Instantly share code, notes, and snippets.

View laprice's full-sized avatar

Larry Price laprice

View GitHub Profile
@laprice
laprice / Bitcoin to Big Mac
Created November 8, 2013 07:09
Calculates cost of a Big Mac in BTC
{
"metadata": {
"name": "Big Mac to BTC"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@laprice
laprice / do_playbook.yml
Last active December 28, 2015 22:39
Functioning playbook to create a VM on digital ocean. Substitute your ssh_key_ids and image_id and run as is. You will need dopy installed.
---
- hosts: 127.0.0.1
connection: local
gather_facts: false
tasks:
- name: start a droplet
local_action: digital_ocean
state=present
ssh_key_ids=#,#,#
command=droplet
@laprice
laprice / gist:8345358
Created January 10, 2014 01:20
I think I am doing the correct thing...
{
"metadata": {
"name": "Untitled1"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@laprice
laprice / aaronsw_petition_analysis.ipynb
Created January 10, 2014 06:41
aaronsw petition one year later.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
gistup
package main
import (
_ "github.com/lib/pq"
"database/sql"
)
import "os"
import "log"
alter table test add column tsv tsvector;
update test set tsv = to_tsvector('english',tune::text);
create index test_tsv_ts_idx on test using gin(tsv);
-- note that this is a full text index on the full json object not a selection of keys.
@laprice
laprice / gist:e9be53d0263a398e4cf1
Created January 6, 2015 19:52
block ips not in north-america from connecting to port 25 ( blunt-instrument )
# Generated by iptables-save
*filter
:INPUT ACCEPT [5452:537465]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [6729:868771]
-A INPUT -s 202.0.0.0/8 -p tcp -m tcp --dport 25 -j DROP
-A INPUT -s 0.0.0.0/4 -p tcp -m tcp --dport 25 -j DROP
-A INPUT -s 16.0.0.0/6 -p tcp -m tcp --dport 25 -j DROP
-A INPUT -s 20.0.0.0/7 -p tcp -m tcp --dport 25 -j DROP
-A INPUT -s 22.0.0.0/8 -p tcp -m tcp --dport 25 -j DROP
@laprice
laprice / exclusive_subscription.md
Last active August 29, 2015 14:17
Ethereum DApp Spec.

#summary: A contract to sell a regular update of a small (max 8kb) piece of information for n periods to an audience of at most m subscribers.

#requirements:

  • The publisher must deliver the updates to receive payment.
  • The information must be encrypted in transit.
  • It must not be possible for a non-subscriber to access the information.
  • Contracts must be transferable after creation.
  • Subscribers must be able to transfer their interest in the update stream; an act which must prevent the seller from accessing the updates once the contract has been sold.
  • All of the subscribers must be able to access their updates simultaneously.
for chunk in $( find . -type f -name "*.txt" ); do wc $chunk;echo $chunk; echo "---";done
6 26 205 ./assets/dramatis.txt
./assets/dramatis.txt
---
93 893 5108 ./assets/nerve_slaves_of_the_sky_lords.txt
./assets/nerve_slaves_of_the_sky_lords.txt
---
91 828 4901 ./chapters/chapter_1.txt
./chapters/chapter_1.txt
---