Skip to content

Instantly share code, notes, and snippets.

View ankitshekhawat's full-sized avatar

Ankit Shekhawat ankitshekhawat

  • Bangalore, India
View GitHub Profile
export CUDA_HOME=/usr/local/cuda
export PATH=/usr/local/cuda/bin:$PATH
export CPATH=/usr/local/cuda/include:$CPATH
export LIBRARY_PATH=/usr/local/cuda/lib64:$LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH
@ankitshekhawat
ankitshekhawat / docker-compose-installer-for-container-optimized-os-on-gce.md Simple Installer for Docker Compose on Container-Optimized OS on Google Computing Engine

Simple Installer for Docker Compose on Container-Optimized OS on Google Computing Engine

The easiest way to make Docker Compose available on Container-Optimized OS on Google Compute Engine (GCE) on Google Cloud Platform (GCP).

This is minimal Bash script version of Community Tutorial.

How to use

Simply, download installer.sh, run it, and then reload bash by source ~/.bashrc or re-login.

@ankitshekhawat
ankitshekhawat / scraper.gs
Last active May 7, 2021 08:56
A basic scraper for google sheets using CheerioGS #appscript #google #sheets
// Author: Ankit Shekhawat
// Copy this code
// Import CheerioGS lib with script id: 1ReeQ6WO8kKNxoaA_O0XEQ589cIrRvEBA9qcWpNqdOP17i47u6N9M5Xh0
// Put Identifier as "Cheerio"
// Version as 12
// ImportXML has limitations
/**
import thinplate as tps
from PIL import Image
import morphops
import cv2
# helper function for https://github.com/cheind/py-thin-plate-spline
import thinplate as tps
from PIL import Image
import cv2
@ankitshekhawat
ankitshekhawat / download_via_aria2p.py
Last active March 12, 2020 05:47
download using an aria deamon
import aria2p
# parellel run:
# aria2c --enable-rpc --rpc-listen-all
# Spawn aria server
import subprocess
subprocess.call(['gnome-terminal', '-e', 'aria2c --enable-rpc --rpc-listen-all'])
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"lines": {
"blueline": {
"name": "Blue Line",
"color": "blue",
"type": "subway"
},
"redline": {
"name": "Red Line",
"color": "red",
@ankitshekhawat
ankitshekhawat / install_pillow_simd.sh
Created May 16, 2019 17:52 — forked from ciscorn/install_pillow_simd.sh
Install pillow-simd on Ubuntu
#!/bin/env bash
pip3 uninstall pillow
apt install \
libjpeg-turbo8-dev \
zlib1g-dev \
libtiff5-dev \
liblcms2-dev \
libfreetype6-dev \
@ankitshekhawat
ankitshekhawat / recall_top_k.py
Last active May 8, 2019 16:42
accuracy metric for online triplet
def recall_top_k(y_true, y_pred):
# get batch size
batch_size = y_pred.shape[0]
# get pairwise distances
dists = _pairwise_distances(y_pred)
# get indexes of the closest item in the batch predictions
# (item itself is always the top_k, so hence getting the second top K)
# top_k function gives indexes for the highest values so subtracting from 2(or a high enough number) to invert the matrix