Skip to content

Instantly share code, notes, and snippets.

@saa
saa / pedantically_commented_playbook.yml
Created November 2, 2016 13:01 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.

AWS LambdaのPythonから利用出来るOpenCV3.0のライブラリを作成する手順

AWS Lambdaの実行環境の確認

AWSのLambda 実行環境と利用できるライブラリで確認する。

2015年12月現在では、 AMI ID: アジアパシフィック(東京) リージョンの ami-cbf90ecb を使っている。

OpenCVのビルド環境を作る

# Add this to your nginx.conf under http { }
server {
listen 843;
server_name localhost;
location / {
rewrite ^(.*)$ /crossdomain.xml;
}

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@saa
saa / date_util.erl
Last active August 29, 2015 14:06 — forked from zaphar/date_util.erl
-module(date_util).
-compile(export_all).
epoch() ->
now_to_seconds(now())
.
epoch_hires() ->
now_to_seconds_hires(now())
.
@saa
saa / google.sh
Created June 28, 2014 12:10 — forked from deanet/google.sh
#!/bin/bash
## uploading to google
## rev: 22 Aug 2012 16:07
det=`date +%F`
browser="Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0.1"
username="[email protected]"
password="password"
accountype="HOSTED" #gooApps = HOSTED , gmail=GOOGLE

Follow these steps to install Graphite on a fresh Ubuntu 12.04 instance. Make sure you read and understand the commands because by the time you read this, things could be outdated.

Graphite

Installing dependencies

# apt-get install libpq-dev
# apt-get install python-dev python-pip python-cairo python-psycopg2
# apt-get install python-django python-django-tagging
@saa
saa / gs_up.erl
Created March 13, 2014 12:57 — forked from stolen/gs_up.erl
-module(gs_up).
-export([init/1, handle_call/3, terminate/2]).
-record(state, {
own_fields,
field1,
field2,
field3
}).
#!/bin/bash
DEVELOPMENT_APPS=apps/*
for app in $DEVELOPMENT_APPS
do
base_app=`ba

Jabber бот с использованием exmpp

Помня что всё в Erlang делается [за 20 минут][chat20min] давайте напишем Jabber бота за этот отрезок времени который сможет заходить в комнаты и отвечать на ping с использованием библиотеки [exmpp] и применением OTP принципов.

Создаём папку проекта.

➜  projects:  mkdir erlbot && cd erlbot
➜  erlbot: