Skip to content

Instantly share code, notes, and snippets.

View anistark's full-sized avatar
💻
Open Innovation and Development

Ani anistark

💻
Open Innovation and Development
View GitHub Profile
@anistark
anistark / bash_profile.txt
Created January 20, 2016 06:40
Basic Bash Profile
if [ -z "$SSH_AUTH_SOCK" ] ; then
eval `ssh-agent -s`
ssh-add ~/.ssh/delivery
fi
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
@anistark
anistark / gist:95bf5d194478aad713e1
Created February 1, 2016 11:33 — forked from iwasrobbed/gist:1032395
Amazon S3 Query String Authentication for Ruby on Rails
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
@anistark
anistark / ubuntuTricks.md
Created February 4, 2016 07:40
Ubuntu Tips n Tricks
find . -maxdepth 1 -name "*.pdf" -print0 | xargs -0 rm
@anistark
anistark / ShellSettings.txt
Created March 15, 2016 20:06
Shell Settings
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.
#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')
@anistark
anistark / usefulCmds.md
Last active November 8, 2016 07:32
Useful Commands

Useful Commands

Create simple server on the current directory u r in

Python

python -m SimpleHTTPServer 8000
@anistark
anistark / python_errors.md
Last active September 6, 2016 10:19
Common Python Errors

Common Python Errors and handling them

lxml error on mac

Occurance :

    #include "libxml/xpath.h"
             ^
 1 error generated.
@anistark
anistark / reinstallMeteor.sh
Last active August 20, 2016 09:02
Script to remove and install fresh meteor
#!/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
@anistark
anistark / postgresHelp.md
Last active January 10, 2018 08:47
Postgres Most used commands

Postgres

Run :

psql -d test -U postgres -W

Most frequently used commands :

@anistark
anistark / sqs.py
Created September 5, 2016 17:55 — forked from philchristensen/sqs.py
Minimal script for sending/reading from Amazon SQS using Boto/Python.
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(