Skip to content

Instantly share code, notes, and snippets.

learning everyday

Rishabh Agrahari pyaf

learning everyday
View GitHub Profile
View preprocess_dockerfile
# Build an image that can do training and inference in SageMaker
# This is a Python 3 image that uses the nginx, gunicorn, flask stack
# for serving inferences in a stable way.
FROM ubuntu:18.04
RUN apt-get -y update && apt-get install -y --no-install-recommends \
View Pycaret_Dockerfile
FROM sklearn-base:0.23-1-cpu-py3
LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true
COPY requirements.txt /requirements.txt
RUN python -m pip install -r /requirements.txt && \
rm /requirements.txt
COPY dist/sagemaker_sklearn_container-2.0-py3-none-any.whl /sagemaker_sklearn_container-2.0-py3-none-any.whl
pyaf /
Created Jun 9, 2021
TF 2.4 GPU Conda Setup
# Initialize conda environment
echo 'Create Conda env? Type y or n and then press [ENTER]:'
read create_env
if [ $create_env = "y" ];
echo "Provide name for Conda virtualenv and then press [ENTER]:"
read env_name
pyaf / gpu
Last active Jun 28, 2020
Bash script for GPU usage and utilization monitoring in i3status bar.
View gpu
output=$(nvidia-smi --format=csv,noheader --query-gpu=name,power.draw,fan.speed,utilization.gpu,temperature.gpu,memory.used,
IFS=',' read -r -a array <<< "$output"
pyaf / init.vim
Last active Mar 8, 2021
My neovim config file
View init.vim
let mapleader =","
call plug#begin('~/.config/nvim/plugged')
Plug 'tpope/vim-surround'
Plug 'scrooloose/nerdtree'
Plug 'mboughaba/i3config.vim'
Plug 'jreybert/vimagit'
Plug 'LukeSmithxyz/vimling'
Plug 'PotatoesMaster/i3-vim-syntax'
Plug 'vimwiki/vimwiki'
View .tmux.conf
set-option -g status-style bg=colour235 #base02
set-option -g status-style fg=colour136 #yellow
set-option -g status-style default
bind -n S-Right next-window
bind -n S-Left previous-window
# set window split
bind-key v split-window -h
bind-key b split-window
pyaf /
Last active Feb 24, 2019
Using only integrated graphics for display and Nvidia GPU for CUDA on Ubuntu 18.04.2

Steps to follow:

  1. Install suitable driver for your Nvidia GPU. Don't worry if nvidia-smi isn't working.
  2. Note the output of lspci | egrep 'VGA|3D', mine gives the following:
00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1f02 (rev a1)
  1. Edit your /etc/X11/xorg.conf as follows
pyaf / sources.list
Created Dec 29, 2018 — forked from rohitrawat/sources.list
Ubuntu 16.04 Xenial default /etc/apt/sources.list
View sources.list
#deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
# See for how to upgrade to
# newer versions of the distribution.
deb xenial main restricted
# deb-src xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb xenial-updates main restricted
pyaf / .tmux.conf
Last active Jan 11, 2021
My tmux config file, for tmux 2.8. (It breaks for >2.8. See comments.)
View .tmux.conf
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
bind -n S-Right next-window
bind -n S-Left previous-window
# set window split
bind-key v split-window -h
bind-key b split-window
pyaf /
Created May 20, 2018
CNN model architecture
def CNN_model():
model = Sequential()
model.add(Conv2D(32, (3, 3), input_shape=(124, 124, 3)))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(32, (3, 3)))
model.add(MaxPooling2D(pool_size=(2, 2)))