Skip to content

Instantly share code, notes, and snippets.

View amirtds's full-sized avatar
💻
Working from home

Amir Tadrisi amirtds

💻
Working from home
View GitHub Profile
import csv # for reading and manipulating the CSV file
import MySQLdb #Mysql Connector
#Establish connection to MysqlDB
mysql_db = MySQLdb.connect(host="", user="root", password="", db="edxapp", port=3306)
#create a cursor for sql statments
mysql_cursor = mysql_db.cursor()
# container for users emails, their countries and their foriegn key id
@amirtds
amirtds / install-comodo-ssl-cert-for-nginx.rst
Created August 20, 2017 15:08 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

Keybase proof

I hereby claim:

  • I am amirtds on github.
  • I am amirtds (https://keybase.io/amirtds) on keybase.
  • I have a public key ASADxJgw2Fcrxk9dOKXkjM_wZtbWBnxHXX99E0Xv4mgHpQo

To claim this, I am signing this object:

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Common Vagrant Commands

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
  • vagrant status -- outputs status of the vagrant machine
  • vagrant halt -- stops the vagrant machine
  • vagrant reload -- restarts vagrant machine, loads new Vagrantfile configuration
  • vagrant provision -- forces reprovisioning of the vagrant machine
@amirtds
amirtds / livestreamingyoutube
Created April 26, 2016 20:06 — forked from laurenarcher/livestreamingyoutube
Livestreaming to Youtube Live, Ubuntu, Linux FFMPEG
Terminal Commands:
One webcam:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
Two webcam overlay:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -f v4l2 -s 320x240 -r 10 -i /dev/video0 -filter_complex "[1:v]setpts=PTS-STARTPTS[bg]; [2:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=shortest=1 [out]" -map "[out]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
@amirtds
amirtds / Hacker_school_residents_scrapper
Created January 17, 2015 15:29
This file is just for demonstration of the coding in pyhton to hacker school
__author__ = 'amir'
#First of all let's install Python request :) through the --> pip install requests
#install BeautifulSoup for pulling out the data--> pip install BeautifulSoup or apt-get install python-bs4 (ubuntu)
import requests
from bs4 import BeautifulSoup
#define the url that we want pull out the data from
url = "https://www.hackerschool.com/residents"
#making a request to our url