Skip to content

Instantly share code, notes, and snippets.

View liveashish's full-sized avatar

Ashish Kumar Sahoo liveashish

View GitHub Profile
@liveashish
liveashish / collection
Last active August 29, 2015 14:10
Collection of random imporant snippets
1.
****truncate foreign key constrained table****
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table1;
SET FOREIGN_KEY_CHECKS = 1;
2.
**** Create SSH Key ****
ssh-keygen -t rsa -C "[email protected]"
@liveashish
liveashish / djangosetup
Last active September 13, 2017 08:04
Setting Up django
NB: No need to assign STATICFILE_DIRS before commanding collectstatic
1. create project using django-admin.py startproject project
2. /project
pip install gunicorn
3. gunicorn project.wsgi:application #this is for dev and the server dies once you break
@liveashish
liveashish / cronapp.py
Last active August 29, 2015 14:07
MySQL Cron job with Apscheduler
import smtplib
import MySQLdb
import datetime
from datetime import date
# from datetime import datetime
from datetime import timedelta
import time
import os
import logging
BRANCH_ID={'btech_CSE':'b1',
'btech_ETC':'b2',
'btech_EEE':'b3',
'btech_IT':'b4',
'mtech_CSE':'A1', #I don't really know what it is
'faculty':'FP' # i have no clue kya hai iska. i will do that
}
class DoesNotExistError(Exception):
@liveashish
liveashish / test
Created March 5, 2014 14:57
Test Gist
print "this is a test file"