Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View thanhson1085's full-sized avatar

Nguyen Sy Thanh Son thanhson1085

  • Hanoi, Vietnam
View GitHub Profile
@thanhson1085
thanhson1085 / .bashrc
Last active October 30, 2015 03:53
My bashrc and vimrc
export GREP_OPTIONS="-n --color"
export VISUAL=vim
export EDITOR="$VISUAL"
alias ff='find . -type f|xargs grep -in'
alias h="history"
alias vi="vim"
alias j='jobs'
alias 1='fg 1'
alias 2='fg 2'
alias 3='fg 3'
@thanhson1085
thanhson1085 / backup.sh
Created January 14, 2016 06:56
Backup files to S3
#!/bin/bash
time=`date +"%Y-%m-%d %H:%M:%S"`
date=`date +"%Y-%m-%d-%H"`
echo Backup Database and Plugins - $time ...
cd /srv/redmine_common/
# delete old files
find ./backup/* -mtime +5 -type f -delete
@thanhson1085
thanhson1085 / cassandra.conf
Created March 11, 2016 03:39
Cassandra Upstart Ubuntu 14.04
# Cassandra Upstart
#
description "Cassandra"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 2 20
@thanhson1085
thanhson1085 / kafka.conf
Created March 11, 2016 04:29
Kafka Upstart Ubuntu 14.04
# Kafka Upstart
#
description "Kafka"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 2 20
@thanhson1085
thanhson1085 / docker-entrypoint.sh
Last active November 19, 2016 14:07
Docker Entrypoint waits Mysql Started before running App
#!/bin/bash
set -e
host="$1"
password="$MYSQL_ROOT_PASSWORD"
until mysql -h "$host" -uroot -p$password; do
>&2 echo "MYSQL is unavailable - sleeping"
sleep 1
@thanhson1085
thanhson1085 / apiserver.service
Last active March 20, 2017 18:51
Run Single-node Kubernetes on CoreOS
[Unit]
Description=Kubernetes API Server
After=etcd2.service
After=docker.service
Wants=etcd2.service
Wants=docker.service
[Service]
ExecStart=/opt/bin/kube-apiserver \
--insecure-bind-address=0.0.0.0 \
@thanhson1085
thanhson1085 / Dev Vagrantfile
Last active August 24, 2017 14:33
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision "file", source: "~/.ssh/id_rsa", destination: "~/.ssh/id_rsa"
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/id_rsa.pub"
config.vm.provision "shell", inline: <<-SHELL
echo Install DEV Enviroment ...
0x7B5F70cd5311B3039BA0b83e8B54B6dEf943Fb7E
0x41354490f7185b27850525a4504538d3edcbf668
{
"config": {
"chainId": 89,
"homesteadBlock": 1,
"eip150Block": 2,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 4,
"clique": {