Skip to content

Instantly share code, notes, and snippets.

Uzzal Podder uzl

Block or report user

Report or block uzl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@uzl
uzl / nvidia_driver_install_ubuntu_18.md
Last active Sep 28, 2019
Install Latest Nvidia Driver in Ubuntu 18.04
View nvidia_driver_install_ubuntu_18.md

Install Latest Nvidia Driver in Ubuntu 18.04 LTS

Step: 1

Remove previous installation

sudo apt-get purge nvidia*
sudo apt-get autoremove 

@uzl
uzl / docker history.sh
Last active Sep 26, 2019
To generate the docker file, docker history can be used.
View docker history.sh
docker history --no-trunc c3555fec4fe6 $argv | tac | tr -s ' ' | cut -d " " -f 5- | sed 's,^/bin/sh -c #(nop) ,,g' | sed 's,^/bin/sh -c,RUN,g' | sed 's, && ,\n & ,g' | sed 's,\s*[0-9]*[\.]*[0-9]*[kMG]*B\s*$,,g' | head -n -1
@uzl
uzl / docker history
Created Sep 26, 2019
To generate the docker file, docker history can be used.
View docker history
docker history --no-trunc c3555fec4fe6 $argv | tac | tr -s ' ' | cut -d " " -f 5- | sed 's,^/bin/sh -c #(nop) ,,g' | sed 's,^/bin/sh -c,RUN,g' | sed 's, && ,\n & ,g' | sed 's,\s*[0-9]*[\.]*[0-9]*[kMG]*B\s*$,,g' | head -n -1
@uzl
uzl / get_usb_camera_id_for_opencv.py
Created Jul 2, 2019
get usb camera id automatically for opencv
View get_usb_camera_id_for_opencv.py
def get_usb_camera_id():
from subprocess import check_output
out = check_output(["ls /dev/video*"], shell=True)
out = out.decode('utf-8').strip().split('\n')
if len(out) == 0:
raise Exception('No camera Module Found')
cam_id = None
for dev in out:
@uzl
uzl / generate_distribution.py
Created May 22, 2019
Generate number array based on a range, std and mean condition
View generate_distribution.py
import numpy as np
import scipy.stats
from pprint import pprint
import matplotlib.pyplot as plt
import logging
logging.basicConfig(level=logging.DEBUG)
# source: https://stackoverflow.com/a/50629604/4257991
def my_distribution(min_val, max_val, mean, std):
scale = max_val - min_val
@uzl
uzl / plot_multiple_image.py
Created May 21, 2019
Plot multiple image in Matplotlib
View plot_multiple_image.py
def my_plot():
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(8, 8))
columns, rows = 4, 5
for i in range(1, columns * rows + 1):
img = np.random.randint(10, size=(10, 10))
@uzl
uzl / jupyter_cmds.md
Last active May 13, 2019
Jupyter Notebook commands
View jupyter_cmds.md

Run remote jupyter in localhost using ssh tunnel

in remote server

jupyter notebook --no-browser --port=8889

in local server

@uzl
uzl / my_git.md
Last active Apr 26, 2019
Useful git CLI
View my_git.md

Upload a new local repository to gitlab

This will create a new project on Gitlab without creating it manually on the server

git push --set-upstream address/your-project.git

Changing/Switching remote URLs

@uzl
uzl / jai_usb3.py
Created Apr 11, 2019
Capturing Usb Industrial Camera
View jai_usb3.py
from harvesters.core import Harvester
import numpy as np
import matplotlib.pyplot as plt
import cv2
import time
from harvesters.util.pfnc import mono_location_formats, \
rgb_formats, bgr_formats, bayer_location_formats, \
rgba_formats, bgra_formats
@uzl
uzl / installing_aravis.txt
Created Apr 9, 2019
Compiling and Installing Aravis with USB support
View installing_aravis.txt
# download source from http://ftp.gnome.org/pub/GNOME/sources/aravis.
# Note: I found problem for USB support in github source
./configure --enable-viewer --enable-usb --enable-gst-plugin --enable-introspection=yes
make
sudo make install
You can’t perform that action at this time.