Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Developing for the python community!

Nitin Rai imneonizer

:octocat:
Developing for the python community!
View GitHub Profile
View open-vpn-alias.md

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
@imneonizer
imneonizer / cv2_multi_line_texts.py
Last active Oct 16, 2020
how to write multi line texts with opencv
View cv2_multi_line_texts.py
import numpy as np
import cv2
import textwrap
img = np.zeros((500,500,3), dtype='uint8')
print(img.shape)
height, width, channel = img.shape
text_img = np.ones((height, width))
View clean_jetson.sh
# warning run every command one by one with precautions
# remove nvidia-docker
sudo apt-get purge -y docker-engine docker docker.io docker-ce -y
sudo apt-get autoremove -y --purge docker-engine docker docker.io 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 location.md

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
View arpspoof.md

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.

View filesystem.py
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()),
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 wget.md

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

View yd-downloader.py
#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
@imneonizer
imneonizer / resolve-apt-repo-problem.md
Last active May 14, 2020
How to resolve apt repository problem on linux
View resolve-apt-repo-problem.md
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