Skip to content

Instantly share code, notes, and snippets.

View ivankristianto's full-sized avatar

Ivan Kristianto ivankristianto

View GitHub Profile
@ivankristianto
ivankristianto / git-tree.sh
Created March 30, 2017 13:30
Better Git History Tree
git config --global alias.tree 'log --graph --full-history --all --color —pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"'
@ivankristianto
ivankristianto / delete-files-last-modified.sh
Created March 7, 2017 07:14
Delete file with last modified
find /path-to-directory -mtime +5 -exec rm -f {} \;
find /path-to-directory -mtime +5 -exec ls -l {} \;
@ivankristianto
ivankristianto / archdel.zshrc
Created February 23, 2017 02:54
Archive Git Branch
arcdel() {
if [ -z $1 ]; then
echo "Error: missing branch name"
else
git checkout $1
git pull origin $1
git tag archive/$1
git push origin archive/$1
git checkout master
git push origin --delete $1
@ivankristianto
ivankristianto / elasticsearch-docker.sh
Created February 8, 2017 13:43
Run Elasticsearch on Docker
docker run -d --rm --name es -p 9200:9200 -p 9300:9300 elasticsearch:5.2.0
@ivankristianto
ivankristianto / phpbench.txt
Created January 19, 2017 06:10
PHP Benchmark
http://www.phpbench.com/
@ivankristianto
ivankristianto / iterm2-solarized.md
Created January 15, 2017 06:19 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@ivankristianto
ivankristianto / ivan.json
Created January 15, 2017 06:18
tmux profile
{
"Ansi 5 Color" : {
"Green Component" : 0.1080246344208717,
"Blue Component" : 0.4351663589477539,
"Red Component" : 0.7773894071578979
},
"Tags" : [
],
"Ansi 12 Color" : {

How-To: Install Memcache on CentOS (WHM/cPanel)

Without wasting much time, Let us get started!

Follow these simple instructions:

  • Step 1: Login into your WHM panel and using easyapache enable Memcache

  • Step 2: SSH into your server and fire this command yum install memcached.x86_64 php-pecl-memcache.x86_64

@ivankristianto
ivankristianto / wp_mail_smtp.txt
Created December 14, 2016 00:18
wp_mail() log error and smtp setting
add_action('wp_mail_failed', 'log_mailer_errors', 10, 1);
function log_mailer_errors($mailer){
$fn = ABB_FRAMEWORK . 'mail.log'; // say you've got a mail.log file in your server root
$fp = fopen($fn, 'a');
fputs($fp, "Mailer Error: " . json_encode($mailer->get_error_messages()) ."\n");
fclose($fp);
}
add_action( 'phpmailer_init', 'mailer_config', 10, 1);
function mailer_config(PHPMailer $mailer){
@ivankristianto
ivankristianto / delete_bash_history.sh
Created October 19, 2016 02:10
Delete history bash
cat /dev/null > ~/.bash_history && history -c && exit