Skip to content

Instantly share code, notes, and snippets.

@yunazuno
yunazuno / gist:1581672
Created January 9, 2012 07:32
Patch for libskk
diff --git a/libskk/state.vala b/libskk/state.vala
index 257bf15..3864fcf 100644
--- a/libskk/state.vala
+++ b/libskk/state.vala
@@ -699,7 +699,6 @@ namespace Skk {
state.surrounding_end));
}
state.rom_kana_converter.reset ();
- state.input_mode = entry.value;
state.handler_type = typeof (NoneStateHandler);
@yunazuno
yunazuno / skk.py
Created January 18, 2012 06:44
Python port of libskk/tools/tool.vala (prototype)
#!/usr/bin/python
# -*- coding: utf-8 -*-
from gi.repository import Skk
import sys
Skk.init()
dictionaries = []
dictionary = Skk.FileDict.new("/usr/share/skk/SKK-JISYO.L", "EUC-JP")
dictionaries.append(dictionary)
@yunazuno
yunazuno / change_ipv6addr.py
Created August 9, 2012 06:44
change ipv6 address of specified interface(not tested)
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
import binascii
import os
interface = "tap0"
## Get current ipv6 address
cmd = "ifconfig {0}|grep -e 'inet6.*global'|awk '{{print $2}}'"
@yunazuno
yunazuno / ipaddr.php
Created September 9, 2012 08:23
Switch the proxy automatically
<?php
echo $_SERVER["REMOTE_ADDR"];
@yunazuno
yunazuno / setup-newenv.sh
Created December 30, 2012 06:36
Setup the new environment.
#!/bin/sh
# Setting up the new enviromnet.
ORIGIN=http://USERNAME@gitrepos.example.com/git/dotfiles.git/
ORIGIN=ssh://USERNAME@gitrespos.example.com:20022/git/dotfiles.git/
cd $HOME
git init
git remote add origin ${ORIGIN}
git config branch.master.merge refs/heads/master
@yunazuno
yunazuno / simpleproxy.py
Created January 26, 2013 07:18
The simple HTTP proxy server
#!/usr/bin/python
# -*- coding: utf-8 -*-
import SocketServer
import BaseHTTPServer
import httplib, urlparse
import socket
import StringIO
import time
@yunazuno
yunazuno / backup-bitbucket-repository.py
Last active December 22, 2015 04:49
Backup own bitbucket repositories to the specific directory
#!/usr/bin/env python3
"""
Backup own bitbucket repositories to the specific directory
Usage: backup-bitbucket-repository.py USERNAME BACKUP_TARGET_DIR
"""
import urllib.request
import keyring
import json
import os
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pexpect
import signal
import fcntl
import termios
import struct
#!/usr/bin/env python
from norikraclient.client import Client
import pprint
norikra = Client()
def __read_data():
# Actually, here we read data from a data source (e.g., csv file)
[testuser@HOSTNAME norikra]$ uname -a
Linux HOSTNAME 2.6.32-431.29.2.el6.x86_64 #1 SMP Tue Sep 9 21:36:05 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[testuser@HOSTNAME norikra]$ cat /etc/redhat-release
CentOS release 6.5 (Final)
[testuser@HOSTNAME norikra]$ rbenv version
jruby-1.7.17 (set by RBENV_VERSION environment variable)
[testuser@HOSTNAME norikra]$ jruby --version
jruby 1.7.17 (1.9.3p392) 2014-12-09 fafd1a7 on OpenJDK 64-Bit Server VM 1.7.0_65-mockbuild_2014_07_16_06_06-b00 +jit [linux-amd64]
[testuser@HOSTNAME norikra]$ gem list