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 install docker-compose on jetson.md

Install Docker Compose via Python PIP

These are all commands you need to install Docker Compose on a freshly installed NVIDIA Jetson.

# step 1, install Python PIP
$ sudo apt-get update -y
$ sudo apt-get install python3-pip

# step 2, install Docker Compose build dependencies for Ubuntu 18.04 on aarch64
$ sudo apt-get install -y libffi-dev libssl-dev python-openssl
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-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
@imneonizer
imneonizer / auto_tmux_attach.sh
Created Apr 13, 2020
add this file to ~/.bashrc and when ever you will do a ssh connection / open terminal, a tmux session will automatically created/attached
View auto_tmux_attach.sh
if (`tmux attach -t backup`) ; then
echo "tmux attach -t backup"
else
echo "tmux new -s backup"
`tmux new -s backup`
fi
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 tokens.json
{
"pushitbot": "558fc32f64b2adaf889bc29bb97d8150"
}