View edge_detection.py
This file contains 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
# Running first a gaussian blur (kernel size = 3) | |
# and then Canny edge detection (low/high = 1:2 or 1:3) | |
# is a handy way to get the boundaries | |
from matplotlib import image | |
from matplotlib import pyplot | |
import numpy | |
import cv2 | |
view_from_windshield = image.imread('test.jpg') | |
working_copy = numpy.copy(view_from_windshield) |
View region_masking.py
This file contains 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
# Region masking is a technique used to run a image processing or computer vision task within a specific region of interest | |
# Step 1. Build a selector for the region | |
# Step 2. Build a selector for the pixels of interest | |
# Step 3. AND the two selectors. It's that simple. | |
from matplotlib import image | |
from matplotlib import pyplot | |
import numpy | |
view_from_windshield = image.imread('test.jpg') |
View color_selection.py
This file contains 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
# Color selection | |
# Step1. Read the image | |
# Step2. Set the threshold (In our case it is to filter out everything except white) | |
# Step3. Build a selector and | |
# Steo4. Apply the selector | |
# Picking the right color model is very important for a successful computer vision task. | |
# LUV, HSV, RGB, L*a*b etc. | |
# To be able to read the image file we will use the image package from matplotlib | |
from matplotlib import image | |
# To be able to render or plot the image we will use the pyplot package from matplotlib |
View check-size.sh
This file contains 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
du -sh */ |
View mysql-ex.py
This file contains 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
import MySQLdb | |
connection = MySQLdb.connect (host = db_host, user = "yaacdev" , passwd = "yaacmydev", db = "mintshowapp_live") | |
cursor = connection.cursor (MySQLdb.cursors.DictCursor) | |
query='sql query' | |
cursor.execute (query) | |
data = cursor.fetchall() |
View git.sh
This file contains 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
git reset --hard af55c4e | |
git push -f origin HEAD:branch-name |
View password.sh
This file contains 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
# Simple CLI life-hack of the day to find 'password' on your target drives, | |
# even if it is deleted. Do keep it short burst to avoid behavioral detection. | |
sudo strings /dev/sdc | grep -c100 "password" |
View desktop.sh
This file contains 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
#hide | |
defaults write com.apple.finder CreateDesktop -bool false && killall Finder | |
#show | |
defaults write com.apple.finder CreateDesktop -bool true && killall Finder |
View angular2.sh
This file contains 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 | |
# Both the CLI and generated project have dependencies that require Node 6 or higher, together with NPM 3 or higher. | |
# On Ubuntu 16 | |
# sudo apt-get update | |
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - | |
sudo apt-get install -y nodejs # this installs both node and npm | |
# sudo ln -s /usr/bin/nodejs /usr/bin/node | |
sudo npm install -g @angular/cli | |
ng help | |
# sudo npm install extract-text-webpack-plugin@2.0.0-rc.0 --save-dev # https://github.com/angular/angular-cli/issues/4264 |
View ram.sh
This file contains 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
ps aux | awk '{print $6/1024 " MB\t\t" $11}' | sort -n |
NewerOlder