start new:
tmux
start new with session name:
tmux new -s myname
# Generic Makefile for compiling an executable, with pkg-config dependencies. | |
CC := clang | |
PKGS := gtk+-3.0 | |
SRCDIR := src | |
BUILDDIR := build | |
CFLAGS := -g -Wall `pkg-config --cflags $(PKGS)` | |
LIBS := `pkg-config --libs $(PKGS)` | |
TARGET := app |
# Install ARCH Linux with encrypted file-system and UEFI | |
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
# Download the archiso image from https://www.archlinux.org/ | |
# Copy to a usb-drive | |
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux | |
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration. | |
# Set swedish keymap |
function transfer | |
if test (count $argv) -eq 0 | |
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md" | |
return 1 | |
end | |
## get temporarily filename, output is written to this file show progress can be showed | |
set tmpfile ( mktemp -t transferXXX ) | |
## upload stdin or file |
import { v4 as uuid } from 'uuid'; | |
export function generateId() { | |
return uuid(); | |
} | |
const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i); | |
console.log(generateId().match(v4)); | |
//console.log(generateId().length) |
using System; | |
namespace PiDay | |
{ | |
// The probability of two random numbers to be coprime is P = 6 / Pi^2 | |
// So let's generate a bunch of random numbers. Figure out how often they're coprime. | |
// Use that percentage as our probabilty and solve for Pi. | |
// Pi = sqrt(6 / P) | |
// For more info, watch the video where I stole the idea: https://youtu.be/RZBhSi_PwHU |
This guide uses the domain your-domain.tld
and its www.
prefixed version.
It starts the rocket application on 127.0.0.1:1337
and as the user www-data
. The proxy listens on port 80 and 443 though.
If you need other values, update them accordingly in your nginx and systemd configs.
For KVM and Laptop
I want full control what boots the computer to avoid the so called evil maid attack. That requires setting SecureBoot with only my own keys.
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B) | |
set -g prefix C-space | |
unbind-key C-b | |
bind-key C-space send-prefix | |
# Set new panes to open in current directory | |
bind c new-window -c "#{pane_current_path}" | |
bind '"' split-window -c "#{pane_current_path}" | |
bind % split-window -h -c "#{pane_current_path}" |