Skip to content

Instantly share code, notes, and snippets.

View v-i-s-h's full-sized avatar

Vishnu Raj v-i-s-h

View GitHub Profile
@v-i-s-h
v-i-s-h / Pluto.md
Last active February 9, 2023 17:17
Pluto notebooks

Pluto notebooks

@v-i-s-h
v-i-s-h / snippets.md
Created February 26, 2021 23:38
Python snippets

Timestamp generation

timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
@v-i-s-h
v-i-s-h / prepare.sh
Created October 23, 2020 03:49
Jupyter notebook git tools
# prepare notebook folder for commit
# Does
# 1. Render all notebooks to HTML
# 2. Clear all cell outputs
# Make destination directory to store rendered html, if not exists
RENDER_DIR=rendered
mkdir -p rendered
# Get all files with Added, Modified, or untracked status from git
@v-i-s-h
v-i-s-h / .tmux-dark.conf
Last active July 26, 2023 06:22
tmux configuration
# Destination: ~/.tmux.conf
# from powerline
run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')"
run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')"
# default shell
# set-option -g default-command /bin/zsh
# set-option -g default-shell /bin/zsh
@v-i-s-h
v-i-s-h / move-to-next-monitor.sh
Created April 26, 2020 01:25
xfce-move-windows
#!/bin/sh
#
# Move the current window to the next monitor.
#
# Also works only on one X screen (which is the most common case).
#
# Props to
# http://icyrock.com/blog/2012/05/xubuntu-moving-windows-between-monitors/
#
# Unfortunately, both "xdotool getwindowgeometry --shell $window_id" and
@v-i-s-h
v-i-s-h / conda-tf.md
Created April 17, 2020 05:51
Tensorflow performance tips

Notes for performance optimization

Training in local CPU (When using conda tensorflow)

Consider setting the following optimization flags while training.

  • KMP_BLOCKTIME=0
  • KMP_AFFINITY=granularity=fine,verbose,compact,1,0
  • KMP_SETTINGS=1
  • OMP_NUM_THREADS=8 Also, use the following code after importing tf.
@v-i-s-h
v-i-s-h / list_gym_env.sh
Last active February 11, 2020 04:59
List and search all OpenAi Gyms installed
# To list all the available enviroments
python -c "from gym import envs; env_list = [env_spec.id for env_spec in envs.registry.all()]; print(\"\\n\".join(env_list));"
# Search in list with grep
python -c "from gym import envs; env_list = [env_spec.id for env_spec in envs.registry.all()]; print(\"\\n\".join(env_list));" | grep -i cart
@v-i-s-h
v-i-s-h / init.lua
Last active June 25, 2023 15:11
neovim config
-------------------------------- Bootstrap -------------------------------------
-- Install packer
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
local is_bootstrap = false
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
is_bootstrap = true
vim.fn.execute('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path)
vim.cmd [[packadd packer.nvim]]
end
@v-i-s-h
v-i-s-h / rl-lab-cpu.yaml
Created September 27, 2019 04:45
My conda environments
name: rl-lab
channels:
- anaconda
- conda-forge
- defaults
dependencies:
- dbus=1.13.6=h746ee38_0
- expat=2.2.6=he6710b0_0
- fontconfig=2.13.0=h9420a91_0
- freetype=2.9.1=h8a8886c_1
@v-i-s-h
v-i-s-h / test.log
Created May 13, 2019 03:43
CUDAnative.jl: [CUDA error: no kernel image is available for execution on the device (code #209, ERROR_NO_BINARY_FOR_GPU)]
(v1.1) pkg> test CUDAnative
Testing CUDAnative
Resolving package versions...
Status `/tmp/tmpujFYYx/Manifest.toml`
[79e6a3ab] Adapt v0.4.2
[3895d2a7] CUDAapi v0.6.3
[c5f51814] CUDAdrv v3.0.0
[be33ccc6] CUDAnative v2.1.0
[a8cc5b0e] Crayons v4.0.0
[864edb3b] DataStructures v0.15.0