Skip to content

Instantly share code, notes, and snippets.

View dinhxuanvu's full-sized avatar
😎

Vu Dinh dinhxuanvu

😎
View GitHub Profile
@dinhxuanvu
dinhxuanvu / keybase.md
Created January 15, 2019 16:20
keybase.md

Keybase proof

I hereby claim:

  • I am dinhxuanvu on github.
  • I am vudinh (https://keybase.io/vudinh) on keybase.
  • I have a public key whose fingerprint is 616E 3E84 E0FC D088 5C50 26F4 14EA C12B 195A 1601

To claim this, I am signing this object:

@dinhxuanvu
dinhxuanvu / README.md
Created April 11, 2016 19:08 — forked from ncdc/README.md
Update OpenShift gear DNS and server_identity entries after a devenv gets a new IP address and DNS name (instance stop, instance start)

Save fixdns.rb to your devenv, e.g to ~. Run it like this:

/var/www/openshift/broker/script/rails r ~/fixdns.rb <login>

Also, run this to fix /etc/openshift/port-proxy.cfg:

ip=$(facter ipaddress)
sed -i "s,bind 10\.[0-9.]\+:,bind $ip:," /etc/openshift/port-proxy.cfg
@dinhxuanvu
dinhxuanvu / mysqlbackup.sh
Created March 29, 2016 13:56 — forked from nicdoye/mysqlbackup.sh
Backup your OpenShift MySQL database. My DB is only small so I didn't bother to compress it through a pipe. sftp it back from your local machine afterwards This is basically a quick hack from running "type mysql" on the OpenShift gear - hint: it's a bash function/alias
mkdir ~/app-root/data/tmp
mysqldump -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD" --all-databases > ~/app-root/data/tmp//all.sql
@dinhxuanvu
dinhxuanvu / .bashrc
Created November 9, 2015 21:47 — forked from nhr/.bashrc
Git Branch Display in $PS1
# Helper function for our fancy prompt.
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# Fancy prompt function
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"