Skip to content

Instantly share code, notes, and snippets.

Developing for the python community!

Nitin Rai imneonizer

Developing for the python community!
View GitHub Profile

install OpenVPN-3 client for Ubuntu 18.04

sudo apt-get install apt-transport-https -y
sudo apt-key add

export DISTRO='bionic'
wget -O /etc/apt/sources.list.d/openvpn3.list$DISTRO.list
sudo apt-get update -y
sudo apt-get install openvpn3 -y
imneonizer /
Last active Oct 16, 2020
how to write multi line texts with opencv
import numpy as np
import cv2
import textwrap
img = np.zeros((500,500,3), dtype='uint8')
height, width, channel = img.shape
text_img = np.ones((height, width))
# warning run every command one by one with precautions
# remove nvidia-docker
sudo apt-get purge -y docker-engine docker docker-ce -y
sudo apt-get autoremove -y --purge docker-engine docker docker-ce -y
## remove unsed programs
sudo apt-get remove --purge libreoffice* -y
sudo apt-get remove libreoffice-core -y
sudo apt-get remove snapd lightdm cups chromium* -y
View move docker to another

1. Stop the docker daemon

sudo service docker stop

2. Add a configuration file to tell the docker daemon what is the location of the data directory Using your preferred text editor add a file named daemon.json under the directory /etc/docker.

sudo vim /etc/docker/daemon.json

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.

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(
View yd-crawler.js
// 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(){
View Google drive

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 '' -O FILENAME

for large files

#requirements: requests, pillow, imthread
#usage: python -i urls.txt -o images --threads 1000
import requests
from requests import exceptions
from PIL import Image
import os
import time
import argparse
imneonizer /
Last active May 14, 2020
How to resolve apt repository problem on linux
Error: Could not resolve 'bionic' unable to find package

These problems occur when sources repository address is configured wrong.
To fix this problem sudo nano /etc/apt/sources.list find out which repository is causing problem and remove it.

To add add default repositories use below command:

sudo add-apt-repository main