Skip to content

Instantly share code, notes, and snippets.

lib/transfer_resolver.csv:

10D,1,Signed to 10-Day Contract
10D2,2,Signed to Second 10-Day Contract
ABS,3,Leave of Absence
ACT,4,Activated
BRV,5,Placed on Bereavement List
CEXP,6,Contract Expired
CEXT,,Contract Extension
netstat -nap | grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1/nginx: master pro
unix 3 [ ] STREAM CONNECTED 200611 1/nginx: master pro
unix 3 [ ] STREAM CONNECTED 200612 1/nginx: master pro
@bryanhuntesl
bryanhuntesl / Riak and Erlang - execute a command upon a node and print to console.md
Last active June 13, 2022 16:00
Riak and Erlang - execute a command upon a node and print to console

verify distributed Erlang working

Ping the riak node, print the response and halt the system.

erl -setcookie riak -name "${USER}-"@127.0.0.1 -noshell \
-eval "Res = net:ping('dev1@127.0.0.1'), io:put_chars(standard_error,io_lib:format(\"~p\",[Res]))." \
-eval "erlang:halt()."

As a result, pong is printed to the console, the response from the remote node, we're ready to start executing Erlang.

-module(riak_postcommit_hook_example).
-export([postcommitcounter/1, postcommitmapcounter/1]).
%% Refreshing counters from commithook is very expensive!
%%
%% requirements: bucket-type: maps(Type::map), bucket-type: counters(Type::counters)
%%
%% riak-admin bucket-type create maps '{"props":{"datatype":"map"}}'
%% riak-admin bucket-type activate maps
%% riak-admin bucket-type create counters '{"props":{"datatype":"counter"}}'

Setup

Create a bridge network which will be shared between containers

⚛︎□▷  docker network create riakcluster_default
e795056ca0f1c2b4c18e9f6614ff1fec5c9b05cfc718fa4c9b9c0b8a54fb0b54

□▷ docker network ls 
@bryanhuntesl
bryanhuntesl / YOKOZUNA.md
Last active February 6, 2018 13:18 — forked from drewkerrigan/YOKOZUNA.md
Yokozuna Setup

Create a schema based on the default one

curl "https://raw.githubusercontent.com/basho/yokozuna/develop/priv/default_schema.xml" -O
vim default_schema.xml

Upload your schema

@magnetikonline
magnetikonline / README.md
Last active February 4, 2024 07:45
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script to:

  • Iterate all commits made within a Git repository.
@binarytemple
binarytemple / utility.md
Last active April 29, 2020 10:34
Erlang decompiler I found on the web, works for Elixir beam files too

DON'T BOTHER USING - BROKE CODE

%% Author: PCHAPIER
%% Created: 25 mai 2010
-module(utility).

%%
%% Include files
%%
@QuantumGhost
QuantumGhost / example.puml
Last active March 23, 2024 22:39
A simple template for PlantUML to draw ER diagram.The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@flbuddymooreiv
flbuddymooreiv / readme.md
Last active February 6, 2024 22:31
erlang + rebar + cowboy Hello World

This is the process of setting up erlang, rebar3, and cowboy for a Hello World, starting with a clean Debian 8 install.

Update apt and install deps:

root@046edcaea45a:~# apt-get update
root@046edcaea45a:~# apt-get install erlang erlang-dev gcc
root@046edcaea45a:~# wget https://s3.amazonaws.com/rebar3/rebar3
root@046edcaea45a:~# mkdir ~/bin/
root@046edcaea45a:~# mv rebar3 ~/bin/
root@046edcaea45a:~# chmod +x ~/bin/rebar3