Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mumumu's full-sized avatar

Yoshinari Takaoka mumumu

View GitHub Profile
@mumumu
mumumu / tasks.py.count_results.patch
Created October 13, 2017 09:52
[PATCH] output parallel task execution result stats
--- fabric/tasks.py 2017-04-24 19:28:00.000000000 -0400
+++ fabric/tasks.py.new 2017-10-13 09:41:45.617000206 -0400
@@ -409,6 +409,22 @@
# This prevents Fabric from continuing on to any other tasks.
# Otherwise, pull in results from the child run.
ran_jobs = jobs.run()
+ print "----"
+ from collections import Counter
+ c = Counter()
+ failed_hosts = []
#!/usr/bin/env python
# encoding: utf-8
import sys
#
# Note: This code works on Python2 only!
#
ignore_functions = [
@mumumu
mumumu / fix-invalid-atom-log-url.md
Last active March 10, 2017 08:25
Mercurial へ atom feed url が違うんでね? と patch を送った
@mumumu
mumumu / lvs_my_summary.md
Created December 27, 2015 19:44
LVS(Linux Virtual Server) 自分まとめ
@mumumu
mumumu / about_redis_py_3.0_compatibility.md
Last active December 27, 2015 21:31
redis-py の 3.0 以降に加わったコマンドへの対応について

redis-py の 3.0 以降に加わったコマンドへの対応について

3.0 以降に入ったコマンドやimprovement に対する対応が一切入っていない
皆それはわかっているが、patch が投稿されていないっぽいように見える

3.2 がそろそろ出るタイミングなので、いつまでもビルド環境が 2.8 なのもどうかと思う。
よって、redis-py で 3.0 以降に対応された機能の対応状況やビルド環境について調べ、patch をどう送るかを考える

3.0 以降の機能がPRされた例

@mumumu
mumumu / redis_py_cluster_readonly_mode.md
Last active December 25, 2015 16:17
redis-py-cluster READONLY mode implementation considerations.

redis-py-cluster READONLY モード 対応

  • Redis Cluster の Python クライアントに READONLY モードを実装する
  • http://redis.io/topics/cluster-spec#scaling-reads-using-slave-nodes
  • デフォルトでは、Redis Cluster の Slave には直接アクセスできない
  • リダイレクトされるだけ
  • それを、READONLY な接続であると宣言することで、アクセスできるようにする

考慮しなければならないこと

diff --git a/python/JSONtoObj.c b/python/JSONtoObj.c
index 79d9f1a..610367b 100644
--- a/python/JSONtoObj.c
+++ b/python/JSONtoObj.c
@@ -136,9 +136,9 @@ PyObject* JSONToObj(PyObject* self, PyObject *args, PyObject *kwargs)
Object_newUnsignedLong,
Object_newDouble,
Object_releaseObject,
- PyObject_Malloc,
- PyObject_Free,
@mumumu
mumumu / hg_rev_update_checker.py
Created May 6, 2015 15:54
Mercurial Repository file update checker, notify by mail
#!/usr/bin/env python
from email.mime.text import MIMEText
import email.utils
import os
import subprocess
import sys
import smtplib
import tempfile
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
int sfd = socket(AF_INET, SOCK_STREAM, 0);
if (sfd == -1) {
perror("socket");
<source>
type forward
port 24225
</source>
<match hoge.fuga.foo.**>
type file_alternative
path /path/to/%Y/%m/%Y-%m-%d.log
time_slice_wait 1m
utc