How to Add Syntax Highlighting to Command Line Output

Posted on

install the Python syntax highlighter Pygments sudo apt-get install python-pygments choose an alias and assign the pygmentize command to it, customizing the style however you’d like alias catt=’pygmentize -O style=monokai -f console256 -g’ add the alias line to your bash startup file (.bashrc, for example) to have it available every time you log on enjoy…Continue Reading

How to Backup and Restore a MySQL Database

Posted on

backup mysql database: mysqldump -v -h localhost -u username -p db_name > backup.sql restore mysql database: mysql -v –show-warnings -h localhost -u username -p db_name < backup.sql ​

How to Get Unix Time in Bash

Posted on

get current unix time in seconds date +%s in milliseconds date +%s%3N tested on Ubuntu 14.04.2 ​