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
syntax on | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab |
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
local kys = redis.call('KEYS', '*') | |
for _, key in ipairs(kys) do | |
redis.call('MIGRATE', 'dst_host', 'dst_port', key, 'dst_db', 1000, 'replace') | |
end | |
return 1 | |
// one line eval | |
eval "local kys = redis.call('KEYS', '*') for _, key in ipairs(kys) do redis.call('MIGRATE', 'dst_host', 'dst_port', key, 'dst_db', 1000, 'replace') end; return 1" 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
test |
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
vim src/errno.h | |
ganti: | |
-extern int errno; | |
+#include <errno.h> |
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
function unpickSeatById($seating_id){ | |
$book_key = "booking-seat-" . strval($seating_id); | |
$this->redis->del($book_key); | |
return changeSeatStatusById($seating_id, 1); | |
} |
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
frontend frontend_service 127.0.0.1:9200 | |
mode tcp | |
balance roundrobin | |
acl max_conn_reached fe_conn gt 20 | |
acl production_almost_death nbsrv(production) lt 2 | |
default_backend production | |
use_backend production_and_backup if max_conn_reached OR production_almost_death | |
backend production | |
mode tcp |
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
## maybe you cannot find fcgi-devel package | |
wget http://www.fastcgi.com/dist/fcgi.tar.gz | |
tar -xzf fcgi.tar.gz | |
cd fcgi | |
./configure | |
make | |
make install | |
## install fcgiwrap |
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
#!/opt/python/bin/python | |
# @author: Rizky Abdilah | |
# @description: Project Euler Problem #67 | |
if __name__ == "__main__": | |
nlist, lnumber = [], 0 | |
fp = open("/tmp/euler/67.txt", "r") | |
for line in fp: | |
lnumber += 1 |
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
#!/opt/python/bin/python | |
import re | |
if __name__ == "__main__": | |
_remove_re = re.compile(r"(%|\^|\*|\(|\)|\{|\}|\[|\]|\$|@|!|_|\ |&|#|\+)") | |
fp = open("/tmp/test.easy", "r") | |
buff = fp.read() | |
fp.close() | |
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
from multiprocessing import Process | |
import os | |
import sys | |
from time import sleep | |
class JobSeeker(object): | |
def __init__(self, ppid=None): | |
self.ppid = ppid | |
NewerOlder