Skip to content

Instantly share code, notes, and snippets.

View basaks's full-sized avatar

Sudipta Basak basaks

  • Geoscience Australia
  • Sydney
View GitHub Profile
@basaks
basaks / Python3.9 on ubuntu22.04 Jammy
Last active May 5, 2024 00:51
Python3.9 on ubuntu22.04 Jammy
## Install Python3.9 interpreter on ubuntu 22.04
On a terminal just do the following steps:
Install dependencies:
sudo apt install tar build-essential checkinstall libreadline-dev \
libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev \
libbz2-dev openssl libffi-dev
@basaks
basaks / Python3.7 on ubuntu22.04 Jammy
Last active June 19, 2022 23:53
Python3.7 on ubuntu 22.04 Jammy
## Install Python3.7 interpreter on ubuntu 22.04
On a terminal just do the following steps:
Install dependencies:
sudo apt install tar build-essential ch1eckinstall libreadline-dev \
libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev \
libbz2-dev openssl libffi-dev
@basaks
basaks / Python3.8 on ubuntu22.04 Jammy
Last active April 22, 2024 11:05
Python3.8 on ubuntu 22.04 Jammy
## Install Python3.8 interpreter on ubuntu 22.04
On a terminal just do the following steps:
Install dependencies:
sudo apt install tar build-essential checkinstall libreadline-dev \
libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev \
libbz2-dev openssl libffi-dev
@basaks
basaks / kl.py
Last active May 25, 2022 04:42 — forked from atabakd/kl.py
KL divergence for multivariate samples
# https://mail.python.org/pipermail/scipy-user/2011-May/029521.html
import numpy as np
from scipy.spatial import cKDTree as KDTree
from scipy.special import rel_entr
def KLdivergence(x, y):
"""Compute the Kullback-Leibler divergence between two multivariate samples.
Parameters
@basaks
basaks / python3.9 on ubuntu 18.04
Last active September 29, 2023 18:23
Install python3.9 on ubuntu 18.04
## Install Python3.9 interpreter on ubuntu 18.04
[From here](http://devmartin.com/blog/2016/04/creating-a-virtual-environment-with-python3.4-on-ubuntu-16.04-xenial-xerus/), we can pretty much follow the exact same procedure.
Only this I needed to on top of that blog was the `libffi-dev` system dependency.
On a terminal just do the following steps:
Install dependencies:
@basaks
basaks / australian-postcodes.sql
Created July 8, 2019 01:01 — forked from randomecho/australian-postcodes.sql
Australian postcodes (with states and suburb names) geocoded with latitude and longitude.
/*
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod
May contain errors where latitude and longitude are off. Use at own non-validated risk.
*/
SET NAMES utf8;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS postcodes_geo;
@basaks
basaks / python 3.7 on ubuntu 18.04
Last active March 14, 2021 11:18
Alternate python 3.7 installation on ubuntu 18.04
## Install Python3.7 interpreter on ubuntu 18.04
[From here](http://devmartin.com/blog/2016/04/creating-a-virtual-environment-with-python3.4-on-ubuntu-16.04-xenial-xerus/), we can pretty much follow the exact same procedure.
Only this I needed to on top of that blog was the `libffi-dev` system dependency.
On a terminal just do the following steps:
Install dependencies:
@basaks
basaks / Installing python 3.6 on centos 7
Created September 21, 2017 05:06
Installing python 3.6 on centos
On centos7 perform the following steps
sudo yum -y update
sudo yum groupinstall 'Development Tools' -y
sudo yum -y install yum-utils https://centos7.iuscommunity.org/ius-release.rpm
sudo yum -y install python36u
Check it was installed properly:
@basaks
basaks / virtualenv.rst
Last active June 22, 2017 01:19
virtualenv and virtualenvwrapper

Virtualenv

It is strongly recommended that you install python packages in a virtualenv. Here are some brief steps to install virtualenv on linux:

Install pip

$ sudo apt-get install python-pip
@basaks
basaks / python36.md
Last active January 28, 2022 13:00
Install Python3.6 interpreter on ubuntu 16.04

Install Python3.6 interpreter on ubuntu 16.04

From here, we can pretty much follow the exact same procedure.

On a terminal just do the following steps:

Install dependencies:

sudo apt install build-essential checkinstall libreadline-gplv2-dev \