Skip to content

Instantly share code, notes, and snippets.

mount /dev/nvme0n1p2 /mnt
mount /dev/nvme0n1p1 /mnt/boot
mount --types proc /proc /mnt/proc
mount --rbind /sys /mnt/sys
mount --make-rslave /mnt/sys
mount --rbind /dev /mnt/dev
mount --make-rslave /mnt/dev
mount --bind /run /mnt/run
mount --make-slave /mnt/run
`cryptsetup open /dev/xxx linuxroot`
`sudo mount -o ssd,noatime,space_cache=v2,autodefrag,compress=zstd:3,nodiscard,nodev,nosuid,subvol=@home /dev/mapper/linuxroot /mnt/install/home
`sudo mount -o ssd,noatime,space_cache=v2,autodefrag,compress=no,nodiscard,subvol=@snapshots /dev/mapper/linuxroot /mnt/install/.snapshots
`sudo mount -o ssd,noatime,space_cache=v2,autodefrag,compress=zstd:3,nodiscard,subvol=@srv /dev/mapper/linuxroot /mnt/install/srv`
`sudo mount -o ssd,noatime,space_cache=v2,autodefrag,compress=zstd:3,nodiscard,nodatacow,noexec,subvol=@var_log /dev/mapper/linuxroot /mnt/install/var/log`
`sudo mount -o ssd,noatime,space_cache=v2,autodefrag,compress=zstd:3,nodiscard,nodatacow,nodev,nosuid,noexec,subvol=@var_cache /dev/mapper/linuxroot /mnt/install/var/cache`
`sudo mount -o ssd,noatime,space_cache=v2,autodefrag,compress=no,nodiscard,nodatacow,nodev,nosuid,noexec,subvol=@var_lib_docker /dev/mapper/linuxroot /mnt/install/var/lib/docker`
`sudo mount -o ssd,noatime,space_cache=v2,autodefrag,co
For system maintenance:
List unmerged .pacnew files after every update:
[Trigger]
Operation = Upgrade
#!/bin/bash
##########
# contents
##########
# contents
# notes
# script setup
# git config files
@robotzero
robotzero / btrfs.sh
Created October 17, 2018 20:31
btrfs snapshot
#!/bin/bash
# This script is designed to create a snapshot of the Root BTRFS Subvolume.
# I run it on every boot to ensure the system can be reverted due to System updates or other problems.
#
# 1. Create the /System/Snapshot directory (Or use your own schema).
# This is where we will mount the BTRFS Volume
#
# mkdir -p /System/Snapshot
#
syu: aliased to curl -s https://www.archlinux.org/feeds/news/ | xmllint --xpath //item/title\ \|\ //item/pubDate /dev/stdin | sed -r -e "s:<title>([^<]*?)</title><pubDate>([^<]*?)</pubDate>:\2\t\1\n:g" && yay -Syu

gdisk /dev/sda

sda1 = /boot, sda2 = SWAP, sda3 = encrypted root

for the SWAP partition below, try and make it a bit bigger than your RAM, for hybernating

o ,

n , [enter] , [enter], +512M , EF00 ,

n , [enter] , [enter], +8G, 8200,

n , [enter] , [enter], [enter] , [enter] ,

w

@robotzero
robotzero / streamsCookbook.java
Created February 21, 2017 20:29
Java 8 Streams Cookbook
import java.time.Duration;
import java.util.*;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.*;
public class Winner {
FROM debian:jessie
RUN apt-get update
RUN apt-get install -y curl \
mcrypt \
&& apt-get install -y php5 \
php5-fpm \
php5-cli \
php-pear \
php5-common \
php5-igbinary \
var checkbox = document.getElementById("checkbox");
var pwd = document.getElementById('password');
var setPasswordField = function (element) {
if (element.checked == true) {
if (pwd.getAttribute("type") == "password") {
pwd.setAttribute("type", "text");
}
} else {
pwd.setAttribute("type", "password");
}