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 / 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)
#### 2.1 Installation
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins
sudo chkconfig jenkins on
sudo service jenkins start
/* global -Promise */
var Promise = require('bluebird');
function a(value){
return new Promise(function (resolve){
value++;
resolve(value);
});
}
@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

More beautiful git log

run this command

git config --global alias.lg "log --color --graph --abbrev-commit
           --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset'"

now go to your git repo in localhost and run

@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
var Promise = require('bluebird');
function a(val,callback){
val++;
console.log('value1:'+val);
callback(null,val);
}
function b(val,callback){
val = val + 2;
console.log('value2:'+val);
var Promise = require('bluebird');
function a(val){
return new Promise(function(resolve){
val++;
resolve(val);
});
}
function b(val){
return new Promise(function(resolve,reject){
#!/bin/bash
#....
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
@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)