Skip to content

Instantly share code, notes, and snippets.

View alshell7's full-sized avatar

Owais alshell7

View GitHub Profile
@pythonhacker
pythonhacker / test_password_has_argon2i.go
Last active October 6, 2023 14:30
Testing password hashing using Argon2id cryptographic password hashing algorithm
// Storing cryptographic password hashes in database or memory
// and comparing with password.
package main
import (
"log"
"errors"
"strings"
"crypto/subtle"
"encoding/base64"
"""Easily save tf.data.Datasets as tfrecord files, and restore tfrecords as Datasets.
The goal of this module is to create a SIMPLE api to tfrecords that can be used without
learning all of the underlying mechanics.
Users only need to deal with 2 functions:
save(dataset)
dataset = load(tfrecord, header)
To make this work, we create a .header file for each tfrecord which encodes metadata
@XingLiangLondon
XingLiangLondon / Object Detection.md
Last active November 24, 2022 15:42
Object Detection

Object Detection

Why do we need object detection?

  • Labelling Scenes
  • Robot Navigation
  • Self-Driving Cars
  • Body Recognition (Microsoft Kinect)
  • Disease and Cancer Detection
  • Facial Recognition
@fbchow
fbchow / gist:5815dac910b725dfa2b0af0e0ad6dd2a
Last active April 28, 2019 08:55
Copying & Moving Files
I always forget the exacty syntax for copying & moving files, especially when dealing with a remote Linux server. And I had wrote some documentation years ago but lost it (so much for persistent storage!). So here's some notes:
Change into the directory you want to download the files
cd /home/dir_to_dump_file_in
Log onto server using Safe File Transfer Protocol--just like how you would "ssh" into the Linux server
sftp homersimpson@sprinfielduniversity.edu
password: ilovemarge
Obtain the files from the Linux server on to your local server
@nicolasdao
nicolasdao / open_source_licenses.md
Last active April 25, 2024 15:50
What you need to know to choose an open source license.
@Ircama
Ircama / Digispark.md
Last active April 23, 2024 16:21
Configuring the Digispark ATtiny85 board for Arduino IDE and upgrading the bootloader

Configuring the Digispark ATTINY85 board for Arduino IDE and upgrading the bootloader

Warning: this document has to be updated by pointing to https://github.com/SpenceKonde/ATTinyCore

This note describes the configuration of an ATtiny85 based microcontroller development board named Digispark and similar to the Arduino line. It is available in many online marketplaces for roughly 1 dollar (e.g., Ebay, Amazon, AliExpress) and is shipped fully assembled, including a V-USB interface (a software-only implementation of a low-speed USB device for Atmel's AVR microcontrollers). Coding is similar to Arduino: it uses the familiar Arduino IDE and is already provided with a ready-to-use bootloader (

# Create first network with Keras
from keras.models import Sequential
from keras.layers import Dense
import numpy
import threading as t
import tensorflow as tf
graph = tf.get_default_graph()
def t_thread():
@dusenberrymw
dusenberrymw / tensorflow_tips_and_tricks.md
Last active April 2, 2020 16:49
Tips and tricks for TensorFlow, Keras, CUDA, etc.

TensorFlow Tips & Tricks

GPU Memory Issues

  • nvidia-smi to check for current memory usage.
  • watch -n 1 nvidia-smi to monitor memory usage every second.
  • Often, extra Python processes can stay running in the background, maintaining a hold on the GPU memory, even if nvidia-smi doesn't show it.
    • Probably due to running Keras in a notebook, and then running the cell that starts the processes again, since this will fork the current process, which has a hold on GPU memory. In the future, restart the kernel first, and stop all process before exiting (even though they are daemons and should stop automatically when the parent process ends).
@nickoala
nickoala / 0_python_email.md
Last active February 21, 2024 14:20
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria