Skip to content

Instantly share code, notes, and snippets.

View Zorono's full-sized avatar
😌
I may be slow to respond.

John Magdy Lotfy Kamel Zorono

😌
I may be slow to respond.
View GitHub Profile
@szocsbarni
szocsbarni / install-ubuntu-luks-lvm.md
Last active March 8, 2024 12:58 — 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). For a target OS of Debian 11, I have used and tested this guide: https://linuxconfig.org/how-to-install-debian-on-an-existing-luks-container

yt-dlp termux full installation guide.md

Prepare

  1. Install Termux from Github: https://github.com/termux/termux-app/releases
  2. Download the apk and install it -> Note that installing termux from Play Store is highly discouraged.

In Termux:

pkg update
@CodingKoopa
CodingKoopa / apt.md
Last active February 2, 2026 11:50
APT Repositories Explained

Intro

To install and update packages on Debian, Ubuntu, or most derived distributions, you use APT, the Advanced packaging tool, to download the packages and their dependencies, which uses dpkg to install them.

These notes go into the downloading part, as I think it's easy to get overwhelmed by how the repositories work. I will eventually turn this into a page on my website.

Repository

A repository is where the packages come from. It provides binary packages for an arbitrary selection of architectures as well as source packages. Repositories are APT's data source. [https://wiki.debian.org/DebianRepository]

@pazguille
pazguille / calculate-reading-time-javascript.js
Last active March 9, 2024 14:10
Calculate the estimated reading time of an article using JavaScript
function readingTime(txt) {
const wpm = 225; // average adult reading speed (words per minute).
const words = txt.trim().split(/\s+/).length;
const time = Math.ceil(words / wpm);
return time;
}
const time = readingTime(
document.querySelector("article").innerText
);
@Paraphraser
Paraphraser / Checking your Raspberry Pi's view of its power supply.md
Last active February 5, 2026 15:50
Checking your Raspberry Pi's view of its power supply (sometimes it's not the wall-wart)

Checking your Raspberry Pi's view of its power supply

Sometimes it seems like the first (and sometimes only) advice you get offered for almost any problem with a Raspberry Pi is "check your power supply". You think something like:

"hey, I'm using an official power supply sold as being matched with my Pi so how can there be any problem?"

You look up the specs then stick a controlled load across your supply and confirm that it can deliver the required number of Watts.

Yet your problems persist…

@akihiro
akihiro / gencrt.sh
Created April 20, 2022 15:17
Temporary CA and localhost certificate script
#!/bin/bash
san="DNS:localhost, DNS:localhost.localdomain, IP:127.0.0.1, DNS:app, DNS:app.localdomain"
date=$(date -uI)
openssl genpkey -out tempca.key -outform PEM -algorithm RSA
openssl req -out tempca.csr -key tempca.key -subj "/CN=TempCA$date" -new
openssl x509 -req -days 366 -signkey tempca.key -in tempca.csr -outform der -out tempca.crt
openssl genpkey -out localhost.key -algorithm EC -pkeyopt "ec_paramgen_curve:prime256v1"
openssl req -new -sha256 -key localhost.key -subj "/CN=localhost" -outform pem -out localhost.csr
from pathlib import Path
from watchfiles import watch
from devtools import debug
THIS_DIR = Path(__file__).parent
for changes in watch(THIS_DIR, debug=True):
debug(changes)
@Thrilleratplay
Thrilleratplay / earlygrubcryptoimg.sh
Created November 27, 2021 16:23 — forked from ibressler/earlygrubcryptoimg.sh
Creates an early grub core image for ESP to cryptmount a LUKS+LVM partition where the grub files /boot/ and the kernel is stored
#!/bin/dash
# Creates a standalone core image with grub to be started by EFI.
# It complements the excellent cryptroot tutorial at
# https://community.linuxmint.com/tutorial/view/2061
# for grub on BTRFS inside LVM inside LUKS.
#
# It initiates decryption of the root device which contains
# LVM with BTRFS on the root volume where grub is installed.
# Therefore, it allows to load grub from an LUKS encrypted BTRFS
# root file system.
@superjamie
superjamie / install-ubuntu-luks-lvm.md
Last active January 3, 2026 17:05
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).

@JuniorDjjr
JuniorDjjr / fakeMainOutputFile.sc
Created November 11, 2021 17:39
SA main.scm source code leaked from GTA SA The Definitive Edition
This file has been truncated, but you can view the full file.
// *****************************************************************************************
// *****************************************************************************************
// *****************************************************************************************
// ****************************************PC SA Main Script********************************
// *****************************************************************************************
// *****************************************************************************************
// *****************************************************************************************
SCRIPT_NAME MAIN //NEW MAIN