Skip to content

Instantly share code, notes, and snippets.

View tungphan-agilityio's full-sized avatar
🎯
Focusing

Tung Phan tungphan-agilityio

🎯
Focusing
  • AgilityIO - Software Innovation Redefined
  • Da Nang
View GitHub Profile
@tungphan-agilityio
tungphan-agilityio / upgrade-osx-bash.sh
Created May 22, 2018 14:40 — forked from Rican7/upgrade-osx-bash.sh
Upgrade Bash on Mac OS X
#/usr/bin/env sh
#
# Requires homebrew (http://brew.sh/)
# Thanks http://clubmate.fi/upgrade-to-bash-4-in-mac-os-x/
brew update && brew install bash && sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells' && chsh -s /usr/local/bin/bash
Setting up Database Servers for Development on Mac OS X Using Docker
$ docker run --name=mysql1 -d -p 3306:3306 -e MYSQL_USER=dev -e MYSQL_PASSWORD=dev123 -e MYSQL_DATABASE=dev mysql/mysql-server
@tungphan-agilityio
tungphan-agilityio / Fix OpenSSL Padding Oracle vulnerability (CVE-2016-2107) - Ubuntu 14.04
Created February 27, 2018 10:14
Fix OpenSSL Padding Oracle vulnerability (CVE-2016-2107) - Ubuntu 14.04
# Based on http://fearby.com/article/update-openssl-on-a-digital-ocean-vm/
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ wget ftp://ftp.openssl.org/source/openssl-1.0.2j.tar.gz # Check the last version
$ tar -xvzf openssl-1.0.2h.tar.gz
$ cd openssl-1.0.2h
$ ./config --prefix=/usr/
$ make depend
@tungphan-agilityio
tungphan-agilityio / minikube-sierra.md
Created February 3, 2018 02:52 — forked from inadarei/minikube-sierra.md
Minikube Setup: Docker for Mac / Sierra

Prerequisite: latest Docker for Mac on MacOS Sierra

$ brew update
$ brew install --HEAD xhyve
$ brew install docker-machine-driver-xhyve
$ sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.18.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
@tungphan-agilityio
tungphan-agilityio / rm_mysql.md
Created December 20, 2017 15:03 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

find . -type d | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
find . -type d | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
find . -type d | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
General
1. Site uses a cache buster for expiring .js, .css, and images
2. JavaScript and CSS is minified and concatenated into logical groupings
3. Images have been optimized by ImageOptim (http://imageoptim.com/)
Markup
1. Code does not contain inline JavaScript event listeners
@tungphan-agilityio
tungphan-agilityio / SpringAdLdapTest.java
Created April 21, 2017 04:53 — forked from mpilone/SpringAdLdapTest.java
A simple example of using Spring LDAP to authenticate a user against Active Directory.
// Setup the LDAP client (normally done via Spring context file).
LdapContextSource contextSource = new LdapContextSource();
contextSource.setUrl("ldap://adserver.mycompany.com:3268");
contextSource.setBase("DC=AD,DC=MYCOMPANY,DC=COM");
contextSource.setUserDn("readonlyuser@ad.mycompany.com");
contextSource.setPassword("password1");
contextSource.afterPropertiesSet();
LdapTemplate ldapTemplate = new LdapTemplate(contextSource);
ldapTemplate.afterPropertiesSet();