Skip to content

Instantly share code, notes, and snippets.

View editicalu's full-sized avatar

Ward Segers editicalu

View GitHub Profile
@editicalu
editicalu / dockctx.sh
Created February 2, 2023 08:58
Script to switch between apple silicon-based docker and intel one, given the two exist as a lima context
#!/bin/sh
if [ $# -eq 0 ]
then
docker context list
else
# This could be written better
limactl stop applesilicon &
limactl stop intel &
wait
@editicalu
editicalu / index.php
Created June 7, 2021 22:37
fourorsix: is this viewed using IPv4 or IPv6?
<?php
// https://www.php.net/manual/en/function.str-contains.php#125977
if (!function_exists('str_contains')) {
function str_contains($haystack, $needle) {
return $needle !== '' && mb_strpos($haystack, $needle) !== false;
}
}
$ip = $_SERVER['REMOTE_ADDR'];
$isipv6 = str_contains($ip, ':');
@editicalu
editicalu / signal-desktop.desktop.patch
Created January 20, 2021 16:39
Modify signal desktop on Linux to start in the system tray
--- signal-desktop.desktop 2021-01-20 11:51:16.000000000 +0100
+++ signal-desktop-enhanced.desktop 2021-01-20 17:35:24.253557568 +0100
@@ -3,7 +3,7 @@
Name=Signal
Comment=Signal Private Messenger for Linux
Icon=signal-desktop
-Exec=signal-desktop
+Exec=signal-desktop --start-in-tray
Terminal=false
Categories=Network;InstantMessaging;
all: alfa.pdf
alfa.pdf: alfa.latex
latexmk -pdf $<
alfa.png: alfa.pdf
convert -density 150 -flatten $< $@
clean: alfa.latex
latexmk -CA $<
@editicalu
editicalu / gitlab_runner_setup.sh
Last active March 18, 2019 15:59
Quickly setup a GitLab runner using Docker on Ubuntu
#!/bin/sh
# Should be run as root on a clean Ubuntu LTS installation
GITLAB_URL=https://gitlab.com
GITLAB_CI_TOKEN=insert-token-here
GITLAB_IMAGE=alpine
GITLAB_TAGS=ubuntu,docker
# If your hostname isn't unique, use this
#GITLAB_NAME=$RANDOM
GITLAB_NAME=`hostname`
@editicalu
editicalu / update_mirrors.sh
Created September 27, 2018 10:30
Pacman mirror update
#!/bin/bash
cd /tmp
echo "Creating a backup of the old mirrorlist in /etc/pacman.d/mirrorlist.backup…"
su -c "rm /etc/pacman.d/mirrorlist.pacnew && cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup && sync"
echo "Downloading a new mirrorlist…"
# Change this line to your preferences
# Standard: only servers with HTTPS and IPv6 support.

Keybase proof

I hereby claim:

  • I am editicalu on github.
  • I am editicalu (https://keybase.io/editicalu) on keybase.
  • I have a public key ASA782026lxIJjD_KIxw5P912Kbp47_tkPEWesUqBLdLbAo

To claim this, I am signing this object: