start new:
tmux
start new with session name:
tmux new -s myname
import fcntl | |
import time | |
import sys | |
lock = file('singleapp.lock', "w+") | |
try: | |
fcntl.lockf(lock, fcntl.LOCK_EX|fcntl.LOCK_NB) | |
except Exception, e: | |
print "kill me before start again" |
Modern applications usually make use of back-end API servers to provide their services. With a non-transparent HTTPs proxy, which intercepts the communication between clients and servers (aka the man-in-the-middle scheme), you can easily manipulate both API requests and responses.
This manual helps you create your own proxy with Python and mitmproxy/libmproxy. Mitmproxy ships with both a standalone command-line tool (mitmproxy
) and a Python library (libmproxy).
#!/usr/bin/env bash | |
# This script prints out all of your Redis keys and their size in a human readable format | |
# Copyright 2013 Brent O'Connor | |
# License: http://www.apache.org/licenses/LICENSE-2.0 | |
human_size() { | |
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } ' | |
} |
Thread-9jnxc | |
looping.rb:17:in `block (2 levels) in <main>' | |
\_ looping.rb:15:in `each' | |
\_ looping.rb:15:in `block in <main>' | |
\_ looping.rb:22:in `call' | |
\_ looping.rb:22:in `condition' | |
\_ looping.rb:26:in `looping' | |
\_ looping.rb:31:in `<main>' |
function rc { | |
release_branch=`git branch | grep release/ | sort -r | head -n 1 | sed -e s/'* '// | awk '{print $1}'` | |
diff_branchs="master..$release_branch" | |
echo -e "\e[34;5;204mRelease branch: $release_branch, diff: $diff_branchs, commits: \e[0m" | |
text=`git log $diff_branchs --pretty=format:'- %s by @%an' --reverse | grep -v Merge | sort | uniq` | |
echo $text | |
} |
SPC s c remove highlight | |
**** Files manipulations key bindings | |
Files manipulation commands (start with ~f~): | |
| Key Binding | Description | | |
|-------------+----------------------------------------------------------------| | |
| ~SPC f c~ | copy current file to a different location | | |
| ~SPC f C d~ | convert file from unix to dos encoding | | |
| ~SPC f C u~ | convert file from dos to unix encoding | |
{ | |
"clusters": [ | |
{ | |
"account": "g_k8s_dev0", | |
"application": "treasureship", | |
"capacity": { | |
"desired": 1, | |
"max": 3, | |
"min": 2 | |
}, |
I am passionate about Ruby, but its execution time compared to other languages is extremely high, especially when we want to use more complex algorithms. In general, data structures in interpreted languages become incredibly slow compared to compiled languages. Some algorithms such as ´n-body´ and ´fannkuch-redux´ can be up to 30 times slower in Ruby than Go. This is one of the reasons I was interested in embedding Go code in a Ruby environment.
For those who do not know how shared libraries operate, they work in a similar way as DLLs in Windows. However, they have a native code with a direct interface to the C compiler.
Note Windows uses the DLL system, and in this case, this does not necessarily have to be in native code.
One example is DLLs written in C#, which runs on a virtual machine. Because I do not use windows, I ended up not testing if it is poss