Skip to content

Instantly share code, notes, and snippets.

View prassanna-ravishankar's full-sized avatar

Prassanna Ravishankar prassanna-ravishankar

View GitHub Profile
# source this within your zshrc, should work with bashrc too
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
fi
eval "$(pyenv virtualenv-init -)"
@prassanna-ravishankar
prassanna-ravishankar / .isort.cfg
Last active September 16, 2020 09:38
flake8-black-isort together Pre-comit config
[settings]
line_length=88
indent=' '
skip=.tox,.venv,build,dist
known_standard_library=setuptools,pkg_resources
known_test=pytest
known_first_party=tracker
sections=FUTURE,STDLIB,COMPAT,TEST,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
default_section=THIRDPARTY
multi_line_output=3
@prassanna-ravishankar
prassanna-ravishankar / pre-commit.yml
Created September 16, 2020 08:44
Github Pre-commit action
name: pre-commit
on:
pull_request:
push:
branches: [master]
jobs:
pre-commit:
runs-on: ubuntu-latest
@prassanna-ravishankar
prassanna-ravishankar / apt-fast-install-nosudo.sh
Created January 23, 2020 18:13
Install apt-fast without sudo
#!/bin/bash
set -e
apt_fast_installation() {
if ! dpkg-query --show aria2 >/dev/null 2>&1; then
apt-get update
apt-get install -y aria2
fi
wget https://raw.githubusercontent.com/ilikenwf/apt-fast/master/apt-fast -O /usr/local/sbin/apt-fast
@prassanna-ravishankar
prassanna-ravishankar / sample_mnist.py
Created April 25, 2019 19:26
Example Tensorflow code which Trains for a while using the Keras Frontend.
from __future__ import absolute_import, division, print_function
import os
# TensorFlow and tf.keras
import tensorflow as tf
from tensorflow import keras
# Helper libraries
import numpy as np
import matplotlib.pyplot as plt
@prassanna-ravishankar
prassanna-ravishankar / todo.txt
Created March 2, 2019 18:19
Public Todo lists
1. Improve pyenv-pipenv-better
2. React learn
3. Remake my website
4. Opencv C++ pipes
5. Interface with python
6. Try some new neural networks and implement.
@prassanna-ravishankar
prassanna-ravishankar / libinput-gestures.conf
Last active December 21, 2018 17:57
Lib-Input gestures configurations that I like
# Configuration file for libinput-gestures.
#
# The default configuration file exists at /etc/libinput-gestures.conf
# but a user can create a personal custom configuration file at
# ~/.config/libinput-gestures.conf.
#
# Lines starting with '#' and blank lines are ignored. Currently
# "gesture" and "device" configuration keywords are supported as
# described below. The keyword can optionally be appended with a ":" (to
# maintain compatibility with original format configuration files).
@prassanna-ravishankar
prassanna-ravishankar / Ubuntu 18.04 with Nvidia+CUDA on Optimus Laptop.md
Created December 16, 2018 12:27 — forked from hemenkapadia/Ubuntu 18.04 with Nvidia+CUDA on Optimus Laptop.md
[Ubuntu 18.04 with Nvidia+CUDA on Optimus Laptop] Setting up Ubuntu 18.04 with nvidia drivers and CUDA for data science on Dell 7559 Optimus laptop #Ubuntu #Nvidia #CUDA #setup

Kernel settings for installation

Use a live usb to try Ubuntu before installing. Boot from the live usb. On the GRUB screen highlight the "Try Ubuntu ...." option and press e. Update kernel parameters by adding options before quiet splash such that the line should read as below

nogpumanager nomodeset i915.modeset=1 quiet splash

Note: On HighDPI screen machines there is a known issue whereby Ubiquity (ubuntu installer) craashes at the copying files step i.e. immediatly after the user setup screen. The cause and workaround are discussed in other gist post

Persist GRUB configuration

Post installation, to avoid updating the above mentioned kernel options each time the system is booted, edit GRUB configuration file sudo vi /etc/default/grub and make th

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@prassanna-ravishankar
prassanna-ravishankar / make output
Created December 18, 2014 16:13
opencv-ndarray make output
prassanna@CVC210:~/Development/workspace/opencv-ndarray-conversion$ make
g++ -g -Wall -std=c++11 -I/usr/local/include $(pkg-config --cflags opencv) -I/opt/cuda/include $(pkg-config --cflags python2) \
-fPIC -c examples.cpp
In file included from /usr/include/python2.7/numpy/ndarraytypes.h:1761:0,
from /usr/include/python2.7/numpy/ndarrayobject.h:17,
from conversion.h:8,
from examples.cpp:5:
/usr/include/python2.7/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by " \