Skip to content

Instantly share code, notes, and snippets.

View vietanhdev's full-sized avatar
🎯
Work Hard. Build More. Share Your Story.

Viet-Anh NGUYEN (Andrew) vietanhdev

🎯
Work Hard. Build More. Share Your Story.
View GitHub Profile
@vietanhdev
vietanhdev / install_ubuntu_packages.sh
Created April 20, 2025 00:08
Install and config packages on Ubuntu 24.04
#!/bin/sh
# Update the system
sudo apt update && sudo apt full-upgrade
# Basic packages
sudo apt install -y p7zip-full unrar gparted wget build-essential curl git
# Java
sudo apt install -y default-jre
@vietanhdev
vietanhdev / install_cursor.sh
Created April 20, 2025 00:03
Install Cursor for Ubuntu 24.04
#!/bin/zsh
#
# Cursor AI IDE Installer/Updater
# This script installs or updates Cursor AI IDE on Linux systems
#
# -----------------------------------------------------------------------------
# Configuration
# -----------------------------------------------------------------------------
APPIMAGE_PATH="/opt/cursor/cursor.AppImage"
@vietanhdev
vietanhdev / gist:c641ec7c4acc8fd9d5f0f3a02a850189
Created March 2, 2025 14:13
Error logs when installing llama-cpp-python 3.7 on Macbook Air M1
pip install llama-cpp-python
Collecting llama-cpp-python
Using cached llama_cpp_python-0.3.7.tar.gz (66.7 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: typing-extensions>=4.5.0 in /opt/homebrew/Caskroom/miniforge/base/envs/llama-cpp/lib/python3.11/site-packages (from llama-cpp-python) (4.12.2)
Requirement already satisfied: numpy>=1.20.0 in /opt/homebrew/Caskroom/miniforge/base/envs/llama-cpp/lib/python3.11/site-packages (from llama-cpp-python) (1.26.4)
Requirement already satisfied: diskcache>=5.6.1 in /opt/homebrew/Caskroom/miniforge/base/envs/llama-cpp/lib/python3.11/site-packages (from llama-cpp-python) (5.6.3)
Requirement already satisfied: jinja2>=2.11.3 in /opt/homebrew/Caskroom/miniforge/base/envs/llama-cpp/lib/python3.11/site-packages (from llama-cpp-python) (3.1.5)
@vietanhdev
vietanhdev / install_cursor_ubuntu.sh
Created January 5, 2025 03:22
Install Cursor - Ubuntu 20.04, 22.04, 24.04 - x86_64
#!/bin/bash
set -euo pipefail
# Directory setup
APP_DIR="${HOME}/Applications"
ICON_DIR="${HOME}/.local/share/icons"
DESKTOP_DIR="${HOME}/.local/share/applications"
BIN_DIR="${HOME}/.local/bin"
@vietanhdev
vietanhdev / ch.mj
Created November 23, 2023 02:14
ch.mj
import time
from python import Python
@register_passable("trivial")
struct Move:
var i: Int
var j: Int
var prom: Int
fn __init__(i: Int, j: Int, prom: Int) -> Move:
@vietanhdev
vietanhdev / create_users.py
Created March 29, 2023 04:04
Create ubuntu users with python
import os
users = """
john
dummy
vietanhdev
"""
for user in users.split("\n"):
user = user.strip()
if user:
@vietanhdev
vietanhdev / index.html
Created September 18, 2022 05:06
MediaPipe - Pose
<body>
<style>
.square-box {
width: 33%;
height: 0;
padding-top: 33%;
position: absolute;
right: 20px;
top: 20px;
}
@vietanhdev
vietanhdev / install_opencv.sh
Created September 17, 2021 00:56
Install OpenCV on Ubuntu 18.04
######################################
# INSTALL OPENCV ON UBUNTU OR DEBIAN #
######################################
# -------------------------------------------------------------------- |
# SCRIPT OPTIONS |
# ---------------------------------------------------------------------|
OPENCV_VERSION='4.5.1' # Version to be installed
OPENCV_CONTRIB='YES' # Install OpenCV's extra modules (YES/NO)
# -------------------------------------------------------------------- |
@vietanhdev
vietanhdev / install_realvnc_server.sh
Last active December 4, 2023 15:57
Install RealVNC Ubuntu - Raspberry Pi 4
#!/bin/bash
mkdir realvncserversetup && cd realvncserversetup
echo Add armhf arch
sudo dpkg --add-architecture armhf && sudo apt update
echo Download and install RealVNC server
wget -nv https://downloads.realvnc.com/download/file/vnc.files/VNC-Server-6.11.0-Linux-ARM.deb && sudo apt install ./VNC-Server-6.11.0-Linux-ARM.deb
echo Download and install dependencies
@vietanhdev
vietanhdev / main.cpp
Last active September 30, 2024 10:21
C++ OpenCV Image classification from ONNX model
#include <chrono>
#include <cmath>
#include <exception>
#include <fstream>
#include <iostream>
#include <limits>
#include <numeric>
#include <opencv2/dnn/dnn.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>