Minify html output with simple php function

It’s always a pleasure to have html tags tidy and attached to one another. especially if these html tags are yours in your website. To have this we can do with a simple php function. Place the code below at the top of header php page or index page. <?php function sanitize_output($buffer) { $search = … Read more

Setup uWSGI and Emperor on Centos 6.xx

uWSGI is driving me crazy when install it, every single time. I’m using Centos 6.9 to setup my python app. This one is for setup uWSGI and make sure you already installed Python2.7 on your machine: $ wget https://bootstrap.pypa.io/get-pip.py $ which python2.7 $ sudo /usr/local/bin/python2.7 get-pip.py $ which pip2.7 $ sudo /usr/local/bin/pip2.7 install uWSGI $ … Read more

Setup puppet master & puppet agent on Ubuntu 16.04

Overview – puppet-master (ubuntu 16.04) – db1 (ubuntu 16.04) Setup puppet master On master server, do the following steps: Add puppet host in /etc/hosts $ vim /etc/hosts ip-private puppet-master Install puppet master: $ wget https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb $ sudo dpkg -i puppetlabs-release-pc1-xenial.deb $ sudo apt-get update -y $ sudo apt-get install puppetserver -y Change memory allocation: open … Read more

Arcanist cheatsheet

$ arc patch D123 $ git add . $ git commit -am “update” $ arc diff –update D123 $ arc land –revision D123 Update diff to master $ git checkout master $ git merge arcpatch-D123 $ git push Make a diff from current working branch $ git add. $ git commit -am “update” $ arc … Read more

Install redshift on ubuntu 14.04

Redshift is a tool to reduce the brightness and make your display more redness to protect your eyes when you working for too long. Install redshift on ubuntu : $ sudo apt-get install redshift redshift-gtk afterwards, open up redshift (Alt+F2) : redshift-gtk