Skip to content

Instantly share code, notes, and snippets.

@ndinh215
ndinh215 / references_trufflecon.md
Created October 8, 2023 04:04 — forked from JoranHonig/references_trufflecon.md
References - DevSecOps: Shifting left smart contract development
@ndinh215
ndinh215 / stepfunction.json
Created April 25, 2023 01:20 — forked from half2me/stepfunction.json
DynamoDB table iteration with a StepFunction
{
"StartAt": "Add empty LastEvaluatedKey",
"States": {
"Add empty LastEvaluatedKey": {
"Type": "Pass",
"Next": "Scan",
"Result": {
"LastEvaluatedKey": null
},
"ResultPath": "$"
@ndinh215
ndinh215 / blockchain.go
Created February 23, 2023 03:23 — forked from LordGhostX/blockchain.go
Blockchain POC with Golang
package main
import (
"crypto/sha256"
"encoding/json"
"fmt"
"strconv"
"strings"
"time"
)
Parallels Business Activation Key
6YDASE-890T7S-E5YFS6-54F6YW-4780JY
390349-032409-342340-932902-390693
@ndinh215
ndinh215 / install_nvidia_driver.md
Created October 8, 2022 04:10 — forked from espoirMur/install_nvidia_driver.md
How I fix this issue NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running

I am no longer abe to monitor this post , I have decided to move everything to my personal blog for better monitoring.

Please click here to access the full post

@ndinh215
ndinh215 / cuda_11.3_installation_on_Ubuntu_20.04
Created October 8, 2022 03:18 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
Instructions for CUDA v11.3 and cuDNN 8.2 installation on Ubuntu 20.04 for PyTorch 1.11
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
from keras.models import Model
from keras.layers.merge import concatenate
from keras.layers import Conv2D , MaxPool2D , Input , GlobalAveragePooling2D ,AveragePooling2D, Dense , Dropout ,Activation, Flatten , BatchNormalization
def conv_with_Batch_Normalisation(prev_layer , nbr_kernels , filter_Size , strides =(1,1) , padding = 'same'):
x = Conv2D(filters=nbr_kernels, kernel_size = filter_Size, strides=strides , padding=padding)(prev_layer)
x = BatchNormalization(axis=3)(x)
x = Activation(activation='relu')(x)
return x
@ndinh215
ndinh215 / add_gaussian_noise.py
Created August 14, 2022 09:52 — forked from Prasad9/add_gaussian_noise.py
Python code to add random Gaussian noise on images
import cv2
def add_gaussian_noise(X_imgs):
gaussian_noise_imgs = []
row, col, _ = X_imgs[0].shape
# Gaussian distribution parameters
mean = 0
var = 0.1
sigma = var ** 0.5
@ndinh215
ndinh215 / mnist_tutorial_fgsm.md
Created August 6, 2022 09:55 — forked from miwong/mnist_tutorial_fgsm.md
CleverHans Tutorials

MNIST tutorial: the fast gradient sign method and adversarial training

This tutorial explains how to use CleverHans together with a TensorFlow model to craft adversarial examples, as well as make the model more robust to adversarial examples. We assume basic knowledge of TensorFlow.

Setup

First, make sure that you have TensorFlow

@ndinh215
ndinh215 / mnist_tutorial_jsma.md
Created August 6, 2022 09:54 — forked from miwong/mnist_tutorial_jsma.md
CleverHans Tutorial - MNIST with JSMA

MNIST tutorial: crafting adversarial examples with the Jacobian-based saliency map attack

This tutorial explains how to use CleverHans together with a TensorFlow model to craft adversarial examples, using the Jacobian-based saliency map approach. This attack is described in details by the following paper. We assume basic knowledge of TensorFlow. If you need help getting CleverHans installed before getting started, you may find our MNIST tutorial on the fast gradient sign method to be useful.