Skip to content

Instantly share code, notes, and snippets.

@hsunami
hsunami / add_user.yml
Last active February 24, 2017 08:05
Ansible script to add user to edge node and HDFS
---
- hosts: edge
sudo: True
vars:
users: [hsunami]
tasks:
- name: Create users
with_items: "{{ users }}"
user:
@hsunami
hsunami / todos.js
Created July 20, 2016 16:59
TodoMVC Reducer Example
import { createReducer } from 'redux-act'
import Immutable from 'seamless-immutable'
import * as Actions from '../actions/todos'
const initialState = Immutable([
{
text: 'Use Redux',
completed: false,
id: 0
}
@hsunami
hsunami / System Design.md
Created April 18, 2016 12:04 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@hsunami
hsunami / dropkick.sh
Created March 23, 2016 04:21
Turn off spy cams in airbnb rentals
#!/bin/bash
#
# DROPKICK.SH
#
# Detect and Disconnect the DropCam and Withings devices some people are using to
# spy on guests in their home, especially in AirBnB rentals. Based on Glasshole.sh:
#
# http://julianoliver.com/output/log_2014-05-30_20-52
#
# This script was named by Adam Harvey (http://ahprojects.com), who also
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start