This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'asanyal' | |
import cv2 | |
import numpy as np | |
def getHoughLines(imgFile): | |
img = cv2.imread(imgFile) | |
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) | |
edges = cv2.Canny(gray,50,150,apertureSize = 3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Stop all running containers | |
docker stop $(docker ps -a -q) | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf "/lib/modules/$1" | |
rm -f "/boot/vmlinuz-$1*" | |
rm -f "/boot/initrd.img-$1*" | |
rm -f "/boot/config-$1*" | |
rm -f "/boot/System.map-$1*" | |
update-grub2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import sys | |
if (len(sys.argv) < 3): | |
print "Usage : python black_and_white.py inputFile outputFile" | |
sys.exit(0) | |
image_file = Image.open(sys.argv[1]) # open colour image | |
image_file = image_file.convert('1') # convert image to black and white | |
image_file.save(sys.argv[2]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ] | |
then | |
echo "Usage : ./last_modified_webpage.sh urlOfPage" | |
exit 0 | |
fi | |
curl -sI $1 | grep Last-Modified |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Removing all processes associated with name $1" | |
if [ $# -ne 1 ] | |
then | |
echo "Usage : ./killp process name" | |
exit 0 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
import time | |
# Download the gecko driver https://github.com/mozilla/geckodriver/releases and put in your path env var | |
driver = webdriver.Firefox() | |
driver.get("https://www.google.com/maps/") | |
elem = driver.find_element_by_id("searchbox") | |
# Simulates just typing the words in the google maps search box |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from geopy.geocoders import Nominatim | |
geolocator = Nominatim() | |
location = geolocator.geocode("2550 3rd Avenue Seattle") | |
print(location.address) | |
print((location.latitude, location.longitude)) | |
# Output | |
# 2550, 3rd Avenue, Belltown, Seattle, King County, Washington, 98121, United States of America | |
# (47.6165771, -122.3473058) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set runtimepath+=~/.vim_runtime | |
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
source ~/.vim_runtime/vimrcs/basic.vim | |
source ~/.vim_runtime/vimrcs/filetypes.vim | |
source ~/.vim_runtime/vimrcs/plugins_config.vim | |
source ~/.vim_runtime/vimrcs/extended.vim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# ARE YOU A VIMPLETON? DONT YOU WISH YOU HAD A RAD VIM SETUP. WELL LOOK NO FURTHER. INTRODUCTING, THE ULTIMATE VIM CONFIG. | |
# FULLY ASYNCRHONOUS, NON BLOCKING VIM!!!! | |
# Tested on Amazon Linux 2017 (and by extension RHEL and Fedora machines). | |
# First install neovim | |
wget https://gist.githubusercontent.com/Khalian/ebd345b418b6f42a0359b4c89961af4c/raw/a69a496caf247d40535bc194fa2f08923c63d072/install_neovim_to_amazonlinux.sh | |
sh install_neovim_to_amazonlinux.sh |
OlderNewer