Skip to content

Instantly share code, notes, and snippets.

View iamshreeram's full-sized avatar

Shreeram iamshreeram

  • 127.0.0.1
View GitHub Profile
@iamshreeram
iamshreeram / file-backup-copier.sh
Created October 23, 2020 07:39
Live monitor for any new file creation and copy them to destn location : Used for write-only back-up for new files
srcdir="/tmp"; inotifywait -e close_write --format "%f" --monitor $srcdir |
while IFS= read -r line
do
echo $line
cp "$srcdir/$line" . #this would not replicate directories
# tar cf - "$line" | tar -C destination/ xf - #this should replicate directories
done
@iamshreeram
iamshreeram / ml-recs.md
Created July 22, 2020 16:06 — forked from bsletten/ml-recs.md
Machine Learning Path Recommendations

This is an incomplete, ever-changing curated list of content to assist people into the worlds of Data Science and Machine Learning. If you have a recommendation for something to add, please let me know. If something isn't here, it doesn't mean I don't recommend it, I just may not have had a chance to review it yet or not.

I will generally list things in order of easier to more formal/challenging content.

It may feel like there is an overwhelming amount of stuff for you to learn (because there is). But, there is a guided path that will get you there in time. You need to focus on Linear Algebra, Calculus, Statistics and probably Python (or R). Your best bet is to get a Safari Books Online account (https://www.safaribooksonline.com) which you may already have access to through school or work. If not, it is a reasonable way to get access to a tremendous number of books and videos.

I'm not saying you will get what you need out of everything here, but I have read/watched at least some of all of the following an

@iamshreeram
iamshreeram / branch_revert_push.sh
Created July 11, 2020 00:51
Add your latest commit to new branch and revert the changes and push to github
# Add your latest commit to new branch and revert the changes
git branch -m namespace-changes
git reset --hard <commit id of previous branch - c4d52ca8>
git clean -f -d
git push origin +master
git push origin namespace-changes
git log --oneline --decorate --graph
gci | Rename-Item -NewName {$_.Name -replace "\(720P - mp4\)", "" }
gci | Rename-Item -NewName {$_.Name -replace "\(orginalP - mp4\) ", "" }
gci | Rename-Item -NewName {$_.Name -replace "\+", "" }
gci -ex "*.mp4" | ?{!$_.PsIsContainer} | ren -new {$_.name + ".mp4"}
@iamshreeram
iamshreeram / jupyter-for-go.sh
Created May 1, 2020 12:36
Installing golang kernel for jupyter notebook
# We want to install the binary so we need to deactivate Go Modules
# for now:
$ export GO111MODULE=off
$ go get -u github.com/gopherdata/gophernotes
# For macOS
$ mkdir -p $HOME/Library/Jupyter/kernels/gophernotes
$ cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* \
$HOME/Library/Jupyter/kernels/gophernotes
@iamshreeram
iamshreeram / moz-profile-mover.py
Created March 18, 2020 17:53
List of files to move to new profile
# Move below files to new profile
'''
places.sqlite
favicons.sqlite
key4.db
logins.json
permissions.sqlite
search.json.mozlz4
persdict.dat
formhistory.sqlite
@iamshreeram
iamshreeram / server.py
Created March 6, 2020 15:01
Starting python http server from any directory and any port
#! /usr/bin/env python
import posixpath
import argparse
import urllib
import os
from SimpleHTTPServer import SimpleHTTPRequestHandler
from BaseHTTPServer import HTTPServer
@iamshreeram
iamshreeram / simplcrypto.js
Created September 24, 2019 14:57
simple blockchain
const SHA256 = require('crypto-js/sha256')
class Block {
/* In this exercise - create a class called Block and a constructor
with the following variables: index,timestamp,data,priorHash.
Set local variables - i.e.: this.index=index; for all inputs.
Add a local empty string variable named hash */
constructor (index, timestamp, data, priorHash = '') {
this.index = index // where does the block sit on the chain
this.timestamp = timestamp // when was the block created
@iamshreeram
iamshreeram / calc_perc.md
Last active September 10, 2019 20:26
Calculate percentile

Get last word of every line (response time )

awk 'NF>1{print $NF}' file

Percentile

sort -n responsetime | awk '{all[NR] = $0} END{print all[int(NR*0.99 - 0.1)]}'
sort -n responsetime | awk '{all[NR] = $0} END{print all[int(NR*0.999 - 0.01)]}'
@iamshreeram
iamshreeram / setup-clickhouse-docker.md
Last active September 5, 2019 14:40
setup clickhouse in docker

Running clickhouse in docker

Run below commands to pull clickhouse docker and run the server

docker pull yandex/clickhouse-server
docker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 yandex/clickhouse-server

Connect from native client

docker run -it --rm --link some-clickhouse-server:clickhouse-server yandex/clickhouse-client --host clickhouse-server