Skip to content

Instantly share code, notes, and snippets.

Dmitry Klionsky ten0s

Block or report user

Report or block ten0s

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View test.org

Header

Section

df -h
FilesystemSizeUsedAvailUse%Mountedon
@ten0s
ten0s / gist:3d5bb10be78a9cf47b869fc3ff1713b1
Created Oct 25, 2017
Open automatically multiple xfce terminal tabs
View gist:3d5bb10be78a9cf47b869fc3ff1713b1
#!/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 Dec 27, 2016
erlang shell ls
View c.erl
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.
View gist:0a007f6cfbd122fd56ea3fd3443cac84
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 Aug 18, 2016
Multiple Github Deploy keys on single machine
View gen-deploykey
#!/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 Jul 23, 2016
Display graphviz dot in Jupyter using IPython2 with gvmagic
View ipython_gvmagic.ipynb
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 Jul 23, 2016
Display graphviz dot in Jupyter using IPython2
View ipython_graphviz.ipynb
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 Jul 23, 2016
Display graphviz dot in Jupyter using IBash kernel
View ibash_graphviz.ipynb
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
Check Erlang node is distributed
View gist:06e2fdc13123d21f7945c787cfbd40e2
for i in `seq 1 5`; do erl -sname n${i} -noshell -eval 'io:format("~p~n", [erlang:md5(term_to_binary(lists:foldl(fun(I, Acc) -> Acc#{{abc, I} => I} end, #{}, lists:seq(1,100))))]), init:stop().' ; done
<<22,221,123,219,72,54,94,163,81,131,119,45,111,211,168,96>>
<<208,100,35,243,94,225,254,14,159,222,67,32,242,134,182,171>>
<<22,221,123,219,72,54,94,163,81,131,119,45,111,211,168,96>>
<<22,221,123,219,72,54,94,163,81,131,119,45,111,211,168,96>>
<<22,221,123,219,72,54,94,163,81,131,119,45,111,211,168,96>>
What's up?
You can’t perform that action at this time.