Skip to content

Instantly share code, notes, and snippets.

@remlapmot
remlapmot / default.R
Last active February 20, 2022 19:22
Default R script template for RStudio. File location: %appdata%\rstudio\templates; on Mac/Linux: ~/.config/rstudio/templates
#' ---
#' title: "Title"
#' author: "My Name"
#' date: ""
#' output: html_document
#' ---
@remlapmot
remlapmot / rstudio-prefs.json
Last active April 13, 2020 09:36
RStudio v1.3 preferences file. File location on Windows: %appdata%\RStudio
{
"panes": {
"quadrants": [
"Source",
"Console",
"TabSet1",
"TabSet2"
],
"tabSet1": [
"Environment",
@remlapmot
remlapmot / libpng12-0-install.sh
Last active April 10, 2025 04:19
Instal libpng12-0 on Ubuntu 18.04
sudo wget http://se.archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb
sudo dpkg -i libpng12-0_1.2.54-1ubuntu1_amd64.deb
@remlapmot
remlapmot / install-choco.ps1
Last active March 30, 2020 16:17
Powershell script to install chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
@remlapmot
remlapmot / install-mate-desktop.sh
Last active March 27, 2025 12:59
Install MATE desktop on WSL 2
sudo apt update && sudo apt upgrade -y
sudo apt install ubuntu-mate-desktop --no-install-recommends -y
sudo apt-get install mate-desktop-environment-extras
sudo dpkg-reconfigure dbus && sudo service dbus restart
# install missing icons
sudo apt install ubuntu-mate-icon-themes
# install fira code font
sudo apt install fonts-firacode
REM Launch an X11 window
start /B ubuntu-nodec.xlaunch
REM Start pulseaudio
start "" /B "C:\bin\pulseaudio-1.1\bin\pulseaudio.exe"
REM For WSL 1
REM ubuntu1804.exe run "if [ -z \"$(pidof mate-session)\" ]; then export DISPLAY=127.0.0.1:0.0; export PULSE_SERVER=tcp:127.0.0.1; mate-session; pkill '(gpg|ssh)-agent'; taskkill.exe /IM pulseaudio.exe /F; taskkill.exe /IM vcxsrv.exe; fi;"
REM For WSL 2
@remlapmot
remlapmot / local.conf
Created April 12, 2020 09:05
Allow WSL to use fonts installed on Windows. File location: /etc/fonts
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>/mnt/c/Windows/Fonts</dir>
</fontconfig>
@remlapmot
remlapmot / .Rprofile
Last active October 11, 2023 19:37
Personal R settings file.
# rstan::rstan_options(auto_write = TRUE)
if (Sys.info()["sysname"] == "Windows"){
# For improved execution time, we recommend calling
Sys.setenv(LOCAL_CPPFLAGS = '-march=corei7 -mtune=corei7')
}
# don't ask to save workspace on quit; `q()`
# utils::assignInNamespace(
# "q",
# function(save = "no", status = 0, runLast = TRUE)
@remlapmot
remlapmot / fix-tag-error.bat
Created April 17, 2020 19:11
Fix "tag present in the reparse point buffer is invalid" OneDrive Error
chkdsk /r /f
@remlapmot
remlapmot / .Renviron
Last active April 9, 2025 06:46
.Renviron file which sets environment variables in an R session
# GITHUB_PAT=# use gitcreds instead
# delete .tar.gz after checking package
R_KEEP_PKG_SOURCE=no
# first download JAVA JDK
JAVA_HOME="C:/Program Files/Java/jdk-16.0.1"
# first download and install JAGS
JAGS_HOME="C:/Program Files/JAGS/JAGS-4.3.0"