Skip to content

Instantly share code, notes, and snippets.

View bjoern-r's full-sized avatar

Björn bjoern-r

  • Berlin; Germany
View GitHub Profile
@jaminmc
jaminmc / install_openwrt_proxmox.sh
Last active April 17, 2025 11:17
Install OpenWrt in a Container on Proxmox 8+!
#!/bin/bash
# Script to create an OpenWrt LXC container in Proxmox
# Downloads from openwrt.org with latest stable or snapshot version, detects bridges/devices, IDs, configures network, sets optional password
# Pre-configures WAN/LAN in UCI, includes summary and confirmation, optional LuCI install for snapshots with apk
# Default resource values
DEFAULT_MEMORY="256" # MB
DEFAULT_CORES="2" # CPU cores
DEFAULT_STORAGE="0.5" # GB
@scivision
scivision / CMakeLists.txt
Last active October 20, 2022 10:14
CMake find_library force static search
# CMake find_library() defaults to shared library before static.
# this order can be programatically set as below.
cmake_minimum_required(VERSION 3.1)
project(demo LANGUAGES C)
# arbitrary library to demo search
if(MSVC)
set(libname msvcrt)
else()
@mrlnc
mrlnc / pysim-suci.md
Last active March 20, 2025 12:15
pysim-suci.md
@Jamesits
Jamesits / asa_request_cert.sh
Last active May 6, 2024 08:30
Let's Encrypt cert requesting and signing (using acme.sh) for Cisco ASA / AnyConnect
#!/bin/bash
set -Eeuo pipefail
# Automatic cert requesting and signing for Cisco ASA
#
# Requirements
# - Domain hosted in Aliyun DNS (for other DNS services, adjust the acme.sh arguments)
# - ASA with rest-agent enabled
# - Local computer: openssl, git, ca-certificates
#
#!/bin/bash
set -e
INFILE="rc3-mcr-11512-eng-deu-CIA_vs_Wikileaks_hd.mp4"
OUTDIR="output/"
FRAMES=1000
@yvesh
yvesh / proxmox-zfs-encryption.md
Last active February 27, 2025 13:09
Proxmox 6.1 ZFS native full disk (ZFS root) encryption.

Simple guide for fulldisk encryption with Proxmox and ZFS native encryption

Install normally using the installer, after the setup reboot into recovery mode (from the USB stick). Make sure to install in UEFI mode (you need systemd-boot).

If the USB stick is not working for you, because of the old Kernel version (2.6.x), you can also use an Ubuntu 19.10 / 20.04 boot stick. ZFS suport is enabled there out of the box.

Steps:

@yvesh
yvesh / gist:64ec1f64e3c7c26497282b776348f662
Created December 19, 2019 11:49
Proxmox LXC Arch Linux Container with passed through GPU, KVM, sound, keyboard etc. (Xorg with amdgpu working), Looking Glass Host - Linux Main OS in a container
arch: amd64
cores: 24
features: fuse=1,mount=nfs;cifs,nesting=1
hostname: archxorg
memory: 64000
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=XX:XX:XX:XX:XX.XX,ip=dhcp,type=veth
ostype: archlinux
rootfs: local-zfs:subvol-100-disk-0,size=500G
swap: 512
lxc.autodev: 1
@Informatic
Informatic / domain.xml
Last active April 13, 2025 00:32
How to use Windows 10 OEM license in libvirt VM (<smbios mode='host' /> does not work as Windows seems to verify UUID; apparmor/security configuration changes may be needed)
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<!-- ... -->
<qemu:commandline>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/slic.bin'/>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/msdm.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='file=/some/path/smbios_type_0.bin'/>
<qemu:arg value='-smbios'/>
@henridf
henridf / protoc-encode.md
Last active May 29, 2024 22:08
Encoding a protobuf with `protoc --encode`

I needed to quickly encode a protobuf from the command-line, and while I pretty much immediately came across protoc --encode as the obvious solution, I did not find much documentation on the input textual syntax.

Here is the relevant snippet from protoc --help:

--encode=MESSAGE_TYPE       Read a text-format message of the given type
                              from standard input and write it in binary
                              to standard output.  The message type must
                              be defined in PROTO_FILES or their imports.
@derpeter
derpeter / reencode.sh
Created October 14, 2017 01:50
reencode all video files in an folder that a bigger than a configured value to save disk space
#!/bin/bash
MIN_SIZE=6G
IN_DIR=.
OUT_DIR=out
find $IN_DIR -maxdepth 1 -type f -size +$MIN_SIZE -exec ffmpeg -y -i {} -c:v libx264 -preset slow -tune film -profile:v high -level 4.2 -crf 23 -c:a copy -c:s copy $OUT_DIR/{} \;