This file contains hidden or 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
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, target-densitydpi=medium-dpi, user-scalable=0" /> |
This file contains hidden or 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
''' | |
Copy the list from youtube and save it in a file urls.txt | |
Run this script to get all the urls | |
Put them in a file and run youtube-dl --playlist-start <number> --playlist-end <number> -a "filename.txt" | |
Download entire playlist | |
''' | |
from BeautifulSoup import BeautifulSoup | |
a = open('urls.txt', 'r') |
This file contains hidden or 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
f = open('wordlist.txt', 'r') | |
a = f.readlines() | |
for i in range(0, len(a)): | |
a[i] = a[i][:-2] | |
b = [] | |
for val in a: |
This file contains hidden or 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
sudo tcpdump -i wlan0 -n src 216.58.220.46 -c 5 > capture.dat #can also use src youtube.com | |
cat capture.dat | |
cat capture.dat | awk -F ' ' '{print $5}' | awk -F '.' '{print $1"."$2"."$3"."$4}' | awk -F ':' '{print $1}' |
This file contains hidden or 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
//Works perfectly with the send written above | |
char recvBuff[10]; | |
int bytesReceived = recv(new_fd, recvBuff, 10, 0); | |
while(bytesReceived != 0) | |
{ | |
// you should add error checking here | |
fwrite(recvBuff, bytesReceived, 1, outputFile); |
This file contains hidden or 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
youtube-dl hacks | |
Use: | |
youtube-dl -c <link> //To resume download of a stopped file | |
youtube-dl -F <link> //Download after selecting the format of the file which you want to download | |
Example | |
----------- |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console | |
//tes |
This file contains hidden or 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 pynotify | |
def desktop_notify(title, message): | |
pynotify.init("Test") | |
notice = pynotify.Notification(title, message) | |
notice.show() | |
#Works like a charm on both windows and linux |
This file contains hidden or 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 requests | |
#We often have to automate some task, using requests library can be pretty easy as we | |
#Dont have to bother about the headers which we send along with our call and lets us do things fast. | |
''' | |
Functions to send Simple get and post request along with payload | |
payload is a dictionary | |
cookie is also a dictionary of key value pair |
This file contains hidden or 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 subprocess | |
def runCommand(comm): | |
''' | |
Using the subprocess library this runs the command passed | |
''' | |
proc = subprocess.Popen(comm.split(), stdout=subprocess.PIPE) | |
outputstr = '' | |
for line in proc.stdout.readlines(): | |
outputstr+=line.rstrip()+"\n" |