This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#apt-get install bundler | |
git clone https://github.com/stellar/xdrgen.git | |
bundle install --path vendor/bundle | |
bundle exec bin/xdrgen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# edit fetsh.lst as a TSV file and press 'q' to stop polling | |
# poll period: 1 second | |
# | |
while [ 1 ] | |
do | |
read -t 1 -n 1 char | |
if [[ $char == 'q' ]] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(mainly quoted from http://n3mesisfixx.blogspot.com/2013/07/configuring-exim4-to-route-to-many.html) | |
0. manage domain "enterprisedomain.com" and mx record and PTR/ip reverse name | |
1. install debian | |
2. setup exim4 domains | |
run $dpkg-reconfigure exim4-config' | |
set "type" as internet | |
set "mail name" to *somelocalname* eg. debian or change /etc/mailname+/etc/hosts | |
set "other dest domain"/dc_other_hostnames as "*somelocalname*; enterprisedomain.com;", make sure *somelocalname* in the list. | |
3. enable virtual alias |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl rand 256|tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB'|head -c12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://download.libsodium.org/libsodium/releases/libsodium-0.6.0.tar.gz | |
tar zvfx libsodium-0.6.0.tar.gz | |
cd libsodium-0.6.0/ | |
./configure --prefix=`realpath .`-bin | |
make && make install | |
cd .. | |
#diff --git a/SConstruct b/SConstruct | |
#index a4dca74..024e5e0 100644 | |
#--- a/SConstruct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set _JAVA_OPTIONS=-DsocksProxyHost=127.0.0.1 -DsocksProxyPort=8181 | |
rem alternatively, | |
rem set JAVA_TOOL_OPTIONS=-DsocksProxyHost=127.0.0.1 -DsocksProxyPort=8181 | |
"SDK Manager" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# | |
#command to monitor a rippled stared by `./rippled --fg --net` with "full ledger_history" config | |
# | |
while [ 1 ]; | |
do ./rippled -q server_info|grep "complete_ledger"|egrep -o '[[:digit:]]*'|head -n1|xargs -I{} ./rippled -q ledger {} |grep close_time_human; | |
sleep 5; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- run by | |
-- "C:\Program Files\Wireshark\tshark" -Q -r ftp.pcapng -X lua_script:tcpflow.lua | |
local server = "1.1.1.1" | |
local tap = Listener.new("tcp", "ip.addr == "..server) | |
function gen_acc(seq) | |
local datas = {} | |
local sum = 0 | |
local last_sum = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def timeit[T](f:()=>T)(count:Int=1) = { | |
val st = System.nanoTime() | |
var ti = 0 | |
var accu = collection.mutable.ListBuffer.empty[T] | |
while (ti < count) { | |
f() +=: accu | |
ti=ti+1 | |
} | |
val ed = System.nanoTime() | |
println(s"${(ed-st)/1000000} ms") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val arg1 = Iterator(2, 3, 4, 8, 9, 12, 14, 17) | |
val arg2 = Iterator(1, 2, 3, 4, 6, 8, 9, 10, 11, 12, 13, 14, 17) | |
//??(arg1, arg2)=> Iterator((2, 4), (8, 9), (12, 12),(14, 17)) | |
case class CeRange(start:Int, end:Option[Int]) { | |
def passed(br: Int) = { | |
end.map(br < _).getOrElse(true) | |
} | |
} |