Skip to content

Instantly share code, notes, and snippets.


Vishal Jain jainxy

  • Bengaluru, India
View GitHub Profile
View crontab_tricks.txt
=== Use conda environment to run a python script ===
12 13 * * * . $CONDA_INIT ; $PYTHON <python file>
=== Use date utility for naming a log file ===
DATEVAR="date +%Y%m%d_%H%M"
17 * * * * echo "logs_$($DATEVAR).txt"
jainxy /
Last active Feb 21, 2020
Bash shell scripting




  • Bash (AKA Bourne Again Shell) is a type of interpreter that processes shell commands.
  • A shell interpreter takes commands in plain text format and calls Operating System services to do something.
  • Bash is the improved version of Sh (Bourne Shell).
  • A shell scripting is writing a program for the shell to execute and a shell script is a file or program that shell will execute.
  • Terminal is the interface to the shell interpreter.
  • A shell script is a fully-fledged programming language in itself. It can define variables, functions and we can do conditional execution of shell commands as well.
jainxy /
Created Feb 14, 2020 — forked from karpathy/
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
View data_comparison.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
jainxy / Dockerfile notes
Last active Oct 26, 2020
Description of various commands available for usage in the dockerfile
View Dockerfile notes
References -
Notes -
- A script or receipe having collection of commands and instructions, which will be executed in sequence, to build a new docker image.
- Below are some Dockerfile commands and their usage.
- Base docker image to build new image on top. This is 1st command in the Dockerfile. E.g. dockerized ubuntu image.
jainxy / Useful Links on Tech
Last active Feb 23, 2021
Good resources over web on variety of tech topics
View Useful Links on Tech
jainxy / scikit_nb.txt
Created Apr 11, 2019
Naive Bayes - sklearn
View scikit_nb.txt
# load the iris dataset
from sklearn.datasets import load_iris
iris = load_iris()
# store the feature matrix (X) and response vector (y)
X =
y =
# splitting X and y into training and testing sets
View io_colab.txt
# Ref ->
# ---------- UPLOAD FROM LOCAL FILE SYSTEM --------------------
# files.upload returns a dictionary of the files which were uploaded. The dictionary is keyed by the file name, the value is the data which was uploaded.
# will invoke a browser download of the file to the user's local computer.
jainxy / widget_commands.txt
Created Apr 10, 2019
Colab Layout Widget
View widget_commands.txt
# Ref -
# Build and control layout dynamically through code
from google.colab import widgets
# ----GRIDS-----
grid = widgets.Grid(2, 2, header_row=True, header_column=True) # Grid object
# Grid.output_to(indices) to direct output stream to that place in the grid.
with grid.output_to(1, 1):
jainxy / colab_md.txt
Last active Apr 8, 2019
Markdown - Quick Commands
View colab_md.txt
-> Markdown => Simple Markup language
-> Colab's MD => Rendered via marked.js and similar to those in Jupyter and Github's version
-> Difference: Supports Latex equations(MathJax) like Jupyter but not HTML tags
-> Syntax Highlighting in the code blocks
# This is equivalent to an <h1> tag
##### This is equivalent to an <h5> tag
_A text in italics_ ; __A text in bold__ ; ~~strike-through text~~