Skip to content

Instantly share code, notes, and snippets.

@ithilelda
ithilelda / PXE boot with GRUB2.md
Last active August 9, 2025 17:00
actually working pxe boot with grub2 on bios (client setup)

PXE Boot Setup with GRUB2 Tutorial

There are many tutorials on the internet that tell you how to setup a PXE Boot server with PXELINUX. There are however other options to replace PXELINUX like GRUB2 and iPXE. In this tutorial, I'm going to teach you how to setup a PXE Boot Environment with GRUB2, and later add menu entries to boot many popular OSes.

Notice: I'm not going to repeat the part where you setup the DHCP and TFTP server. Such section in other tutorials still applies to this scenario.

Making the GRUB2 image to be loaded by NIC

think the GRUB2 image as the same as PXELINUX's pxelinux.0 file. Your DHCP server must point to it, and it must be available on your TFTP server. Instead of shoving a blob down your throat and telling you that it just works, I'm going to walk you through the process of making one yourself by using an readily available linux installation.

zt_logo

Setting up ZeroTier as a default ethernet interface

Step 1: Install ZeroTier

Install ZeroTier on your gateway, join your network and authorize it, and then configure it as a basic IPv4 NAT router

/etc/sysctl.conf

@sheepla
sheepla / suggest.sh
Last active March 18, 2024 03:39
Web検索のサジェストキーワードを取得する.sh
#!/bin/sh
# suggest.sh -- get suggestion keywords from several site
#
# Usage:
# suggest SITE KEYWORDS...
# SITE:
# youtube(yt), archwiki(aw), duckduckgo(d), wikipedia(w), amazon(a)
# Example:
# suggest wikipedia Linux
@adamelliotfields
adamelliotfields / windows-ssh-no-password-with-keys-wsl2.md
Last active August 9, 2025 04:36
Windows SSH Server with Password-less Key Authentication and Default WSL2 Shell

Windows SSH Server with Password-less Key Authentication and Default WSL2 Shell

Disclaimer: I am not a Windows Admin and I'm not even that good with PowerShell.

I wanted to be able to SSH into my Windows laptop directly into Linux. I also wanted to disable password authentication and only allow public key (RSA in my case) authentication.

Scott Hanselman wrote a blog post on how to make your default WSL2 distro your default shell for SSH. Windows OS Hub published an article on using public key

use bytes::{Buf, Bytes, BytesMut};
use opentelemetry::sdk;
use opentelemetry::sdk::propagation::TraceContextPropagator;
use opentelemetry::sdk::trace::{Builder, Sampler};
use opentelemetry::trace::TracerProvider;
use opentelemetry::{global::set_text_map_propagator, KeyValue};
use std::convert::TryFrom;
use std::env::var;
use std::net::SocketAddr;
use std::process::Stdio;
@ninlith
ninlith / build.txt
Last active February 12, 2025 04:55
Hybrid UEFI/BIOS multiboot USB drive
# Hybrid UEFI/BIOS multiboot USB drive
# Install required packages
sudo apt install gdisk grub2-common grub-efi-amd64-bin grub-pc-bin qemu-system
# Create an empty disk image
target_size=3.6G # $(lsblk -b --output SIZE -n -d /dev/sdX) for drive size
qemu-img create -f raw boottitikku.img "$target_size"
# Create a GUID Partition Table (GPT)
@plar
plar / ubuntu_disk_encryption.sh
Last active November 6, 2021 19:07
Ubuntu_Full_Disk_Encryption_Howto_2019 (shell commands)
sudo -i
export DEV="/dev/sda"
export DEV="/dev/nvme0n1"
export DM="${DEV##*/}"
export DEVP="${DEV}$( if [[ "$DEV" =~ "nvme" ]]; then echo "p"; fi )"
export DM="${DM}$( if [[ "$DM" =~ "nvme" ]]; then echo "p"; fi )"
# export SDD_PASS=secret123
sgdisk --print $DEV
sgdisk --zap-all $DEV
@FedericoPonzi
FedericoPonzi / CI.yml
Last active May 4, 2024 07:19
Ready to use Github workflow for cross-compiling a rust binary to many Linux architectures.
# Instruction + template repo: https://github.com/FedericoPonzi/rust-ci
# Search and replace <YOUR_BINARY_NAME> with your binary name.
name: CI
on:
pull_request:
push:
branches:
- master
tags:
@Andrey2G
Andrey2G / encoding.txt
Last active April 12, 2025 01:01
Video Encoding with multiple resolutions
ffmpeg -i "c:/videos/sample.mp4
-map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0
-c:v libx264 -crf 22 -c:a aac -ar 48000
-filter:v:0 scale=w=480:h=360 -maxrate:v:0 600k -b:a:0 64k
-filter:v:1 scale=w=640:h=480 -maxrate:v:1 900k -b:a:1 128k
-filter:v:2 scale=w=1280:h=720 -maxrate:v:2 900k -b:a:2 128k
-var_stream_map "v:0,a:0,name:360p v:1,a:1,name:480p v:2,a:2,name:720p"
-preset slow -hls_list_size 0 -threads 0 -f hls -hls_playlist_type event -hls_time 3
-hls_flags independent_segments -master_pl_name "name-pl.m3u8"
"c:/videos/encoded/name-%v.m3u8"
@catchdave
catchdave / replace_synology_ssl_certs.sh
Last active July 12, 2025 17:11
CLI script to programmatically replace SSL certs on Synology NAS
# MOVED to public repo: https://github.com/catchdave/ssl-certs/blob/main/replace_synology_ssl_certs.sh