Skip to content

Instantly share code, notes, and snippets.

View id's full-sized avatar

Ivan Dyachkov id

  • EMQ Technologies
  • Stockholm
View GitHub Profile
@id
id / .tmux.conf
Created February 3, 2018 21:07
.tmux.conf
unbind C-b
set-option -g prefix C-a
bind C-a send-prefix
set-option -g default-terminal "screen-256color"
bind-key -temacs-copy M-w copy-pipe "tmux_send_clip.sh"
set-option -g default-command "/bin/bash && source ~/.bashrc"
set-option -g status-bg black
set-option -g status-fg white
set-option -g status-left ‘#[fg=green]#H’
set-option -g visual-activity on
@id
id / s3.sh
Last active August 29, 2015 14:20 — forked from chrismdp/s3.sh
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@id
id / gist:408b45ee8146fe578cda
Created March 3, 2015 10:37
Adding CA into boot2docker vm
osx-host$ boot2docker ssh
sudo su -
cd /var/lib/boot2docker/
cat <<EOF >bootlocal.sh
#!/bin/sh
cp /Users/ivan.dyachkov/MyCA.crt /usr/local/share/ca-certificates/
CERT=/usr/local/share/ca-certificates/MyCA.crt
HASH=$(openssl x509 -hash -in $CERT | head -n1)
ln -s $CERT /etc/ssl/certs/$HASH.0
@id
id / gist:cba5dbf7653d7eab6a03
Last active March 26, 2024 15:55
Tracing in erlang
F = fun(F, Fd) -> receive stop -> io:format(Fd, "stop~n", []), file:close(Fd), ok; Msg -> io:format(Fd, "~p~n", [Msg]), F(F, Fd) end end.
{ok, Fd} = file:open("/tmp/trace.out", [write]), Tracer = proc_lib:spawn(fun() -> F(F, Fd) end).
%% trace everything
erlang:trace(Pid, true, [all, {tracer, Tracer}]).
%% stop tracing
erlang:trace(Pid, false, [all, {tracer, Tracer}]).
Tracer ! stop.
%% match pattern
@id
id / gist:a6eefcadafb9ca9de5a4
Last active August 29, 2015 14:00
Share tmux buffer between hosts
# .tmux.conf:
bind-key -temacs-copy M-w copy-pipe "tmux_send_clip.sh"
# cat $HOME/bin/tmux_send_clip.sh:
#!/bin/sh
function maybe_show_err {
if [ $? -ne 0 ]
then
ERROR=$(</tmp/err)
tmux display-message "$? $ERROR"
@id
id / .zshrc
Created May 23, 2011 18:26 — forked from ptzn/.zshrc
setopt autocd
setopt CORRECT
autoload -U compinit
compinit
#zmodload zsh/complist
zstyle ':completion:*' menu yes select
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*:processes' command 'ps -xuf'