Skip to content

Instantly share code, notes, and snippets.

View kaorimatz's full-sized avatar

Satoshi Matsumoto kaorimatz

View GitHub Profile
package main
import (
"bufio"
"encoding/json"
"flag"
"fmt"
"io"
"log"
"os"
package main
import (
"encoding/asn1"
"encoding/json"
"flag"
"fmt"
"os"
"github.com/k-sone/snmpgo"
#!/bin/bash
# usage: ./create-install-domain.sh <github_repo> <domain>
# example: ./create-install-domain.sh kaorimatz/dotfiles dot.kaorimatz.org
set -e
set -u
S3_REGION=ap-northeast-1
S3_HOSTED_ZONE_ID=Z2M4EHUR26P7ZW
@kaorimatz
kaorimatz / dmenu-git5ed5e90-xft.diff
Last active December 31, 2015 22:59
Xft support for dmenu. Works with the revision 5ed5e90. Original: http://tools.suckless.org/dmenu/patches/dmenu-4.5-xft.diff
diff --git a/config.mk b/config.mk
index c0d466b..22a5112 100644
--- a/config.mk
+++ b/config.mk
@@ -12,9 +12,13 @@ X11LIB = /usr/X11R6/lib
XINERAMALIBS = -lXinerama
XINERAMAFLAGS = -DXINERAMA
+# Xft, comment if you don't want it
+XFTINC = -I/usr/local/include/freetype2
@kaorimatz
kaorimatz / compute-font-ymax-ymin.py
Last active December 28, 2015 12:48
Compute ymax and ymin of a font
#!/usr/bin/env python
import sys
import fontforge
if __name__ == '__main__':
if len(sys.argv) != 2 and len(sys.argv) != 4:
print('usage: {} <font> [<code-point-start> <code-point-end>]'.format(sys.argv[0]))
sys.exit(1)
#!/bin/bash
set -e
DBUS_WATCH_EXPR="\
type='signal',\
sender='org.fedoraproject.Setroubleshootd',\
interface='org.fedoraproject.SetroubleshootdIface',\
member='alert'\
"
@kaorimatz
kaorimatz / open-twitter-link.js
Last active December 20, 2015 15:49
User defined vimperator command for opening a link on the twitter timeline in the new tab
#!/bin/bash
set -e
if [ $# -ne 2 ]; then
echo "usage: $0 <base_uri> <target_dir_path>"
exit 1;
fi
BASE_URI=$1
@kaorimatz
kaorimatz / open-feed.js
Last active December 18, 2015 01:48
User defined vimperator command for opening a feed link in the current tab
(function() {
let completer = function (context, args) {
let feeds = buffer.pageInfo.f[0];
let completions = [];
for (let [title, template] in feeds(true)) {
let dom = util.xmlToDom(template, document);
let url = dom.firstChild.href;
completions.push([url, title]);
}
#!/usr/bin/env python
import sys
import fontforge
if __name__ == '__main__':
if len(sys.argv) != 5:
print 'usage: %s <input-font> <output-font> <hhead-ascent> <hhead-descent>' % sys.argv[0]
else:
font = fontforge.open(sys.argv[1])