Skip to content

Instantly share code, notes, and snippets.

View icedream's full-sized avatar

Carl Kittelberger icedream

View GitHub Profile
@icedream
icedream / 0000-Patches-for-verdaccio-gitlab-to-use-CI-job-authentication.md
Last active July 19, 2019 07:48
Patches for verdaccio-gitlab to use CI job authentication

This is a quick and dirty patch I wrote to allow CI job tokens to be used for authentication on Verdaccio.

To use this, patch using git am or git apply, build the code (yarn code:build) and then, when running, use username ci and the job token as password to log in.

The first patch is only there to make the linter stop complaining about bad value coercing. The patches afterwards are the important ones.

// @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;
@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.

@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 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 / 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 / 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 / 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 <[email protected]> (https://icedream.tech)
// @collaborator Remonade
// @match https://twitter.com/*
// @grant none
// @require http://code.jquery.com/jquery-3.5.1.min.js
@icedream
icedream / steamos-ssh.sh
Last active January 15, 2025 04:46
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 / 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 \