Skip to content

Instantly share code, notes, and snippets.

@herbhuang
herbhuang / pve.shell
Last active January 24, 2023 03:25
setup-PVE-mount
chown -R 1005:1005 /mnt/pve/dat/Download/
# uid map: from uid 0 map 1005 uids (in the ct) to the range starting 100000 (on the host), so 0..1004 (ct) → 100000..101004 (host)
lxc.idmap = u 0 100000 1005
lxc.idmap = g 0 100000 1005
# we map 1 uid starting from uid 1005 onto 1005, so 1005 → 1005
lxc.idmap = u 1005 1005 1
lxc.idmap = g 1005 1005 1
# we map the rest of 65535 from 1006 upto 101006, so 1006..65535 → 101006..165535
lxc.idmap = u 1006 101006 64530
lxc.idmap = g 1006 101006 64530
@herbhuang
herbhuang / fix-landscape-error.sh
Created August 23, 2022 22:32
Fix landscape-sysinfo error on WSL
# ref: https://askubuntu.com/questions/1414483/landscape-sysinfo-cache-permission-denied-when-i-start-ubuntu-22-04-in-wsl
sudo apt remove landscape-common
sudo apt autoremove # Optionally, but recommended
rm ~/.motd_shown
@herbhuang
herbhuang / set-up-R-on-WSL.md
Last active November 11, 2022 05:19
Set Up R environment (R core, RStudio, BLAS, LAPACK) on Ubuntu via WSL

install R, RStudio server, and BLAS/LAPACK libraries on Ubuntu with Windows Subsytem for Linux

I think it is a neat way.

Scripts could be different based on your environment 😮

# My PC Environment
Processor:                  AMD Ryzen 5 5600H with Radeon Graphics
Powershell Version: 7.2.5
@herbhuang
herbhuang / restore_packages.R
Created August 2, 2022 22:39 — forked from arne-cl/restore_packages.R
save/load/install a list of your currently installed R packages
# restore_packages.R
#
# installs each package from the stored list of packages
# source: http://hlplab.wordpress.com/2012/06/01/transferring-installed-packages-between-different-installations-of-r/
load("~/installed_packages.rda")
for (count in 1:length(installedpackages)) {
install.packages(installedpackages[count])
}