Skip to content

Instantly share code, notes, and snippets.

View wooihaw's full-sized avatar

Tan Wooi Haw wooihaw

View GitHub Profile
@wooihaw
wooihaw / vim_shortcuts.md
Created September 13, 2025 08:07
Vim Keyboard Shortcuts
@wooihaw
wooihaw / linux_commands_summary.md
Created September 13, 2025 08:02
A to Z Linux commands

A to Z Linux commands — Summary

Command Description
alias Create an alias for a shell command (shortcut).
awk Pattern scanning and processing language; search and process text.
basename Strip directory and suffix from filenames.
cal Display a calendar.
cat Concatenate and display file content.
chgrp Change group ownership of a file or directory.
@wooihaw
wooihaw / Anydesk.txt
Last active September 12, 2025 03:26
Anydesk
sudo journalctl -u anydesk.service -n 200 --no-pager -o cat | sed -n '1,200p'
# quick scan for license/commercial hints
sudo journalctl -u anydesk.service --no-pager | grep -i -E 'license|commercial|trial|offline|error|tls|certificate' || true
# raw network
ping -c 4 8.8.8.8
# DNS resolution of AnyDesk status host
dig +short status.anydesk.com || nslookup status.anydesk.com
@wooihaw
wooihaw / Lenovo_thinkstation_p2_dualboot.md
Created August 23, 2025 06:32
Guideline to Dual-boot Lenovo ThinkStation P2

Guideline: Dual-boot Lenovo ThinkStation P2 (Windows + Ubuntu)

This document describes steps to configure a Lenovo ThinkStation P2 pre-installed with Windows for dual-booting with Ubuntu.
Follow the steps carefully. Back up important data before proceeding.

Prerequisites

  • A full backup of important files.
  • A USB flash drive (≥ 8 GB).
  • Ubuntu ISO image (matching your preferred Ubuntu release).
  • Rufus utility for creating bootable USB on Windows.
@wooihaw
wooihaw / docker_commands_summary.md
Created August 23, 2025 06:02
Summary of common docker commands

Docker Commands — Summary Table

This document lists common Docker commands.
Each entry includes a short description and an example.

Command Description Example
docker --version Show Docker client version. docker --version
docker info Show system-wide Docker information. docker info
docker login Log in to a container registry. docker login ghcr.io
@wooihaw
wooihaw / comprehensive_git_commands.md
Created August 23, 2025 02:38
Comprehensive Git Commands

Git Commands Cheat Sheet

📌 git config --global user.name "Your Name"
Sets your name for commits globally, so it applies to all repositories.

📌 git config --global user.email "you@example.com"
Sets your email for commits globally.

📌 git config --list
Lists all the Git configuration settings.

@wooihaw
wooihaw / setup_wsl2.md
Created August 4, 2025 08:20
Setup WSL2 on Windows 11

Setup WSL2

Below is a step-by-step procedure to install WSL 2 and Ubuntu 24.04 on a Windows 10/11 machine.

  1. Verify Windows Version and Virtualization

    • Confirm that your Windows build is at least 19044 (Windows 10, version 21H2) or later.

    • Ensure that CPU virtualization (Intel VT-x or AMD-V) is enabled in BIOS/UEFI.

@wooihaw
wooihaw / install_tf_cuda.md
Created August 4, 2025 04:42
Guideline to Install Tensorflow with Cuda on Ubuntu 24.04

Install TensorFlow with CUDA on Ubuntu 24.04

This document provides a step-by-step guide to setting up a Python virtual environment and installing TensorFlow v2.18.1 with GPU support on a machine running Ubuntu 24.04 with a compatible NVIDIA GPU.

Using a virtual environment is highly recommended to isolate your project's dependencies and avoid conflicts with other Python projects on your system.

Prerequisites

To use TensorFlow with CUDA, you must have a compatible NVIDIA GPU and the correct software installed.

@wooihaw
wooihaw / setup_unsloth_gpu_wsl2.md
Created August 1, 2025 04:42
Setup unsloth with GPU support in WSL2

This guide will walk you through the process of setting up Unsloth with NVIDIA GPU support within your Windows Subsystem for Linux 2 (WSL2) environment, specifically using an Ubuntu distribution. This setup is crucial for efficiently fine-tuning and running large language models locally.

1. Install NVIDIA GPU Driver on Windows

Before you begin in WSL2, ensure your Windows host machine has the latest NVIDIA GPU drivers installed. WSL2 relies on these drivers for GPU passthrough.

  • Action: Download and install the latest drivers for your NVIDIA GPU from the official NVIDIA website: https://www.nvidia.com/drivers
  • Verification: After installation, it's a good idea to restart your Windows machine.

2. Install and Set Up WSL2 (Ubuntu)

@wooihaw
wooihaw / unsloth_manual_gguf.md
Created August 1, 2025 04:39
Manually save gguf file after fine-tuning with unsloth

First save your model to 16bit via:

model.save_pretrained_merged("merged_model", tokenizer, save_method = "merged_16bit",)

Compile llama.cpp from source like below:

apt-get update
apt-get install pciutils build-essential cmake curl libcurl4-openssl-dev -y
git clone https://github.com/ggerganov/llama.cpp