find . -maxdepth 1 -name "*.pdf" -print0 | xargs -0 rm
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
if [ -z "$SSH_AUTH_SOCK" ] ; then | |
eval `ssh-agent -s` | |
ssh-add ~/.ssh/delivery | |
fi | |
if [ -f ~/.bashrc ]; then | |
source ~/.bashrc | |
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
def generate_secure_s3_url(s3_key) | |
# | |
# s3_key would be a path (including filename) to the file like: "folder/subfolder/filename.jpg" | |
# but it should NOT contain the bucket name or a leading forward-slash | |
# | |
# this was built using these instructions: | |
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?S3_QSAuth.html | |
# http://aws.amazon.com/code/199?_encoding=UTF8&jiveRedirect=1 | |
s3_base_url = MyApp::Application::S3_BASE_URL # i.e. https://mybucket.s3.amazonaws.com |
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
Clarification: There are two default shell settings. | |
One is the Unix setting and can be changed with chsh -s. | |
The other is the Terminal.app-specific setting, and can be changed in Terminal preferences. | |
You can set your Terminal default shell command to /bin/bash -l in the Terminal app. | |
-l tells Bash to read startup files. Even if you don't have any user-specific startup files, there are system-wide startup files that will, among other things, set the prompt to the one you're familiar with. | |
If you've properly set your Unix default shell, you should be able to select Default login shell in Terminal preferences and this will happen automatically. |
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
#import necessary libraries | |
import cv2 | |
import numpy as np | |
#capture video from the webcam | |
cap = cv2.VideoCapture(0) | |
#load the face finder | |
face_cascade = cv2.CascadeClassifier('/home/sm/Desktop/haarcascade_frontalface_default.xml') |
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 | |
sudo mrt uninstall | |
sudo mrt uninstall --system | |
rm -rf ~/.meteorite | |
sudo rm /usr/local/bin/meteor | |
rm -rf ~/.meteor | |
sudo chown -R $(whoami) ~/.npm |
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
conf = { | |
"sqs-access-key": "", | |
"sqs-secret-key": "", | |
"sqs-queue-name": "", | |
"sqs-region": "us-east-1", | |
"sqs-path": "sqssend" | |
} | |
import boto.sqs | |
conn = boto.sqs.connect_to_region( |