Skip to content

Instantly share code, notes, and snippets.

View ten0s's full-sized avatar

Dmitry Klionsky ten0s

View GitHub Profile
@ten0s
ten0s / graph_fsm.erl
Created July 8, 2019 10:14 — forked from erszcz/graph_fsm.erl
Vance Shipley's graph_fsm - a tool for drawing Erlang gen_fsm diagrams (http://www1.erlang.org/pipermail/erlang-questions/2001-October/003716.html)
%% graph_fsm.erl
%%
%% Author: Vance Shipley, Motivity Telecom Inc. <vances@motivity.ca>
%% Date: November, 2000
%%
%%
%% This library is free software; you can redistribute it and/or
%% modify it under the terms of the GNU Lesser General Public
%% License as published by the Free Software Foundation; either
%% version 2 of the License, or (at your option) any later

Header

Section

df -h
FilesystemSizeUsedAvailUse%Mountedon
@ten0s
ten0s / gist:3d5bb10be78a9cf47b869fc3ff1713b1
Created October 25, 2017 14:22
Open automatically multiple xfce terminal tabs
#!/bin/bash
for h in 192.168.100.1 192.168.100.2 192.168.100.3; do
opts[k++]="--tab"
opts[k++]="--title=$h"
opts[k++]="--command=bash -c 'ssh $h 'hostname'; exec bash'"
done
unset "opts[0]" # don't create an empty tab
xfce4-terminal "${opts[@]}"
@ten0s
ten0s / c.erl
Last active December 27, 2016 13:12
erlang shell ls
ls(Dir) ->
case file:list_dir(Dir) of
{ok, Entries} ->
ls_print(sort(Entries));
{error, enotdir} ->
ls_print([Dir]);
{error, Error} ->
format("~ts\n", [file:format_error(Error)])
end.
Erlang Node Memory Statistics
[newrelic:record_metric(list_to_binary(lists:concat(["Erlang/Memory/", K])), V) || {K, V} <- erlang:memory()].
Erlang Node Process Count
newrelic:record_metric(<<"Erlang/SystemInfo/ProcessCount">>, erlang:system_info(process_count)).
@ten0s
ten0s / gen-deploykey
Last active August 18, 2016 11:25
Multiple Github Deploy keys on single machine
#!/bin/bash
# http://eclipsesource.com/blogs/2012/07/30/accessing-multiple-private-github-repositories-without-a-dedicated-build-user/
set -e
self=${0}
script_name=$(basename ${self})
script_dir=$(dirname ${self})
ssh_dir=${script_dir}/../common/ssh
@ten0s
ten0s / ipython_gvmagic.ipynb
Last active July 23, 2016 15:00
Display graphviz dot in Jupyter using IPython2 with gvmagic
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ten0s
ten0s / ipython_graphviz.ipynb
Created July 23, 2016 13:32
Display graphviz dot in Jupyter using IPython2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ten0s
ten0s / ibash_graphviz.ipynb
Last active July 23, 2016 13:31
Display graphviz dot in Jupyter using IBash kernel
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ten0s
ten0s / gist:0831975562253510a0f322ba1baeaad7
Created May 24, 2016 12:19
Check Erlang node is distributed
pong = net_adm:ping(node()).