Python Virtual Environment Wrapper

$ pip install virtualenvwrapper
$ which virtualenvwrapper.sh
/usr/local/bin/virtualenvwrapper.sh

Adding path

$ export WORKON_HOME=$HOME/.virtualenvs   # Optional
$ export PROJECT_HOME=$HOME/projects      # Optional
$ source /usr/local/bin/virtualenvwrapper.sh

Reloading Shell

$ source ~/.bashrc
$ echo $WORKON_HOME
/Users/mervinpraison/.virtualenvs

Functions

$ mkvirtualenv my-new-project
(my-new-project) $

To stop using the environment

(my-new-project) $ deactivate
$
$ workon
my-new-project

To activate the environment

$ workon my-new-project

-p parameter to choose the Python Version

$ virtualenv -p $(which python3) blog_virtualenv

Kaggle Github Sync using Shell Script

  1. Create a Github repository
  2. Run “git init” on the local folder
  3. Run “git remote add origin https://github.com/user/repo.git” on the local folder
  4. Create a file shell.sh with the below code on the local folder
  5. Run “bash shell.sh” on the local folder

Shell.sh

for item in $(kaggle kernels list --user USERNAME); do
        if [[ $item == *"USERNAME"* ]]; then
                toreplace=""
                kaggle kernels pull $item -p "${item/USERNAME\/$toreplace}"
        fi
done;
git add .;
git commit -m 'update';
git push -u origin master;

Run Manually

Run “bash shell.sh” on the local folder whenever you make changes to your Kaggle kernels

Crontab

Use crontab to automatically run the script hourly, daily, weekly or monthly

My CodePen

See the Pen Append Element Value in jQuery by Mervin Praison (@MervinPraison) on CodePen.

See the Pen Clear Button in jQuery by Mervin Praison (@MervinPraison) on CodePen.

See the Pen Count Characters in JavaScript by Mervin Praison (@MervinPraison) on CodePen.

Change Category Header to Fullwidth Twentyninteen Theme

Basic netstat Command

netstat [OPTIONS]
    (none)
       Default : Displays  a  list of open sockets

    --route , -r
       Display  the kernel routing tables.

   --groups , -g
       Display multicast group membership information for IPv4 and IPv6.

   --interfaces, -i
       Display a table of all network interfaces.

   --masquerade , -M
       Display a list of masqueraded connections.

   --statistics , -s
       Display summary statistics for each protocol.

Netstat command

netstat

Show numerical addresses

netstat -n

Show only tcp connections

netstat -t

Show only udp connections

netstat -u

Show only listening sockets

netstat -l

Show name and PID of programs

netstat -p

Show network statistics

netstat -s

Show kernel routing table

netstat -r

Show listening ports, process, port numbers

netstat -pln

Show listening ports, process, port numbers for TCP

netstat -plnt