Skip to content

Instantly share code, notes, and snippets.

View liveashish's full-sized avatar

Ashish Kumar Sahoo liveashish

View GitHub Profile
@liveashish
liveashish / test
Created March 5, 2014 14:57
Test Gist
print "this is a test file"
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 / 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
@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 / 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@example.com"
<?php
// In case one is using PHP 5.4's built-in server
$filename = __DIR__ . preg_replace('#(\?.*)$#', '', $_SERVER['REQUEST_URI']);
if (php_sapi_name() === 'cli-server' && is_file($filename)) {
return false;
}
// Require composer autoloader
require __DIR__ . '/vendor/autoload.php';
@liveashish
liveashish / linkedin.js
Created April 6, 2017 09:48
Send auto invite on Linkedin
$("button[class='mn-person-card__person-btn-ext button-secondary-medium']").each(function(index, value) {
setTimeout(function() {
jQuery(value).trigger('click');
}, index * 1000);
});
@liveashish
liveashish / resume_parser.py
Last active May 12, 2017 11:31
RecruitPlus resume Parser Wrapper
import json
from zeep import Client
from lxml import etree
import xml.etree.ElementTree
import xmltodict
uploaded_resume = request.FILES['file']
uploaded_file_content = ""
#handles file size
@liveashish
liveashish / spamhaha.py
Last active March 19, 2019 03:17
Sarahah spam bot: A life saver! 🔥 💪
import time
import requests
users_to_attack = ['USER_NAME', ] #list of users to be attacked
def sarahah_post(user, msg):
s = requests.Session()
homeurl = 'https://' + user + '.sarahah.com/'
home = s.get(homeurl)