Skip to content

Instantly share code, notes, and snippets.

View eiri's full-sized avatar
🐈‍⬛
Diving into Rust

Eric Avdey eiri

🐈‍⬛
Diving into Rust
View GitHub Profile
@eiri
eiri / Dockerfile
Created October 19, 2017 14:20
minideb with erlang solutions packaged erlang
FROM bitnami/minideb:stretch
MAINTAINER Eric Avdey <[email protected]>
ENV ESL_REPO=http://packages.erlang-solutions.com/debian \
ESL_DIST=esl-erlang \
ESL_VER=1:19.3.6
WORKDIR /tmp
@eiri
eiri / config
Created October 12, 2017 00:52
Example of erln8 (v1) config
[Erln8]
color=true
banner=false
default_config=default
system_default=r20
[Repos]
default=https://github.com/erlang/otp.git
[Erlangs]
@eiri
eiri / erlang-version-check.md
Last active October 31, 2024 15:21
Quick check on erlang version from command line
$ erl -noshell -eval 'erlang:display(erlang:system_info(system_version))' -eval 'init:stop()'
"Erlang/OTP 20 [erts-9.1.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]\n"
@eiri
eiri / !README.md
Last active October 8, 2017 20:16
Vagrant setup for go dev

Vagrant setup for go dev

Overview

  • Linux: Debian Stretch
  • Provisioning: Ansible
  • Go: 1.9.1

Pre-requirements

  • VirtualBox: 5.1.28
  • Vagrant: 2.0.0
@eiri
eiri / primer.md
Last active November 2, 2023 04:40
Edit CouchDB design document with curl

Edit CouchDB design document with curl

create new database

$ curl -X PUT http://localhost:5984/koi
{"ok":true}

create a single document

$ curl -X POST http://localhost:5984/koi -d '{"name":"alice","age":25}' -H'Content-Type:application/json'
@eiri
eiri / CouchDB_attachments.md
Created May 26, 2017 17:16
Short primer on using attachment in CouchDB

Short primer on using attachment in CouchDB

In db "koi" create a doc named "tesla"

$ http put :5984/koi/tesla name=alice
{
    "id": "tesla", 
    "ok": true, 
    "rev": "1-2350796167caec1f6ba70e9145a9e102"
@eiri
eiri / REST Cheatsheet.md
Last active May 19, 2017 13:34
REST Cheatsheet

REST Cheatshit

REST to CRUD

  • POST - create
  • GET - read
  • PUT - update (replace)
  • PATCH - update (partial)
  • DELETE - delete
  • HEAD - verify
@eiri
eiri / CouchDB _local.md
Created March 22, 2017 11:55
Working with local documents in CouchDB (medium post stub)

Working with local documents in CouchDB

Create

No such document

$ http :5984/koi/_local/020
{
    "error": "not_found", 
    "reason": "missing"
}
@eiri
eiri / demo.md
Created February 21, 2017 14:12
Demo on how revs, open_revs and and revs_info act in CouchDB 2.0

Start dev cluster:

$ ./dev/run --admin eiri:eiri
[ * ] Setup environment ... ok
[ * ] Ensure CouchDB is built ... ok
[ * ] Prepare configuration files ... ok
[ * ] Start node node1 ... ok
[ * ] Start node node2 ... ok
[ * ] Start node node3 ... ok
[ * ] Check node at http://127.0.0.1:15984/ ... ok
@eiri
eiri / provision.yml
Created January 27, 2017 19:01
Insert arbitrary lines in middle of file with ansible
- name: activate erlang 17.5 on login
lineinfile:
dest: /home/vagrant/.bashrc
line: "{{item.line}}"
insertafter: "{{item.insertafter}}"
state: present
with_items:
- insertafter: "#alias l='ls -CF'"
line: '# activate erlang 17.5'
- insertafter: '# activate erlang 17.5'