This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: mongodb | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the mongodb data-store | |
# Description: starts mongodb using start-stop-daemon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name hitodenize | |
// @namespace http://polog.org/ | |
// @include http://* | |
// @require http://gist.github.com/3242.txt | |
// ==/UserScript== | |
// using $X http://gist.github.com/3242 by os0x | |
// http://d.hatena.ne.jp/hitode909/20100418/1271583701 | |
function init(doc){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name AutoGhiblize | |
// @namespace http://d.hatena.ne.jp/tily | |
// @include http://faithrm-zero-zero.blog.so-net.ne.jp/archive/* | |
// @require http://www.chasen.org/~taku/software/TinySegmenter/tiny_segmenter-0.1.js | |
// ==/UserScript== | |
//----[Markov]--------------------------------------- | |
var Markov = function() { | |
this.chain = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~$ | |
\.DS_Store$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'MeCab' | |
require 'ostruct' | |
# USAGE: | |
# ruby extract_characters.rb < story.txt | |
# SPEC: | |
# 副詞可能は「今|今度|今日は」みたいなやつなので省いている | |
# TODO: | |
# each_two_sentences で照応を考慮する | |
# 一人称っぽい言葉も登場人物としてカウントする |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
$KCODE = 'UTF-8' | |
require 'rubygems' | |
require 'json' | |
require 'ya2yaml' | |
require 'oauth/cli/twitter' # gem install oauth-cli-twitter | |
BANNER = "usage ruby twitter_get_all_statuses.rb username path/to/file" | |
# TODO: 今何発言とったか表示できるようにする |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /bin/sh | |
if [ -z "$1" ]; | |
then | |
echo "url parameter is required." | |
exit | |
fi | |
HOMEDIR="/home/oquno/tokindle" | |
SAVEDIR="${HOMEDIR}/savedpages" | |
KINDLEGEN="${HOMEDIR}/kindlegen" | |
RUBY="/usr/bin/ruby1.8" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require 'kconv' | |
f = open(ARGV[0]) | |
read = f.read | |
f.close | |
read = read.kconv(6, Kconv.guess(read)) | |
read = read.gsub(/charset=[^"\s]+/i, "charset=utf-8") | |
read = read.gsub(/encoding="[^"\s]+"/i, "encoding=\"utf-8\"") | |
f = open(ARGV[0], "w") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install gcc44 package and update-alternatives (in chkconfig) | |
yum -y install gcc44 gcc44-c++ | |
# Fixed in dep-selector-gecode 1.0.1 | |
# Check if gcc is already a link | |
# if [ ! -L /usr/bin/gcc ]; then mv /usr/bin/gcc /usr/bin/gcc41; fi | |
# if [ ! -L /usr/bin/g++ ]; then mv /usr/bin/g++ /usr/bin/g++41; fi | |
# Install update-alteratives links for gcc41 and gcc44 | |
# update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc41 60 --slave /usr/bin/g++ g++ /usr/bin/g++41 | |
# update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc44 40 --slave /usr/bin/g++ g++ /usr/bin/g++44 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## mysql::master | |
ruby_block "store_mysql_master_status" do | |
block do | |
node.set[:mysql][:master] = true | |
m = Mysql.new("localhost", "root", node[:mysql][:server_root_password]) | |
m.query("show master status") do |row| | |
row.each_hash do |h| | |
node.set[:mysql][:master_file] = h['File'] | |
node.set[:mysql][:master_position] = h['Position'] | |
end |
OlderNewer