The steps described here was made and tested in Ubuntu 18.04 x64, and it's main purpose is make easy to prepare environment from scratch to play with Deep Learning on TensorFlow/PyTorch.
-
Update system
$> sudo apt-get -y update
" remap escape key to jk | |
imap jk <Esc> | |
" when possible cursor is in center of screen | |
nnoremap j jzz | |
nnoremap k kzz | |
nnoremap `` ``zz | |
" general settings | |
set rnu et ts=4 sw=4 sts=4 ai cindent nowrap noswapfile cursorline splitbelow splitright |
# This file may be used to create an environment using: | |
# $ conda create --name <env> --file <this file> | |
# platform: linux-64 | |
@EXPLICIT | |
https://repo.anaconda.com/pkgs/main/linux-64/_tflow_select-2.1.0-gpu.tar.bz2 | |
https://repo.anaconda.com/pkgs/main/linux-64/blas-1.0-mkl.tar.bz2 | |
https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2019.6.16-hecc5488_0.tar.bz2 | |
https://repo.anaconda.com/pkgs/main/linux-64/cudatoolkit-10.0.130-0.tar.bz2 | |
https://repo.anaconda.com/pkgs/main/linux-64/gmp-6.1.2-h6c8ec71_1.tar.bz2 | |
https://repo.anaconda.com/pkgs/main/linux-64/icu-58.2-h9c2bf20_1.tar.bz2 |
# source : https://stackoverflow.com/a/54950981/7195250 | |
def tensorflow_shutup(): | |
""" | |
Make Tensorflow less verbose | |
""" | |
try: | |
# noinspection PyPackageRequirements | |
import os | |
from tensorflow import logging |
-- all databases and their sizes | |
select * from pg_user; | |
-- Dump database on remote host to file | |
$ pg_dump -U username -h hostname databasename > dump.sql | |
-- Import dump into existing database | |
$ psql -d newdb -f dump.sql |
def amount_queries(): | |
"""Usage: | |
start_num_queries = amount_queries() | |
... plent of code with django orm queries | |
end_num_queries = amount_queries() | |
num_queries = end_num_queries - start_num_queries |
def format_points_list_to_visualization(points, to_print=True): | |
""" | |
Format a list of Points of Django to able visualization on: | |
https://mobisoftinfotech.com/tools/plot-multiple-points-on-map/ | |
Usage: | |
from django.contrib.gis.geos import Point | |
sample_lat_lng = [ | |
(19.0760,72.8777), |
import os | |
import sys | |
import json | |
import pprint | |
import argparse | |
import subprocess | |
""" | |
Reference: https://blog.cloudflare.com/a-question-of-timing/ |