Sunday, October 9, 2016

making a symbolic link in mac (mysql and sublime example)

ln -s "/Applications/MAMP/Library/bin/mysql" /usr/local/bin/mysql
- for mysql
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
- for sublime

How to Block any website in MAC Os or linux

To be more productive some time you may want to block some website.  In my case sometimes I block amazon.com, amazon.in, facebook.com.
To block  website you need to edit your host file
go to terminal and type 
sudo vi /etc/hosts
It will ask for your password

in hosts file add the following line
127.0.0.1   www.facebook.com
127.0.0.1   www.amazon.com

you can add as many as you want to your host file. State above example block www.facebook.com and www.amazon.com.

You may find out some time those example not work with out reboot. In this case you need to clear  dns cache

just type following line in terminal to clear cache

dscacheutil -flushcache




css snippet for blogger code highlighting

code, .code {     display: block;     background: beige;     padding: 10px;     margin: 8px 15px; }