Skip to content

Instantly share code, notes, and snippets.

View pavank's full-sized avatar
:octocat:

Pavan Keerthi pavank

:octocat:
View GitHub Profile
@pavank
pavank / CUDA 8.0 & cuDNN v6.0 Setup
Created January 12, 2018 12:53 — forked from mjdietzx/waya-dl-setup.sh
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda
@pavank
pavank / copyInstalledPackages.r
Last active December 28, 2018 16:10 — forked from florianhartig/copyInstalledPackages.r
Script to copy the packages installed on one computer or R version to another. Originally from http://stackoverflow.com/questions/1401904/painless-way-to-install-a-new-version-of-r-on-windows
# run on win computer / r version
setwd("C:/Users/pavan/RLibrary/") # or any other existing temp directory
packages <- installed.packages()[,"Package"]
save(packages, file="Rpackages")
# run on ubuntu computer / r version
setwd("/RLibrary") # or any other existing temp directory
load("Rpackages")
for (p in setdiff(packages, installed.packages()[,"Package"]))
@pavank
pavank / VSCode-Python Liniting
Last active January 15, 2024 08:39
PyLint Settings for VSCode
# pylint.rc file in workspace folder
========================================
[MASTER]
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-whitelist=
# Add files or directories to the blacklist. They should be base names, not
@pavank
pavank / sshconfig
Last active May 24, 2019 10:13
Linux Client-OpenSSH Config
# Save file as ~/.ssh/config
# Add permissions chmod 600 ~/.ssh/config
# Optional permissions chmod $USER ~/.ssh/config
##default for all hosts##
Host *
ForwardAgent No
ForwardX11 no
Compression yes
@pavank
pavank / Python venv Setup
Last active May 28, 2019 12:10
Setting up a brand new Python Virtual Env
Step 1(Project context) : mkdir project-folder && cd project-folder
Step-2(Global site package) : pip install virtualenv
Step-3(create virtualenv with python version ) : virtualenv -p /usr/bin/python3.7 .venv
Step-4(activate .venv) : source .venv/bin/activate
Step-4(Local to .venv) : pip install pip-tools
Step-5(manual) : create requirements.in / dev-requirements.in
requirements.in
===============
psycopg2
@pavank
pavank / Gunicorn Config
Created May 28, 2019 09:36
Gunicorn Config
"""gunicorn WSGI server configuration."""
from multiprocessing import cpu_count
from os import environ
def max_workers():
return cpu_count() * 2 + 1
# Config Properties
bind = '0.0.0.0:' + environ.get('PORT', '8080')
max_requests = 1000
@pavank
pavank / ubuntu-rocksdb-pyrocksdb
Last active June 25, 2019 08:51
Pyrocksdb Installation
#Install build libraries
sudo apt-get install build-essential libssl-dev libgflags-dev libreadline-dev libsqlite3-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev
#If using Python3.7 via Dead snakes PPA install python3.7-dev
sudo apt-get install python3.7-dev
#Clone repo
git clone https://github.com/facebook/rocksdb.git
#build locally (https://github.com/facebook/rocksdb/blob/master/INSTALL.md)
To install all currently supported python versions (python 3.6 is already pre-installed) including pip for Ubuntu 18.04 do the following:
# Install Python 3.7 System wide
echo "Installing Python 3.7..."
sudo -S add-apt-repository ppa:deadsnakes/ppa -y
sudo -S apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.7 \
python3.7-dev \
@pavank
pavank / Ubuntu Alternate-Config Python Versions
Created June 24, 2019 10:57
Manage various Python versions in Ubuntu
Python Configuration
======================
Find all versions : ls -ls /usr/bin/python*
Manage Active Version
==========================
Ref: http://web.mit.edu/6.00/www/handouts/pybuntu.html
@pavank
pavank / git_config
Created March 24, 2020 11:01
Git Configuration
Ref : https://news.ycombinator.com/item?id=22672682
You can also do a per-directory _global_ git configuration, e.g.
in .gitconfig, you say:
[user]
name = Me Myself
email = personal@example.com
signingkey = D34DB44F