Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Sunday, October 9, 2016

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




Monday, September 5, 2016

How to install worpress theme , plugin in localhost without ftp in linux environment like ubuntu ..

I installed wordpress in my ubuntu machine but problem is when ever I want to install theme or plugin it require to put ftp credential for localhost. I search on google about this. Lot of article suggest lot of things in this regard. After reading all of this I have understood that this is problem with linux permission(ownership). You need to chown your apache account for that. Here is the command
sudo chown www-data:www-data -R <your wordpress publishing directory>

Monday, April 25, 2016

How to upgrade from python 2.7 to 3.5 linux mint, Ubuntu or any other linux distro

1. First install build Dependencies

sudo apt-get install build-essential checkinstall sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev


2. cd into your download folder

cd ~/Download

3. download Python 3.5 using wget / or you can download manually

wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz

extract Python zip folder using tar zxvf(zip extract verbose file) command

tar zxvf Python-3.5.0.tgz

Now cd into the Python-3.5.0

cd Python-3.5.0

Now install python by following command ./configure 
sudo make install

now make a bash_alias file

gedit .bash_aliases 

Now define the source

source .bash_aliases
Now check python version
python --version

css snippet for blogger code highlighting

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