Skip to content

Instantly share code, notes, and snippets.

@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 / 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:

@yspkm
yspkm / init.vim
Last active October 24, 2023 17:38
wget https://golang.org/dl/go1.21.3.linux-amd64.tar.gz
sudo tar -xvf go1.21.3.linux-amd64.tar.gz
sudo mv go ~/
# .profile
export GOROOT=$HOME/go
export GOPATH=$HOME/workplace/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
# ~/.cofing/nvim/autoload
@yspkm
yspkm / bitFilter.c
Last active October 21, 2023 09:09
Bit Filter Tricks
// 32bit 기준
int bitFilter(int x, int highbit, int lowbit) {
int mask;
mask = 1 << highbit;
mask = mask | (mask >> 1);
mask = mask | (mask >> 2);
mask = mask | (mask >> 4);
mask = mask | (mask >> 8);
mask = mask | (mask >> 16);
@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.
@yspkm
yspkm / init.sh
Last active October 30, 2023 14:31
New way to install node
# Installation Instructions Node.js
# If you're root, you could just ommit the sudo
#!/bin/bash
# Download and import the Nodesource GPG key
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
#Create deb repository
NODE_MAJOR=20
@yspkm
yspkm / dind_k3s_rancher.yaml
Last active August 15, 2023 08:46
doker in docker
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: '3'
generation: 3
labels:
workload.user.cattle.io/workloadselector: apps.deployment-default-docker
managedFields:
- apiVersion: apps/v1
@yspkm
yspkm / url
Created August 5, 2023 02:12
Spark to Kafka
https://velog.io/@statco19/pyspark-kafka-streaming
@yspkm
yspkm / init.sh
Last active August 4, 2023 09:49
cassandra-spark
pyspark --packages com.datastax.spark:spark-cassandra-connector_2.12:3.4.0 --conf spark.cassandra.connection.host=ip주소
spark-submit --packages com.datastax.spark:spark-cassandra-connector_2.12:3.4.0 /abs/path/test.py
@yspkm
yspkm / init.md
Last active July 25, 2023 00:26
vscode 맥에서 설정
  1. code 명령어 생성

command + shift + p 누르고 shell 입력한 뒤에 code 명령어 생성

  1. 플러그인과 실행시 방향키 꾹 누르면 연속입력

defaults write -g ApplePressAndHoldEnabled -bool false