Skip to content

Instantly share code, notes, and snippets.

@takus
takus / mr_counting_job.py
Last active August 29, 2015 14:04
mrjob's unit test example
from mrjob.job import MRJob
from mrjob.step import MRStep
class MRCountingJob(MRJob):
def __init__(self, *args, **kwargs):
super(MRCountingJob, self).__init__(*args, **kwargs)
def steps(self):
# 3 steps so we can check behavior of counters for multiple steps
#!/bin/bash
#
# Modified TMUX start script from:
# http://forums.gentoo.org/viewtopic-t-836006-start-0.html
#
# Store it to `~/bin/tmx` and issue `chmod +x`.
#
# Works because bash automatically trims by assigning to variables and by
@takus
takus / Vagrantfile
Created July 26, 2013 02:22
Vagrantfile for chef cookbook test
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "opscode-centos-6.4"
config.vm.box_url = "https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box"
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.provider :virtualbox do |vb|
@takus
takus / sigalrm.pl
Created March 26, 2013 04:53
Time::HiRes::alarm(0); しないと意図しない箇所で die する例
#!/usr/bin/env perl
use strict;
use warnings;
use POSIX qw(SIGALRM);
use Time::HiRes;
print "begin\n";
eval {
@takus
takus / install-homebrew.sh
Created December 14, 2012 18:54
install homebrew.
#!/bin/sh
#### UNINSTALL MacPorts
# save installed package by MacPorts before uninstall
sudo port installed > ~/myports.log
# Uninstall MacPorts
# You should also remove /opt/local/bin & /opt/local/sbin in your PATH
sudo port -f uninstall installed
@takus
takus / mq_install.sh
Created December 3, 2012 21:52 — forked from iwata/mqh_install.sh
Installing MySQL5.1 & Q4M on MacOSX Lion
#!/bin/zsh
MYSQL_VERSION=5.1.65
if [ `which perl` = "/usr/bin/perl" ]; then
echo -n -e "\e[1;31mUSING SYSTEM PERL OK? [y/n]\e[m: "
read ANSWER
if [ "$ANSWER" != "y" ]; then
exit 255
fi
@takus
takus / redmine2dailyreport.pl
Created November 30, 2012 18:11
generates daily report from redmine issues
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
binmode STDOUT, ":utf8";
use Config::Pit;
use Redmine::API;
use Encode;
@takus
takus / install-s3fs.sh
Created July 31, 2012 13:30
install s3fs
#!/bin/sh
## Description:
## install script of s3fs
##
## Usage:
## install-s3fs.sh [mountpoint] [bucketName] [accessKeyId] [secretAccessKey]
MOUNT_POINT=$1
BUCKET_NAME=$2
@takus
takus / install-dotfiles.sh
Created May 16, 2012 16:06
setup my dotfiles
#!/bin/sh
chsh -s /bin/zsh
# setup my dotfiles & oh-my-zsh
git clone git://github.com/takus/dotfiles.git ~/.dotfiles
~/.dotfiles/install/install.sh
# Install Vim Plugins with vundle
~/.dotfiles/install/vim-bundle.sh
@takus
takus / install-homebrew.sh
Created May 16, 2012 16:02
Install Homebrew & Some Terminal Applications
#!/bin/sh
# Install Homebrew
ruby -e "$(curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
brew install \
lv \
git \
tig \