Skip to content

Instantly share code, notes, and snippets.

View alazarolop's full-sized avatar

Alberto Lázaro-López alazarolop

View GitHub Profile
@alazarolop
alazarolop / dual-boot-windows-and-ubuntu-with-luks-tpm2-encryption.md
Created August 18, 2024 11:51 — forked from kirbah/dual-boot-windows-and-ubuntu-with-luks-tpm2-encryption.md
Dual booting Windows 11 and Ubuntu 22.04 LTS with LUKS and TPM2 encryption

Dual booting Windows 11 and Ubuntu 22.04 LTS with LUKS and TPM2 encryption

Make sure to think about data backup before you proceed with the below guide.

Tested on HP Elitebook 840 G6 in April 2024.

Bootable USB disk preparation

There are various options for creating a bootable USB drive.

@alazarolop
alazarolop / R Makevars
Created August 25, 2023 09:40 — forked from mratsim/R Makevars
~/.R/Makevars to compile R package with OpenMP and all compiler optimizations
# ~/.R/Makevars
PKG_LIBS = -fopenmp -lgomp
PKG_CFLAGS=-O3 -pipe -fstack-protector-strong -fopenmp -march=native
#-- Compiler and Linker Flags
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CPPFLAGS=-D_FORTIFY_SOURCE=2
CFLAGS=-O3 -pipe -fstack-protector-strong -fopenmp -march=native
CXXFLAGS=-O3 -pipe -fstack-protector-strong -fopenmp -march=native
@alazarolop
alazarolop / install-ubuntu-luks-lvm.md
Created August 17, 2023 11:18 — forked from superjamie/install-ubuntu-luks-lvm.md
How to install Ubuntu with LUKS Encryption on LVM

How to install Ubuntu with LUKS Encryption on LVM

My work requires us to have full-disk encryption, so these are the steps I use.

The basic idea is to create a LUKS-encrypted partition which is used as an LVM Physical Volume.

The GRUB boot partition isn't encrypted, but everything else is.

These steps tested and working on 22.04 (jammy) and 20.04 (focal).

@alazarolop
alazarolop / WSL2GUIXvnc-en.md
Created August 16, 2023 11:29 — forked from tdcosta100/WSL2GUIXvnc-en.md
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key component we need to install is tigervnc-standalone-server.

For this setup, I will use Ubuntu 20.04 LTS (Focal Fossa, unfortunately 22.04 does not work), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the Sample screenshots section for examples.

So let's go. First, we need a working WSL2 installation.

@alazarolop
alazarolop / .Renviron
Last active January 25, 2021 23:28 — forked from btskinner/.Renviron
Makevars and Renviron to use with Homebrew + OpenBLAS + OpenMP
# ---------
# .Renviron
# ---------
PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig
bigcorPar <- function(x, nblocks = 10, verbose = TRUE, ncore="all", ...){
library(ff, quietly = TRUE)
require(doMC)
if(ncore=="all"){
ncore = multicore:::detectCores()
registerDoMC(cores = ncore)
} else{
registerDoMC(cores = ncore)
}
@alazarolop
alazarolop / wget
Last active March 18, 2019 13:58 — forked from crittermike/wget.sh
wget: to download an entire website along with assets.
wget \
--recursive \ # Download the whole site.
#--no-clobber \ # Don't overwrite existing files.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--html-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
--domains yoursite.com \ # Do not follow links outside this domain.
--no-parent \ # Don't follow links outside the directory you pass in.
yoursite.com/whatever/path # The URL to download