Skip to content

Instantly share code, notes, and snippets.

View kenichi-shibata's full-sized avatar
🇯🇵
working

Kenichi Shibata kenichi-shibata

🇯🇵
working
View GitHub Profile
@kenichi-shibata
kenichi-shibata / handler.js
Created January 6, 2016 01:36 — forked from jeffrafter/handler.js
Simple HTTP Server and Router in node.js
exports.createHandler = function (method) {
return new Handler(method);
}
Handler = function(method) {
this.process = function(req, res) {
params = null;
return method.apply(this, [req, res, params]);
}
}
@kenichi-shibata
kenichi-shibata / merge_to_master.sh
Created March 11, 2016 05:58 — forked from tkawachi/merge_to_master.sh
Merge develop to master and push it
#!/bin/bash
set -e
COMPANY_REMOTE=plucky
git fetch $COMPANY_REMOTE
git checkout master
git reset --hard $COMPANY_REMOTE/master
git merge --no-ff $COMPANY_REMOTE/develop
@kenichi-shibata
kenichi-shibata / redux-demo.js
Created March 15, 2016 02:51 — forked from logzh/redux-demo.js
redux-demo
redux-demo
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@kenichi-shibata
kenichi-shibata / node-and-npm-in-30-seconds.sh
Created May 6, 2016 01:12 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@kenichi-shibata
kenichi-shibata / install-redis.sh
Created May 17, 2016 14:57 — forked from FUT/install-redis.sh
Install Redis on EC2
1. Install Linux updates, set time zones, followed by GCC and Make
sudo yum -y update
sudo ln -sf /usr/share/zoneinfo/America/Indianapolis \
/etc/localtime
sudo yum -y install gcc make
2. Download, Untar and Make Redis 2.8 (check here http://redis.io/download)
@kenichi-shibata
kenichi-shibata / gist:2d8bd288f3fa32915815ab4b71d1f69d
Created June 20, 2016 08:04 — forked from pzaich/gist:3997914
install graphicsmagick to EC2
wget ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/1.3/GraphicsMagick-1.3.15.tar.gz
tar -xvf GraphicsMagick-1.3.15.tar.gz
cd GraphicsMagick-1.3.15
./configure
make
@kenichi-shibata
kenichi-shibata / install-ffmpeg-amazon-linux.sh
Created July 5, 2016 06:54 — forked from gboudreau/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@kenichi-shibata
kenichi-shibata / _service.md
Created August 18, 2016 07:49 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@kenichi-shibata
kenichi-shibata / tmux-cheatsheet.markdown
Created October 31, 2016 07:49 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname