Skip to content

Instantly share code, notes, and snippets.

View baobuiquang's full-sized avatar
👋
Hi there!

Bao Bui-Quang baobuiquang

👋
Hi there!
View GitHub Profile
git clone https://github.com/OneLevelStudio/FORGE
cd FORGE
python3 -m venv venv
source venv/bin/activate
pip install -U pip
pip install torch==2.3.1 torchvision==0.18.1 --extra-index-url https://download.pytorch.org/whl/cu121
pip install -r requirements_versions.txt
wget -P models/Stable-diffusion https://huggingface.co/onelevelstudio/diffusion/resolve/main/573152/LVSTIFY_V5.0.safetensors
wget -P models/Lora https://huggingface.co/onelevelstudio/diffusion/resolve/main/375993/LORA_GHOST.safetensors
List IMG docker images
List CON docker ps -a
Build IMG docker-compose build
Run CON detached docker-compose up -d
Build IMG + Run CON detached docker-compose up -d --build
Stop CON + Remove CON docker-compose down
Remove everything unused docker system prune -a --volumes -f
Remove everything 1. docker stop $(docker ps -a -q)

Install Python3.10 on Ubuntu24.04

Install Python3.10

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install -y python3.10

Set default

@baobuiquang
baobuiquang / Zrok
Created August 29, 2024 08:01
Zrok
zrok reserve public 1234 --unique-name baobuiquang
zrok share reserved baobuiquang public
@baobuiquang
baobuiquang / Linux
Created August 29, 2024 08:00
Linux
ssh -L 1234:localhost:1234 [email protected]
jupyter lab --no-browser --port=1234
@baobuiquang
baobuiquang / fastapi.py
Last active April 15, 2025 07:17
FastAPI
# Boilerplate: https://github.com/baobuiquang/fastapi
from fastapi.middleware.cors import CORSMiddleware
from fastapi.staticfiles import StaticFiles
from fastapi import FastAPI
import uvicorn
import _config
# For images processing
from fastapi import File, UploadFile
@baobuiquang
baobuiquang / cmd_quickcodes.bat
Last active August 29, 2024 02:17
CMD Quickcodes
# Python
call py --version
# Virtual Environment
call py -m venv venv
call venv\Scripts\activate
call py -m pip install -U pip
call py run.py
# Install dependencies
@baobuiquang
baobuiquang / python_quickcodes.py
Created August 29, 2024 01:26
Python Quickcodes
# Create folder
import os
os.makedirs("my/path", exist_ok=True)
# Read and write CSV
import pandas as pd
df = pd.read_csv('input_data.csv', encoding='utf-8')
df.to_csv('output_data.csv', encoding='utf-8', index=False)