Web scrapers on the internet
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
print "this is a test file" |
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
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): |
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 smtplib | |
import MySQLdb | |
import datetime | |
from datetime import date | |
# from datetime import datetime | |
from datetime import timedelta | |
import time | |
import os | |
import logging | |
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
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 |
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
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]" |
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 | |
// 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'; |
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
$("button[class='mn-person-card__person-btn-ext button-secondary-medium']").each(function(index, value) { | |
setTimeout(function() { | |
jQuery(value).trigger('click'); | |
}, index * 1000); | |
}); |
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 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 |
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 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) |
OlderNewer