Skip to content

Instantly share code, notes, and snippets.

Avatar
🖖
live long and prosper

Gokhan Boranalp kunthar

🖖
live long and prosper
View GitHub Profile
@kunthar
kunthar / websafecolors
Created February 20, 2014 00:10
websafe colors
View websafecolors
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
View gist:9533409
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
View .bashrc
# 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
View dnstest
λ 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"},
View gist:597ae6b7f3264e344703
λ 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]}]
View gut_error
λ 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.
View gist:a6d98e3162baa94f3ce2
~
λ 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
View actor c
~/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:
View gist:8802b8a5c35c3ab1cb7b
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]
@kunthar
kunthar / erl_run
Created June 1, 2015 12:24
bash_profile
View erl_run
function erl_run()
{
echo "checking installed versions in /Users/kunthar/development/erlang/kerl"
echo `ls -l /Users/kunthar/development/erlang/kerl | awk '{print $9}' | cut -f1 -d'/'`
echo "select one my friend"
read input_variable
if [ -z "$input_variable" ]
then
echo "$(tput setaf 3) Release 17.0 selected as default"