Skip to content

Instantly share code, notes, and snippets.

@tejasvi
tejasvi / file
Last active July 29, 2020 11:44
colab ssh
cd $HOME
wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
unzip -qq -n ngrok-stable-linux-amd64.zip && rm ngrok-stable-linux-amd64.zip
apt-add-repository ppa:fish-shell/release-3 -y > /dev/null
apt-get update
apt-get install -qq -o=Dpkg::Use-Pty=0 openssh-server pwgen
echo root:pass | chpasswd
mkdir -p /var/run/sshd
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
@tejasvi
tejasvi / README.md
Created December 15, 2019 03:29
Solarized for Windows 10
@tejasvi
tejasvi / pose.py
Last active December 13, 2019 16:42
Pose estimation with OpenPose
import pyrealsense2 as rs
import numpy as np
import cv2
from openpose import pyopenpose as op
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Configure depth and color streams
pipeline = rs.pipeline()
config = rs.config()
@tejasvi
tejasvi / .cvimrc
Last active December 11, 2019 06:42
cVim for chrome
let searchengine google = "https://www.google.com/search?glp=1&hl=EN&tci=g:2840&uule=w+CAIQICINVW5pdGVkIFN0YXRlcw&q="
let mapleader = ","
map <Leader>r reloadTabUncached
" Displays your public IP address in the status bar
map ci :call getIP<CR>
let blacklists = ["*youtube.com*"]
map ,d scrollFullPageDown
map ,u scrollFullPageUp
let hintcharacters = "fjghtyeirucmdkbnxloewsapqz"
set noautofocus
@tejasvi
tejasvi / speak.py
Created November 19, 2019 15:30
Retrieve Ame pronunciation of words offered by google
import urllib.request
import shutil
...
# Download the file from `url` and save it locally under `file_name`:
with urllib.request.urlopen(url) as response, open(file_name, 'wb') as out_file:
@tejasvi
tejasvi / drive.py
Created October 6, 2019 05:17
mass delete drive files
from __future__ import print_function
import httplib2
import os
from oauth2client.file import Storage
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
import sys
np.set_printoptions(threshold=sys.maxsize)
ig1 = cv.imread('i2.jpg', 0)
ic1 = cv.imread('i2.jpg', 1)
ig2 = cv.imread('i1.png', 0)
ic2 = cv.imread('i1.png', 1)
import os
import string
import math
#import nltk
lis = []
i = 0
ind = {}
def binary_search(array, target):
switch (d.get_type()) {
case DirectoryIterator::DIRECTORY: {
const char * pt = strrchr(d.leafname(), '.');
if (pt)
if (binary_search(dasfile.begin(), dasfile.end(), pt)) {
index_file(file, url, d, mime_map);
break;
}
size_t new_limit = depth_limit;
@tejasvi
tejasvi / gist:9f36e2cc371b9331ff2b3eec279f1212
Last active March 26, 2019 13:33
PYTHONPATH=/home/tejasvi/xapian/build/xapian-bindings/python/ python2 code/python/script.py data.csv db
_____________________________________________________
# script output
_____________________________________________________
Traceback (most recent call last):
File "code/python/index1.py", line 6, in <module>
import xapian
File "/home/tejasvi/xapian/build/xapian-bindings/python/xapian/__init__.py", line 29, in <module>
from . import _xapian