Skip to content

Instantly share code, notes, and snippets.

@massat
massat / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@massat
massat / mysql_package.rb
Last active December 15, 2015 20:18
適当に書き始めたけど define の中で rpm_package が使えないのはなんでなの
#
# Cookbook Name:: mysql
# Definition:: mysql_package
#
# Copyright 2013, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
define :mysql_package do
@massat
massat / Makefile.patch
Last active December 13, 2015 19:59
patches to Make checkinstall 1.6.2 compatible with 64bit arch.
--- Makefile 2013-02-16 13:35:19.248945750 +0000
+++ Makefile_ 2013-02-16 13:34:44.700154473 +0000
@@ -4,7 +4,7 @@
PREFIX=/usr/local
BINDIR=$(PREFIX)/sbin
LCDIR=$(PREFIX)/lib/checkinstall/locale
-CONFDIR=$(PREFIX)/lib/checkinstall
+CONFDIR=$(PREFIX)
all:
@massat
massat / まとめてadd
Created November 30, 2012 02:36
awkを使ってまとめてsvn add ref: http://qiita.com/items/3b8e59ad0f70c1b4e4ef
svn st | awk '/^?/ {print $2}' | xargs svn add
@massat
massat / compress-logs.sh
Created November 21, 2012 02:20
A snnipet compressing old log files.
#!/bin/sh
TODAY=`date +%Y%m%d`
DIR="/path/to/dir"
DAYS=60
find ${DIR} -type f -name '*.log' -daystart -mtime +${DAYS} | while read f; do
nice tar czfv ${f}.tgz --directory `dirname ${f}` `basename ${f}`
rm ${f}
done
@massat
massat / sample.sh
Created February 11, 2012 03:09
perl... #perlはじめました ref: http://qiita.com/items/2353
/Users/massat% perl -MData::Dumper -e 'my @array = [1,2,3]; warn Dumper @array; foreach (@array) { warn Dumper $_ };'
$VAR1 = [
1,
2,
3
];
$VAR1 = [
1,
2,
3
@massat
massat / supervisord
Created October 12, 2011 06:52
init script for supervisord
#!/bin/sh
#
# /etc/rc.d/init.d/supervisord
#
# Supervisor is a client/server system that
# allows its users to monitor and control a
# number of processes on UNIX-like operating
# systems.
#
# chkconfig: - 64 36