Skip to content

Instantly share code, notes, and snippets.

@yunazuno
yunazuno / install_dianaea.sh
Created April 10, 2011 10:04
Install dionaea on Ubuntu 10.04
#!/bin/sh
#
# Install dionaea on Ubuntu 10.04
#
# Based on: http://dionaea.carnivore.it/#compiling
#
# keep privileged state(bad hack...)
LOCKFILE=$$.pid
touch $LOCKFILE
@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
@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 / 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 / ipaddr.php
Created September 9, 2012 08:23
Switch the proxy automatically
<?php
echo $_SERVER["REMOTE_ADDR"];
@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 / 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);
#!/bin/sh
DEBUG=""
#DEBUG="--dry-run -vv"
MOUNTPOINT="/mnt/qb/common"
BACKUPROOT="${MOUNTPOINT}/backup/${HOSTNAME%.*}"
mount_backuppoint() {
## バックアップ先のマウント
#!/usr/bin/python
import dbus
bat_bus = dbus.SystemBus()
bat_object = bat_bus.get_object('org.freedesktop.UPower',
'/org/freedesktop/UPower/devices/battery_BAT0')
bat_interface = dbus.Interface(bat_object,
'org.freedesktop.DBus.Properties')
percentage = bat_interface.Get("org.freedesktop.UPower.Device",
"Percentage"
@yunazuno
yunazuno / barusu.rb
Created December 9, 2011 09:19
Post barusu automatically.
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
require "julius"
require "twitter"
Twitter.configure do |config|
config.consumer_key = ''
config.consumer_secret = ''
config.oauth_token = ''