Skip to content

Instantly share code, notes, and snippets.

View SHi-ON's full-sized avatar
🎯
focused

Shawyan SHi-ON

🎯
focused
View GitHub Profile
@zrruziev
zrruziev / NUMA node problem.md
Last active April 11, 2024 02:33
Fixing "successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero" problem

What is NUMA (Non-Uniformed Memory Access)

Non-Uniform Memory Access (NUMA) is one of the computer memory design methods used in multiprocessor systems, and the time to access the memory varies depending on the relative position between the memory and the processor. In the NUMA architecture, when a processor accesses its local memory, it is faster than when it accesses the remote memory. Remote memory refers to memory that is connected to another processor, and local memory refers to memory that is connected to its own processor. In other words, it is a technology to increase memory access efficiency while using multiple processors on one motherboard. When a specific processor runs out of memory, it monopolizes the bus by itself, so other processors have to play. , and designate 'access only here', and call it a NUMA node.

1. Check Nodes

lspci | grep -i nvidia
  
01:00.0 VGA compatible controller: NVIDIA Corporation TU106 [GeForce RTX 2060 12GB] (rev a1)
@Mlawrence95
Mlawrence95 / confusion_matrix.py
Last active March 26, 2024 10:25
Python: create a confusion matrix across two columns in a Pandas dataframe having only categorical data
import pandas as pd
def confusion_matrix(df: pd.DataFrame, col1: str, col2: str):
"""
Given a dataframe with at least
two categorical columns, create a
confusion matrix of the count of the columns
cross-counts
use like:
@recamshak
recamshak / sparse_memmap_dbscan.py
Last active August 2, 2022 17:21
sklearn DBSCAN with O(n) memory budget
from sklearn.datasets import make_blobs
from sklearn.cluster import dbscan
from sklearn.cluster._dbscan_inner import dbscan_inner
from sklearn.metrics import pairwise_distances_chunked
from scipy.sparse import csr_matrix
import numpy as np
# dataset
n = 50000
ds, _ = make_blobs(n, 100, 50)
@miwong
miwong / mnist_tutorial_jsma.md
Created September 21, 2018 20:07
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.

@miwong
miwong / mnist_tutorial_fgsm.md
Last active August 6, 2022 09:55
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

@nzec
nzec / README.MD
Last active February 23, 2024 01:08
DeezLoader Offical Page

Thanks to /u/zpoo32 for reporting several issues in this list!

Deemix

  • deemix: just the cli and the library
  • deemix-pyweb: the app with a GUI
  • deemix-server: just the server part of deemix-pyweb
@lucko
lucko / auto-sign-commits-mac.md
Last active April 15, 2024 08:26
Auto-sign commits with IntelliJ on MacOS

Run:

  • brew install gnupg pinentry-mac
  • git config --global user.signingkey <key>
  • git config --global commit.gpgsign true
  • git config --global gpg.program gpg

Then add the following line to ~/.gnupg/gpg-agent.conf:

pinentry-program /usr/local/bin/pinentry-mac
@goffinet
goffinet / jtrinstall.sh
Last active March 6, 2024 03:28 — forked from godevnet/jtrinstall.sh
John the Ripper Installation for Centos 7/8
#!/bin/bash
# Centos 7/8 John the Ripper Installation
#release=(j 1.8.0)
release=(k 1.9.0)
# Check Centos version
if [ -f /etc/redhat-release ] ; then
source /etc/os-release
if [ $VERSION_ID == "8" ] ; then
packager=dnf
elif [ $VERSION_ID == "7" ] ; then
# Centos 7.1
yum -y install wget
wget http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
rpm -ivh nux-dextop-release-0-5.el7.nux.noarch.rpm
yum -y install deluge-web
systemctl start deluge-web
systemctl stop firewalld
@ashwin
ashwin / const.py
Created December 23, 2014 08:19
Alex Martelli's recipe to define constant in Python
# Helps define a constant in Python
# From Section 6.3: Defining Constants
# Python Cookbook (2 Ed) by Alex Martelli et al.
#
# Usage:
# import const
# const.magic = 23 # First binding is fine
# const.magic = 88 # Second binding raises const.ConstError
class _const: