Skip to content

Instantly share code, notes, and snippets.

View yspkm's full-sized avatar

Yosep Kim yspkm

  • A*STAR IME | NTU EEE
  • Singapore
View GitHub Profile
@yspkm
yspkm / how-to-install-pdflatex-ubuntu.md
Created October 1, 2023 03:16
How to install pdflatex (ubuntu 22.04)

PdfLatex is a tool that converts Latex sources into PDF. This is specifically very important for researchers, as they use it to publish their findings. It could be installed very easily using Linux terminal, though this seems an annoying task on Windows. Installation commands are given below.

  • Install the TexLive base
sudo apt-get install texlive-latex-base
  • Also install the recommended and extra fonts to avoid running into the error [1], when trying to use pdflatex on latex files with more fonts.

Saving Your USB from Rufus Defaults

Don't pay the cost like I did. Large ISOs (>4 GB) + wrong settings = an unreadable USB or a wasted stick.

TL;DR

  • UEFI system + 5.9 GB Ubuntu ISO $\Rightarrow$ Do NOT use default setup (FAT32, even though Rufus ISO includes many files each less than 4GB, I don't know why but it can break, probably regarding wrong logic, anyway, you shouldn't just throw it in with the default values without even reading it, just because you’re busy.).
  • Use Rufus $\to$ DD Image mode (safest). Windows may not "see" the USB afterward-that's normal for boot media.

@yspkm
yspkm / How to change qemu.conf.md
Created October 23, 2023 03:31
How to use QEMU GUI (virt-manager)

How to Configure Access for qcow2 in virt-manager

If you've created a qcow2 virtual disk, you might have noticed that it's not internally accessible even when you access it using sudo virt-manager. To fix this, we need to make a few changes to the /etc/libvirt/qemu.conf file.

1. Locate the Configuration File: The configuration file is found at /etc/libvirt/qemu.conf.

2. Modify the User and Group Settings: Find the lines that specify the user and group for QEMU processes. The default settings look like:

import re
def convert_latex(text):
# (1) 블록 수식: \[ ... \] → $$ ... $$
text = re.sub(r'\\\[(.*?)\\\]', r'$$\1$$', text, flags=re.DOTALL)
# (2) 인라인 수식: \( ... \) → $ ... $
#text = re.sub(r'\\\((.*?)\\\)', r'$\1$', text, flags=re.DOTALL)
text = re.sub(r'\\\(\s*(.*?)\s*\\\)', r'$\1$', text, flags=re.DOTALL)
return text
@yspkm
yspkm / init.sh
Created November 18, 2023 15:04
Docker사용 시 시작 스크립트
#!/bin/bash
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
@yspkm
yspkm / README.md
Created November 24, 2023 12:20
How to use Doxygen

How to Use Doxygen to Generate Documentation for C++ Code

Introduction

Doxygen is a documentation generator for various programming languages, including C++. This guide will show you how to use Doxygen to generate documentation for a C++ project in a structured and readable format.

Step 1: Install Doxygen

Ensure that Doxygen is installed on your system. You can download it from the official website.

Step 2: Create a Doxygen Configuration File

Navigate to your project's root directory in your command line interface and run the following command to create a default configuration file:

#!/bin/bash
python3 -m venv .venv
source .venv/bin/activate
pip3 install --upgrade pip wheel setuptools
pip3 install --index-url https://download.pytorch.org/whl/cu121 \
torch \
torchvision \
torchaudio
@yspkm
yspkm / README.md
Created December 2, 2023 07:56
Omnetpp

README for Omnetpp Installation

Overview

This README provides detailed instructions for installing Omnetpp and its prerequisites on a Linux system.

Prerequisites

  • Linux Operating System
  • Internet connection
  • Sufficient disk space
@yspkm
yspkm / NVIDIA Driver, CUDA, and cuDNN Installation Guide for Ubuntu22.04.md
Last active May 2, 2024 08:04
How to use CUDA in Ubuntu (with torch, cupy, cudnn.h + )

NVIDIA Setup Guide: Driver, CUDA, cuDNN & Data Libraries on Ubuntu 22.04

This guide will walk you through the process of setting up NVIDIA drivers, CUDA, cuDNN, and some popular data science libraries on Ubuntu 22.04.

Before You Begin

  • Ensure you have administrative privileges on your computer.
  • Make sure you are connected to the internet.

Installation Steps

@yspkm
yspkm / Dockerfile
Last active January 18, 2024 06:52
NAS 관련 문서
# Dockerfile
#FROM pytorch/pytorch:2.1.2-cuda11.8-cudnn8-runtime
FROM pytorch/pytorch:2.1.2-cuda12.1-cudnn8-runtime
# Remove any third-party apt sources to avoid issues with expiring keys.
RUN rm -f /etc/apt/sources.list.d/*.list
# Install some basic utilities & python prerequisites
RUN apt-get update -y && apt-get install -y --no-install-recommends\
wget \