Skip to content

Instantly share code, notes, and snippets.

View kunthar's full-sized avatar
🖖
live long and prosper

Gokhan Boranalp kunthar

🖖
live long and prosper
View GitHub Profile
@kunthar
kunthar / gist:7031835
Created October 17, 2013 20:40
Docker in action
root@panel /home/kunthar # uname -a
Linux panel.xxxxx.com 3.8.0-31-generic #46~precise1-Ubuntu SMP Wed Sep 11 18:21:16 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
root@panel /home/kunthar # docker pull base:latest
Pulling repository base
b750fe79269d: Download complete
27cf78414709: Download complete
root@panel /home/kunthar # docker images
REPOSITORY TAG ID CREATED SIZE
@kunthar
kunthar / websafecolors
Created February 20, 2014 00:10
websafe colors
def getwebsafe(r,g,b):
rw = 51 * ((int(r)+25)//51)
gw = 51 * ((int(g)+25)//51)
bw = 51 * ((int(b)+25)//51)
return (rw,gw,bw)
@kunthar
kunthar / gist:9533409
Created March 13, 2014 17:56
Docker assign ip address to container
docker run \
-n=false \
-v /data/p01/percona:/data/p01/percona \
-e "MYSQL_DATA_DIR=/data/p01/percona" \
-e "NODE_IP_ADDRESS=172.17.42.20" \
-h="p01.egnity.com" \
-lxc-conf="lxc.network.type = veth" \
-lxc-conf="lxc.network.ipv4 = 172.17.42.20/24" \
-lxc-conf="lxc.network.ipv4.gateway = 172.17.42.1" \
-lxc-conf="lxc.network.link = docker0" \
@kunthar
kunthar / .bashrc
Last active August 29, 2015 14:00
run needed erlang version with kerl
# add this function to the .bashrc or .bash_profile
# change paths to your own paths. i recommend create a dedicated folder for otp versions
# Usage
#λ kunthar : erl_run
#checking installed versions in /Users/kunthar/development/erlang/kerl
#17.0 17.0-rc2 R15B01 R16B02 README.md bash_completion kerl* releases zsh_completion
#versions will be listed from the same directory!!!
#select one my friend
@kunthar
kunthar / dnstest
Created October 22, 2014 15:01
erlang dns tests
λ kunthar : erl
Erlang/OTP 17 [erts-6.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V6.1 (abort with ^G)
2> inet:get_rc().
[{domain,"kunthar.com"},
{search,["kunthar.com"]},
{resolv_conf,"/etc/resolv.conf"},
{hosts_file,"/etc/hosts"},
λ kunthar : erl
Erlang/OTP 17 [erts-6.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V6.1 (abort with ^G)
1> inet:get_rc().
[{domain,"kunthar.com"},
{search,["kunthar.com"]},
{resolv_conf,"/etc/resolv.conf"},
{hosts_file,"/etc/hosts"},
{lookup,[native]}]
λ kunthar : gut new cowboy tbridge
Cloning cowboy hosted at https://github.com/unbalancedparentheses/cowboy-gutenberg-generator
Please submit a github issue if you find any problem
The generator wants to run the following list of commands:
1. make
Are you sure you want to continue: [y/n] y
* running make in /Users/kunthar/.gut/compiled/tbridge
--2014-11-14 16:41:58-- https://raw.githubusercontent.com/ninenines/erlang.mk/master/packages.v2.tsv
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.31.18.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.31.18.133|:443... connected.
~
λ kunthar : ls -al .gut/
total 0
drwxr-xr-x 4 kunthar staff 136 Nov 14 16:41 ./
drwx------@ 122 kunthar staff 4148 Nov 14 16:39 ../
drwxr-xr-x 3 kunthar staff 102 Nov 14 16:41 compiled/
drwxr-xr-x 11 kunthar staff 374 Nov 14 16:39 cowboy-gutenberg-generator/
______________________________________________
~
λ kunthar : ls -al .gut/cowboy-gutenberg-generator/
@kunthar
kunthar / actor c
Created November 30, 2014 23:21
actor framework compile error
~/development/actor-framework
λ kunthar : make
Scanning dependencies of target libcaf_core
[ 1%] Building CXX object libcaf_core/CMakeFiles/libcaf_core.dir/src/abstract_actor.cpp.o
[ 2%] Building CXX object libcaf_core/CMakeFiles/libcaf_core.dir/src/abstract_channel.cpp.o
[ 2%] Building CXX object libcaf_core/CMakeFiles/libcaf_core.dir/src/abstract_group.cpp.o
[ 3%] Building CXX object libcaf_core/CMakeFiles/libcaf_core.dir/src/abstract_coordinator.cpp.o
In file included from /Users/kunthar/development/actor-framework/libcaf_core/src/abstract_coordinator.cpp:28:
In file included from /Users/kunthar/development/actor-framework/libcaf_core/caf/on.hpp:33:
In file included from /Users/kunthar/development/actor-framework/libcaf_core/caf/match_expr.hpp:37:
root@z1:/home/kunthar# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 33388 2716 ? Ss 08:08 0:01 /sbin/init
root 7 0.0 0.0 0 0 ? S 08:08 0:00 [rcu_sched]
root 8 0.0 0.0 0 0 ? S 08:08 0:00 [rcuos/0]
root 9 0.0 0.0 0 0 ? S 08:08 0:00 [rcuos/1]
root 10 0.0 0.0 0 0 ? S 08:08 0:00 [rcuos/2]
root 11 0.0 0.0 0 0 ? S 08:08 0:00 [rcuos/3]
root 12 0.0 0.0 0 0 ? S 08:08 0:00 [rcuos/4]
root 13 0.0 0.0 0 0 ? S 08:08 0:00 [rcuos/5]