Skip to content

Instantly share code, notes, and snippets.

View ngocson2vn's full-sized avatar

Son Nguyen ngocson2vn

View GitHub Profile
@ngocson2vn
ngocson2vn / upgrade-nvidia-driver.md
Created November 2, 2024 11:03
How to upgrade NVIDIA driver for H100 GPUs

Uninstall current nvidia driver completely

# Step 1: Run uninstaller
sudo /usr/bin/nvidia-uninstall

# Step 2: Stop fabric manager (H100)
sudo systemctl stop nvidia-fabricmanager.service

# Step 3: Remove kernel modules
sudo lsmod | grep -E 'Module|nvidia'
@ngocson2vn
ngocson2vn / HOWTO.md
Created November 19, 2021 09:58 — forked from ivanvermeyen/HOWTO.md
Multiple MySQL versions on MacOS with Homebrew

Update - 4 september 2020

Making multiple MySQL versions work with Homebrew was tricky to say the least. Fortunately there are 2 new easy ways that I learned of to achieve this.

DBngin app

As @4unkur and @henrytirla commented below, there is this extremely easy to use app called DBngin, which lets you setup multiple databases (not only MySQL) simultaneously using different ports:

https://dbngin.com/

@ngocson2vn
ngocson2vn / overriding old tag
Created November 10, 2021 09:03 — forked from Bat-Chat/overriding old tag
overriding old tag (move tag to latest commit)
Use the -f option to git tag:
-f
--force
Replace an existing tag with the given name (instead of failing)
You probably want to use -f in conjunction with -a to force-create an annotated tag instead of a non-annotated one.
Example
@ngocson2vn
ngocson2vn / private-github-release-download.sh
Created October 25, 2021 01:16 — forked from illepic/private-github-release-download.sh
Download the latest release binary from a private GitHub repo. (i.e. a .tar.gz that you have manually uploaded in a GitHub release). Update OAUTH_TOKEN, OWNER, REPO, FILE_NAME with your custom values.
#!/usr/bin/env bash
# Authorize to GitHub to get the latest release tar.gz
# Requires: oauth token, https://help.github.com/articles/creating-an-access-token-for-command-line-use/
# Requires: jq package to parse json
# Your oauth token goes here, see link above
OAUTH_TOKEN="34k234lk234lk2j3lk4j2l3k4j2kj3lk"
# Repo owner (user id)
OWNER="your-user-name"
@ngocson2vn
ngocson2vn / terraform-aws-sso.md
Last active October 4, 2021 03:19
Using terraform with AWS SSO
@ngocson2vn
ngocson2vn / generate-topology.py
Created July 27, 2021 08:04
A small script to generate TiDB cluster topology file
import sys
import subprocess
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--cluster', '-c', required=True, help="The TiDB cluster name")
args = parser.parse_args()
cluster = args.cluster
print(f"Cluster: {cluster}")
#!/usr/bin/env python3
#!coding:utf-8
import argparse
import subprocess
import json
import os, sys, stat
import requests
def parse_args():
@ngocson2vn
ngocson2vn / paramiko_proxycommand_sample.py
Created April 14, 2021 10:07 — forked from tell-k/paramiko_proxycommand_sample.py
paramikoのProxyCommandのサンプル
#!/usr/bin/env python
#-*- coding:utf8 -*-
# paramiko の ProxyCommandの Sample
# -------------------------------------------------
#
# ~/.ssh/config
#
# Host proxy-server
# User hoge
@ngocson2vn
ngocson2vn / convert-SHIFT_JIS-to-UTF-8.sh
Last active April 13, 2020 01:51
Convert a CSV file from Japanese character encoding to UTF-8
iconv -f SHIFT_JISX0213 -t UTF-8 < data.csv > data.UTF-8.csv
@ngocson2vn
ngocson2vn / test_model.py
Created February 27, 2020 09:37
Convolutional Neural Network
import mnist
import numpy as np
import argparse
from cnn import CNN
import matplotlib.pyplot as plt
from termcolor import colored
import pickle
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--index", help="The index of a test image.", type=int, required=True)