Skip to content

Instantly share code, notes, and snippets.

View sugengsuprayogi's full-sized avatar
🎯
Focusing

Sugeng Suprayogi sugengsuprayogi

🎯
Focusing
View GitHub Profile
@sugengsuprayogi
sugengsuprayogi / 1) Install
Created November 9, 2016 04:14 — forked from nghuuphuoc/1) Install
Install Redis on Centos 6
// --- Compiling ---
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install
// --- or using yum ---
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
@sugengsuprayogi
sugengsuprayogi / rename_db.sh
Created September 11, 2015 08:34
Script for Rename Database
#!/bin/bash
# Copyright 2015 Sugeng Suprayogi
set -e
if [ -z "$5" ]; then
echo "rename_db <server> <user> <password> <database> <new_database>"
exit 1
fi
db_exists=`mysql -h $1 -u $2 -p$3 -e "show databases like '$5'" -sss`
if [ -n "$db_exists" ]; then
echo "ERROR: New database already exists $5"