Skip to content

Instantly share code, notes, and snippets.

View vinesmsuic's full-sized avatar
💸
Fly, My Wings

Max Ku vinesmsuic

💸
Fly, My Wings
View GitHub Profile
@vinesmsuic
vinesmsuic / script.sh
Created November 14, 2023 00:21
Only keep multiple folders with same file name. Align is the reference folder.
#!/bin/bash
# Define the path to your root folder
rootFolder="."
# Define the path to your input folder (folderA)
folderA="$rootFolder/align"
# Function to delete excess files and print file count
delete_excess_files () {
@vinesmsuic
vinesmsuic / script.sh
Created November 10, 2022 04:44
Batch convert HEIC to jpg on MacOS
for file in *.HEIC; do
echo "${file%.*}"
convert $file -resize "1920>" -quality 75 "${file%.*}.png"
done
@vinesmsuic
vinesmsuic / readme.md
Last active October 31, 2022 06:51
Check nvidia-smi every 0.5 second
watch -n 0.5 nvidia-smi
# alternatively
nvidia-smi -l 0.5
@vinesmsuic
vinesmsuic / readme.md
Last active April 6, 2022 09:35
download big files on Google Drive

Replace FILEID and FILENAME with id and filename (there are 2 FILEID and 1 FILENAME to replace)

wget – load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget – quiet – save-cookies /tmp/cookies.txt – keep-session-cookies – no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt

Problem

A lot of GitHub projects need to have pretty math formulas in READMEs, wikis or other markdown pages. The desired approach would be to just write inline LaTeX-style formulas like this:

$e^{i \pi} = -1$

Unfortunately, GitHub does not support inline formulas. The issue is tracked here.

Investigation

@vinesmsuic
vinesmsuic / note.sh
Created July 2, 2020 11:42
Python Install package
$ python -m pip install [package]
@vinesmsuic
vinesmsuic / InstallQT.md
Last active June 25, 2026 00:56
install QT on linux

Main Steps

sudo apt-get install build-essential

sudo apt-get install qtcreator

sudo apt-get install qt5-default

Note: The version you installed is 5.9.5.

@vinesmsuic
vinesmsuic / readme.md
Created February 12, 2020 05:58
Find my ~/.bashrc

For MacOS

$ cd /etc/; sudo nano bashrc

For Linux

$ gedit ~/.bashrc
@vinesmsuic
vinesmsuic / fix.sh
Created January 30, 2020 05:46
Solving: brew install opencv takes forever
# 1. Homebrew Permissions Denied Issues Solution (https://gist.github.com/irazasyed/7732946)
$sudo chown -R $(whoami) $(brew --prefix)/*
# 2. Upgrade brew
$brew upgrade
# 3. https://stackoverflow.com/questions/30998890/installing-opencv-with-brew-never-finishes/31015713
$brew install gcc --force-bottle
# 4. Install OpenCV
$brew install opencv
@vinesmsuic
vinesmsuic / fix.sh
Last active October 26, 2019 15:28
[Fix] System Program Problem Detected In Ubuntu
# The crash reports are stored in /var/crash directory in Ubuntu.
# If you look in to this directory, you should see some files ending with crash.
$ ls -l /var/crash/
# delete all the content of directory /var/crash.
$ sudo rm /var/crash/*