Skip to content

Instantly share code, notes, and snippets.

View imneonizer's full-sized avatar
:octocat:
Developing for the python community!

Nitin Rai imneonizer

:octocat:
Developing for the python community!
  • SmartCow.ai
  • Delhi, India
  • 10:02 (UTC +05:30)
  • X @imneonizer
View GitHub Profile
#requirements: requests, pillow, imthread
#usage: python yd-downloader.py -i urls.txt -o images --threads 1000
import requests
from requests import exceptions
from PIL import Image
import os
import time
import argparse

Download from google drive using wget

Set the file to Public, get sharing link and extract FILEID

for small files These can also be directly download by visiting the address or using wget

wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

for large files

// collect images links
function collect(){
images = document.getElementsByClassName("serp-item")
images = Object.keys(images).map(key => JSON.parse(images[key].getAttribute("data-bem"))['serp-item']["img_href"])
return images
}
// returs boolean value to check if page end has reached
function footer_hidden(){
import os
import glob
import shutil
import uuid
class TempFile:
def __init__(self, base_path, ext):
self.path = os.path.normpath("{base_path}/{rand}{ext}".format(
base_path=base_path,
rand=str(uuid.uuid4()),

Block people from accessing internet on your network

Install below package

sudo apt-get install dsniff

Find your interface and router's IP address using ifconfig command
if you are on wifi it is usualy wlan0 and for ethernet eth0. Find the IP address of the device you wish to block internet for and fill in place of CHILD_ADRS below.
Do the same for ROUTER_ADRS.

install OpenVPN-3 client for Ubuntu 18.04

sudo apt-get install apt-transport-https -y
wget https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub
sudo apt-key add openvpn-repo-pkg-key.pub

export DISTRO='bionic'
wget -O /etc/apt/sources.list.d/openvpn3.list https://swupdate.openvpn.net/community/openvpn3/repos/openvpn3-$DISTRO.list
sudo apt-get update -y
sudo apt-get install openvpn3 -y
#!/bin/bash
mount_safely (){
PARTITION=$1; MOUNTPOINT=$2
if [ `whoami` == root ];then
# create mount point dir if doesn't exists
[ -d $MOUNTPOINT ] || mkdir -p $MOUNTPOINT
# mount the partition to mountpoint
mount $PARTITION $MOUNTPOINT
# Check if sudo permission is available, else exit
if [ `id -u` != "0" ]
then
echo '[ERROR] please run with sudo'
exit
fi
# Retrieve new hostname from args
if [ -z "$1" ]
then
@imneonizer
imneonizer / install_nfs_client.sh
Created November 16, 2020 10:37
script for installing nfs server and client
#https://vitux.com/install-nfs-server-and-client-on-ubuntu/
#Step 1: Install NFS Common
sudo apt-get update -y
sudo apt-get install nfs-common -y
#Step 2: Create a mount point for the NFS host’s shared folder
#Your client’s system needs a directory where all the content shared by the host server in the export folder can be accessed.
#You can create this folder anywhere on your system. We are creating a mount folder in the mnt directory of our client’s machine.
CLIENT_NFS_DIR="/media/NFS"
@imneonizer
imneonizer / nmap.md
Created January 5, 2021 09:38
Useful Nmap commands

Scan network for open ports and list their IP address

nmap -p 80 192.168.0.179/24 | grep -B 4 -i open | grep -i report