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
  • 05:21 (UTC +05:30)
  • X @imneonizer
View GitHub Profile

How To Publish Your PyPi Package

The PyPi package index is one of the properties that makes python so powerful, with just a simple command, you get access to thousands of cool libraries, ready for you to use. I am going to show you how you can upload your own package.

PyPi

Create a python package

To create a package, create a folder that is named exactly how you want your package to be named. Place all the files and classes that you want to ship into this folder.

@imneonizer
imneonizer / clahe_correction.py
Created September 6, 2019 13:57
Short simple image processing script to automatically adjust brightness and contrast of input image
import cv2
import sys
import imutils
#-----Reading the image-----------------------------------------------------
img = cv2.imread('1.jpg')
#img = imutils.resize(img, width=400)
#cv2.imshow("img",img)
#-----Converting image to LAB Color model-----------------------------------

What is tmux

tmux is a ssh session logging/sharing tool which we can use to reconnect to a ssh session even if we lost the connection in between.

How to install

First we need to install it in the remote machine, to do so ssh into the remote machine and run this command

sudo apt-get install tmux

For Example:

Find all the available mountable file drives on your system:

sudo fdisk -l

output:

Disk /dev/ram0: 8 MiB, 8388608 bytes, 16384 sectors
@imneonizer
imneonizer / how to rename hostname on linux.md
Created February 25, 2020 08:34
how to rename hostname on linux
import cv2
def VideoCapture(uri, width, height, latency):
gst_str = ('rtspsrc location={} latency={} ! '
'rtph264depay ! h264parse ! omxh264dec ! '
'nvvidconv ! '
'video/x-raw, width=(int){}, height=(int){}, '
'format=(string)BGRx ! '
'videoconvert ! appsink').format(uri, latency, width, height)
return cv2.VideoCapture(gst_str, cv2.CAP_GSTREAMER)
{
"pushitbot": "558fc32f64b2adaf889bc29bb97d8150"
}
@imneonizer
imneonizer / auto_tmux_attach.sh
Created April 13, 2020 15:16
add this file to ~/.bashrc and when ever you will do a ssh connection / open terminal, a tmux session will automatically created/attached
if (`tmux attach -t backup`) ; then
echo "tmux attach -t backup"
else
echo "tmux new -s backup"
`tmux new -s backup`
fi

How to find disk usage information on linux

Install this simple tool ncdu for linux

sudo apt install ncdu

After this simply run the command:

sudo ncdu -x /
@imneonizer
imneonizer / resolve-apt-repo-problem.md
Last active May 14, 2020 05:37
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