Skip to content

Instantly share code, notes, and snippets.

View s5unty's full-sized avatar

Sun Wuan s5unty

View GitHub Profile
@s5unty
s5unty / Dockerfile
Created December 14, 2015 13:15
docker env for the SaltStack study
FROM salt-minion
ADD salt-2015.5.3+ds-1trusty1 /var/tmp/
RUN sh -c "dpkg -i /var/tmp/salt-2015.5.3+ds-1trusty1/*.deb || apt-get install -y -f"
RUN touch /var/log/salt/minion
ENTRYPOINT service salt-minion restart && tail -f /var/log/salt/minion
@s5unty
s5unty / cqlb_txt.patch
Created March 17, 2015 07:53
升级超强二笔的码表以支持自造词功能 #erbi #fcitx #cqlb
--- cqlb30.txt.orig 2015-03-17 15:47:47.589370961 +0800
+++ cqlb30.txt.rule 2015-03-17 15:50:58.849377706 +0800
@@ -1,15 +1,24 @@
;fcitx Version 0x03 Table file
+;超强二笔120309码表:http://fds8866.ys168.com/
+;解开后参考erbi码表:http://fcitx.github.io/handbook/sect1-code-table.html
+;
+;1. 添加了 InvalidChar、删除了标点符号。
+; 使得标点可以直接上屏。
+;
@s5unty
s5unty / proxy.diff
Created February 6, 2015 09:54
Add proxy support in calendar.vim
autoload/calendar/webapi.vim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git autoload/calendar/webapi.vim autoload/calendar/webapi.vim
index 044570c..f07e134 100644
--- autoload/calendar/webapi.vim
+++ autoload/calendar/webapi.vim
@@ -153,7 +153,7 @@ function! s:request(json, async, url, ...)
endif
endif
lib/App/ClusterSSH.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git lib/App/ClusterSSH.pm lib/App/ClusterSSH.pm
index 707865e..55a2b1f 100644
--- lib/App/ClusterSSH.pm
+++ lib/App/ClusterSSH.pm
@@ -727,7 +727,7 @@ sub open_client_windows(@) {
"'"
. $self->config->{title} . ': '
@s5unty
s5unty / xorg.conf
Created April 28, 2013 15:03
gksu amdcccle - multi screen
Section "ServerLayout"
Identifier "amdcccle Layout"
Screen 0 "amdcccle-Screen[1]-0" 0 0
EndSection
Section "Monitor"
Identifier "0-DFP10"
Option "VendorName" "ATI Proprietary Driver"
Option "ModelName" "Generic Autodetecting Monitor"
Option "DPMS" "true"
@s5unty
s5unty / todo2rem.sh
Last active December 14, 2015 18:29
处理 todotxt 中含有 **提醒标记** 的任务事项
#!/bin/zsh
# inspired on: https://github.com/jkrehm/todotxt-cli-addons
#
# 功能:
# 处理 [todotxt][1] [数据文件][2]中含有 **提醒标记** 的任务事项,
# 把他们格式化之后另存为 [remind][3] 格式的[数据文件][4]。
#
# 提醒标记(可自定义、符合 todotxt [格式][2]即可):
# rem:(.*)
#
@s5unty
s5unty / pushover
Last active December 14, 2015 10:59
todo.txt => pushover
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# inspired on: https://github.com/jkrehm/todotxt-cli-addons
#
# $ crontab -l
# */5 * * * * TZ='Asia/Shanghai' /sun/todo/opt/remind/pushover ${YOUR_TODO_FILE} ${YOUR_API_TOKEN} ${YOUR_USER_KEY}
# */5 * * * * TZ='Asia/Shanghai' /sun/todo/opt/remind/pushover ${ANOTHER_TODO_FILE} ${YOUR_API_TOKEN} ${YOUR_USER_KEY}
#
# 在 pushover.net 申请 App 后得到 ${YOUR_API_TOKEN}
@s5unty
s5unty / pomodoro.sh
Created October 13, 2012 17:11
番茄钟(pomodoro)
#!/bin/sh
# inspired from http://feedelli.org/2012/07/29/bash-command-line-pomodoro-timer.html
# punch-time-tracking: http://code.google.com/p/punch-time-tracking/
# 每个闹钟就固定为 25 分钟,不允许任意设定时间。
# 配合 Punch.py 才能记录钟的使用情况,方便统计。
doing=$1
limit=$((25*60*1000))
step=$((5*60*1000))
#limit=$((25*1000)) # 25秒测试用
@s5unty
s5unty / tweets.py
Created May 28, 2012 14:23
同步 twitter 到 sina weibo
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import httplib
import urllib
import json
import base64
import cPickle as p
import sys
reload(sys)
@s5unty
s5unty / todo_ff.sh
Created May 24, 2012 17:18 — forked from PillowMetal/todo_ff.sh
TODOTXT_FINAL_FILTER
#!/bin/bash
export COLOR_PRIORITY="$RED"
export COLOR_CONTEXT="$GREEN"
export COLOR_PROJECT="$CYAN"
export COLOR_ADD_ONS="$PURPLE"
# Force gawk to behave posixly. Comment out if you get an error about
# no such option -W.
AWK_OPTIONS=""