Skip to content

Instantly share code, notes, and snippets.

View icedream's full-sized avatar

Carl Kittelberger icedream

View GitHub Profile
@icedream
icedream / 00_MigratingFromOldUbuntuLaptopToNewLinuxMintLaptopViaVMs.md
Last active March 8, 2024 10:42
Migrating from an old laptop to a new one through VMs

These are the bunch of overengineered scripts that allow me to take an old Ubuntu laptop's backup, take the important user data from it, migrate that to Linux Mint and unsnappify it without interrupting use of the old laptop, and then prepare it so it will run a proper setup wizard on first boot to set up the new laptop that will run the copy of Linux Mint in the end.

For this purpose, I set up:

  • The old laptop - The old Linux install machine, in my case an old Acer Aspire E5 with Ubuntu 22 on it. Runs Veeam Agent for Linux, backs up to NAS.
  • A hypervisor - I will use VMs to do a migration of data from the old laptop to Linux Mint without interrupting work on the actual device. In this case, I used Proxmox. It hosts:
    • VM 1 (source VM) - Holds the files of the old laptop from the Veeam backups on NAS so the Linux Mint VM can migrate the important parts over via SFTP. A backup restore script runs regularly.
  • VM 2 (Linux Mint VM) - Runs a copy of Linux Mint that will be sysprepped. A separate disk hold
@icedream
icedream / Dockerfile
Last active March 28, 2023 16:41
Nextcloud Alpine Docker image with modified imagemagick to work around wrongly rendered single-letter avatars
# HACK - compile imagemagick package with --without-rsvg flag to work around #34755
FROM nextcloud:26-fpm-alpine AS custom-imagemagick
# Build deps
RUN apk add --no-cache \
alpine-sdk grep \
chrpath fontconfig-dev freetype-dev ghostscript-dev lcms2-dev libheif-dev \
libjpeg-turbo-dev libpng-dev libjxl-dev librsvg-dev libtool libwebp-dev \
libx11-dev libxext-dev libxml2-dev perl-dev tiff-dev zlib-dev \
@icedream
icedream / steamos-ssh.sh
Last active March 7, 2022 17:45
SteamOS SSH preparation
#!/bin/bash
set -e
set -u
# following stuff kinda copied from /usr/bin/steamos-chroot
[ -e /usr/lib/steamos/steamos-partitions-lib ] && \
. /usr/lib/steamos/steamos-partitions-lib || \
{ echo "Failed to source '/usr/lib/steamos/steamos-partitions-lib'"; exit 1; }
@icedream
icedream / deepl-integration-for-twitter.user.js
Last active December 28, 2021 10:42
DeepL Integration for Twitter (Userscript)
// ==UserScript==
// @name DeepL integration for Twitter
// @namespace http://icedream.tech/
// @version 0.3.2
// @description Add "Translate tweet with DeepL" button
// @author Carl Kittelberger <icedream@icedream.pw> (https://icedream.tech)
// @collaborator Remonade
// @match https://twitter.com/*
// @grant none
// @require http://code.jquery.com/jquery-3.5.1.min.js
@icedream
icedream / main.js
Created June 20, 2021 02:19
Some crappy string obfuscation thing
function _arrayBufferToBase64( buffer ) {
var binary = '';
var bytes = new Uint8Array( buffer );
var len = bytes.byteLength;
for (var i = 0; i < len; i++) {
binary += String.fromCharCode( bytes[ i ] );
}
return window.btoa( binary );
}
@icedream
icedream / README.md
Last active March 25, 2022 13:31
Clipping without reencoding

youtube-dl has the ability to give you a direct download link for a video instead of downloading the whole video by itself. This is really useful if you only intend to clip a specific part of a stream, and you can even do that without reencoding for maximum speed if you can accept a tolerance of 2 seconds (the usual keyframe interval used for streams). This is a technique I am using to make my Games Done Quick clips as well, so this is not limited to YouTube.

Here's how you can do it:

Requirements

@icedream
icedream / README.md
Last active October 16, 2020 10:20
Upstream ssh-copy-id Fix

Arch Linux (and I assume several other mostly-as-is distros) currently ships a broken version of the ssh-copy-id script with their openssh package because the upstream developers decided to merge a "ported" version of the script by Phil Hands back into upstream. While it contains many improvements it does reintroduce the error messages and changes actually not taking any effect in authorized_keys.

It turns out getting the new script back running is pretty simple with the changes listed below.

I suggest copying the original script from /usr/bin/ssh-copy-id to a new folder that you prepend to your $PATH (like $HOME/.local/bin) and then applying the patch listed here. This way the copy will take effect in $PATH searches until the issue is resolved so you can safely delete the file.

@icedream
icedream / Dockerfile
Created August 12, 2020 18:32
mkp224o in Docker image
###
# DOWNLOAD
FROM alpine AS source
RUN apk add --no-cache git
RUN git clone --recursive https://github.com/cathugger/mkp224o.git /usr/src/mkp224o
###
@icedream
icedream / README.md
Last active March 29, 2024 20:57
Adjusting SELinux to change SSH port in Fedora CoreOS

See coreos/fedora-coreos-tracker#396 (comment) for a bit of explanation.

Warning: The script will trigger warning messages in the systemd journal log that look like this:

systemd[1]: sshd.service: Found left-over process 4270 (conmon) in control group while starting unit. Ignoring.
systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.

This is probably a side effect of the script booting up podman containers to run semanage - I don't know how to get rid of this properly if it's possible at all but I think this can be ignored for now.

SSH daemon can take quite a long while to start for the first time due to the one-time image build.

// @author Carl Kittelberger
// Because I am the only one insane enough to do this voluntarily for a joke.
const n = 0;
function notReallyObfuscateNumber(num) {
return '0' + num.toString(8);
}
const numberArrayObfuscationUnicodeOffset = 0x29;