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
// This script will alert you whenever some slot opens up on the given date within the given pincodes | |
// Change the pincodes to your needs as per your city | |
// Optionally: the next_days variable can be set to number of days it has to check. (If you set to 3, will check for next three days.) | |
// How To setup Video -> https://www.youtube.com/watch?v=3_N5FFegtI4 | |
// Steps to use | |
// 1. Update Config | |
// 2. Login to https://selfregistration.cowin.gov.in/ | |
// 3. Rigt Click on the website |
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 mysql.connector | |
#CA Bundle file is provided on AWS documentation for RDS: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html | |
#Link: https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem | |
SSL_CA='rds-combined-ca-bundle.pem' | |
cnx = mysql.connector.connect(user='db-user', password='xxxx', | |
host='xxxx.xxxx.us-west-2.rds.amazonaws.com', | |
database='db-user', ssl_ca=SSL_CA) | |
cnx.close() |
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 | |
#To use this script: | |
#1) Save this file with name of your app in /etc/init.d folder. | |
#2) Update the APP_NAME to the name of your application in build.sbt. | |
#3) Update the APP_PATH of the application to the path where you extracted your dist version/snapshot. | |
#4) Update the value of PORT to the port you would like your application to run on. | |
#5) Add this script as service using update-rc.d. (Example: sudo update-rc.d your-app defaults). | |
# | |
APP_NAME="your-app-name" |
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
ls -1 *.json | sed 's/.json$//' | while read col; do | |
mongoimport --host sample-mongodb-host.com --username john --password sample-password --db sample-db --collection $col --file $col.json | |
echo $cmd | |
done |
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
<?php | |
// A helper function to validate Facebook Auth-Token. | |
// This checks if the Facebook auth-token is valid, and belongs to the said facebook-id | |
function is_facebook_auth_valid($facebook_token, $facebook_id) | |
{ | |
$ch = curl_init(); | |
$url="https://graph.facebook.com/me?access_token=".$facebook_token; | |
curl_setopt($ch, CURLOPT_URL,$url ); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |