Skip to content

Instantly share code, notes, and snippets.

@yevshev
yevshev / config
Last active October 16, 2024 16:50
macbook air
input type:touchpad {
dwt enabled
tap enabled
natural_scroll disabled
}
input type:keyboard {
xkb_options caps:escape
}
@yevshev
yevshev / rocm.sh
Last active May 23, 2021 00:25
ROCm OpenCL Fedora
echo '[ROCm]
name=ROCm
baseurl=https://repo.radeon.com/rocm/yum/rpm
enabled=1
gpgcheck=1
gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key' > /etc/yum.repos.d/rocm.repo
sudo dnf in rocm-opencl rocm-opencl-devel hsakmt-roct ocl-icd-devel
echo /opt/rocm-4.2.0/opencl/lib/libamdocl64.so > /etc/OpenCL/vendors/amdocl64_40200.icd
sudo chroot /mnt/sysroot /bin/bash --login
# set partition codes
sgdisk -t 1:ef00 /dev/vda
sgdisk -t 2:8304 /dev/vda
partprobe
# remove GRUB and exclude it from being reinstalled
rpm -v --nodeps --erase $(rpm -qa | grep "^grub2-\|^os-prober-\|^grubby-")
echo "exclude=grub2-*,os-prober,grubby" >> /etc/dnf/dnf.conf
@yevshev
yevshev / stats.sh
Last active March 7, 2020 19:26
docker stats to csv
while true; do docker stats --no-stream --format "{{.CPUPerc}},{{.MemUsage}},{{.NetIO}}" container_name | tee --append stats.json; sleep 3; done
@yevshev
yevshev / arch.sh
Last active July 8, 2020 14:23
arch
# Update system clock
timedatectl set-ntp true
timedatectl set-timezone America/Chicago
# Partition
printf "n\n1\n4096\n+512M\nef00\nw\ny\n" | gdisk /dev/nvme0n1
printf "n\n2\n\n\n8300\nw\ny\n" | gdisk /dev/nvme0n1
# format
yes | mkfs.fat -F32 /dev/nvme0n1p1
@yevshev
yevshev / tmp
Created December 2, 2019 19:38
cp /usr/share/systemd/tmp.mount /etc/systemd/system/
systemctl enable tmp.mount
@yevshev
yevshev / nvidia.sh
Last active November 28, 2019 20:02
nvkey=http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
nvlist=/etc/apt/sources.list.d/nvidia.list
cudapath=/usr/local/cuda
apt-key adv --fetch-keys $nvkey
echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > $nvlist
echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" >> $nvlist
apt update
apt install nvidia-driver-440 cuda-10-0 libcudnn7 libcudnn7-dev libnvinfer5 libnvinfer5-dev -y
alias up='for ARG in update upgrade autoremove; do sudo apt ${ARG}; done'