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
@imneonizer
imneonizer / main.py
Created May 2, 2021
Custom waitKey for opencv
View main.py
# make sure terminal window is active when pressing any key
import cv2
import numpy as np
import time
from waitKey import waitKey
frame = np.zeros((300, 300, 3))
idx, st = 0, time.time()
while True:
@imneonizer
imneonizer / hash_engine.py
Created May 1, 2021
Image hashing techniques
View hash_engine.py
import os
import cv2
import hashlib
import numpy as np
import scipy.fftpack
class HashEngine:
def __init__(self, htype="dhash", hash_size=8):
self.hash_size = hash_size
self.htype = htype
View cuda_visible_devices.py
# use multiple gpu devices by index
import os
#GPU_id = '0'
GPU_id = '0,1,2,3'
os.environ['CUDA_VISIBLE_DEVICES'] = GPU_id
View forward.py
#!/usr/bin/env python
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your option)
# any later version.
View thread_with_return_value.py
import threading
class Thread(threading.Thread):
def __init__(self, group=None, target=None, name=None, args=(), kwargs=None, *, daemon=None):
threading.Thread.__init__(self, group, target, name, args, kwargs, daemon=daemon)
self._return = None
def run(self):
if self._target is not None:
self._return = self._target(*self._args, **self._kwargs)
View ssh_cheatsheet.md

1. Automatic authentication to remote machine

Note:- with this you don't need to type password every time to do the ssh connection.

Step One—Create the RSA Key Pair (your machine)

ssh-keygen -t rsa

Step Two—Store the Keys and Passphrase (your machine)

@imneonizer
imneonizer / nmap.md
Created Jan 5, 2021
Useful Nmap commands
View nmap.md

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
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
@imneonizer
imneonizer / create-vod-hls.sh
Created Nov 25, 2020 — forked from maitrungduc1410/create-vod-hls.sh
Bash scripts to create VOD HLS stream with ffmpeg (Extended version)
View create-vod-hls.sh
#!/usr/bin/env bash
START_TIME=$SECONDS
set -e
echo "-----START GENERATING HLS STREAM-----"
# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1
# comment/add lines here to control which renditions would be created
renditions=(
@imneonizer
imneonizer / install_nfs_client.sh
Created Nov 16, 2020
script for installing nfs server and client
View install_nfs_client.sh
#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"