Skip to content

Instantly share code, notes, and snippets.

View tzvsi's full-sized avatar
🎯
Focusing

tzvsi tzvsi

🎯
Focusing
  • San Francisco, CA
View GitHub Profile
@tzvsi
tzvsi / guid.py
Created August 7, 2020 17:51
Create a Deterministic / Reproducible GUID (RFC 4122) from String
import hashlib
import uuid
seed = 'foo'
m = hashlib.md5()
m.update(seed.encode('utf-8'))
new_uuid = uuid.UUID(m.hexdigest())
print(new_uuid)
@tzvsi
tzvsi / index.html
Created June 13, 2020 03:28 — forked from tmcw/index.html
d3.keybinding
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font:12px/20px 'Helvetica';
}
textarea, input {
width:100%;
height:20px;
margin:0;
@tzvsi
tzvsi / README.md
Created June 13, 2020 03:28 — forked from biovisualize/README.md
direct svg to canvas to png conversion

It seems that Chrome finally found a way to let us convert from svg to canvas to png without the tainted canvas security feature/bug.

@tzvsi
tzvsi / .gitignore
Created June 13, 2020 03:27 — forked from susielu/.gitignore
d3-annotation: Responsive Types and Hover
.DS_Store
@tzvsi
tzvsi / angle-between-points.js
Created May 25, 2020 15:17 — forked from conorbuck/angle-between-points.js
JavaScript: Find the angle between two points
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};
@tzvsi
tzvsi / .block
Created April 17, 2020 02:09
Brush & Zoom
license: gpl-3.0
redirect: https://observablehq.com/@d3/focus-context
@tzvsi
tzvsi / banner-message.sh
Created March 12, 2020 16:39
Add a banner message to login screen on Ubuntu 18.04
sudo -i
xhost +SI:localuser:gdm
su gdm -s /bin/bash
gsettings set org.gnome.login-screen banner-message-enable true
gsettings set org.gnome.login-screen banner-message-text 'TYPE MESSAGE TEXT HERE'
# To restore the changes, you have to RE-DO previous 3 steps in terminal to get gdm user privilege, and finally run command:
gsettings reset org.gnome.login-screen banner-message-enable
@tzvsi
tzvsi / gist:222b3b22a847004a729744f89fe31255
Last active September 21, 2023 06:37
Installing CUDA 10.2, CuDNN 7.6.5, TensorRT 7.0, Ubuntu 18.04

Step 1: Installing CUDA (~5.5 minutes)

You can also install CUDA directly from the offline installer, but this is a little easier.

sudo apt update
sudo apt upgrade -y

mkdir install ; cd install
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
@tzvsi
tzvsi / install-onnx-tensorrt.sh
Last active October 23, 2020 14:43
Install TensorRT and ONNX-TensorRT for Ubuntu 18, CUDA 10.2
git clone --recursive https://github.com/onnx/onnx-tensorrt.git
cd onnx-tensorrt
mkdir build
cd build
cmake .. -DTENSORRT_ROOT=/usr/src/tensorrt
make -j`nproc`
sudo make install
@tzvsi
tzvsi / install-onnx-tensorrt.sh
Created January 3, 2020 03:00
Install TensorRT and ONNX-TensorRT for Ubuntu 18, CUDA 10.2
git clone --recursive https://github.com/onnx/onnx-tensorrt.git
cd onnx-tensorrt
mkdir build
cd build
cmake .. -DTENSORRT_ROOT=/usr/src/tensorrt
make -j`nproc`
sudo make install