Skip to content

Instantly share code, notes, and snippets.

Avatar

Luis Pabon luispabon

  • Auron Consulting Ltd
  • London
View GitHub Profile
@luispabon
luispabon / readme.md
Last active March 19, 2023 14:47
Jellyscrub + jellyfin + docker with unprivileged jellyfin user
View readme.md

Jellyfin and Jellyscrub in Docker with unprivileged jellyfin user (fixes player not showing thumbnails)

Jellyscrub needs to be able to write to Jellyfin's index.html. If you're running Jellyfin as an unprivileged user it won't be able to, since the official container jellyfin files are owned by root.

This is a docker-compose example of how to work around this problem. The docker-compose service definition for jellyfin also passes through an intel igpu. Leaving here as this might be useful to someone.

Once adding the below, make sure you build the container, delete the old one and bring up a new one with docker-compose down jellyfin && docker-compose up -d. Any changes to the dockerfile or build params also mandate this.

@luispabon
luispabon / Example.md
Last active March 15, 2023 10:51
Wait for DNS
View Example.md
~ wait_for_dns.sh "google.com foobar.foo"                                                                                      Wed 15 Mar 2023 10:49:37 GMT

### Trying to resolve google.com foobar.foo ###
>> Waiting for dns 'google.com' to be available -> 172.217.16.238 2a00:1450:4009:821::200e 👍
>> Waiting for dns 'foobar.foo' to be available ----> Timed out after 4s 👎
@luispabon
luispabon / gist:243e33f1d92aab2301c6b8fd15b72487
Last active October 19, 2022 17:34
Find folders that contain one file but not another
View gist:243e33f1d92aab2301c6b8fd15b72487
find my/search/path -type d -exec test -e '{}'/i_want_this_file.txt -a '!' -e '{}'/but_not_this_one.txt \; -print | sort
# Note if not obvs: remove the '!' to search for folders that contain both files
@luispabon
luispabon / command line (bash)
Created October 4, 2022 11:47
aws cli terraform import secret and secret version
View command line (bash)
~ terraform import aws_secretsmanager_secret.yep my_name
~ terraform import aws_secretsmanager_secret_version.yep my_name\|$(aws secretsmanager get-secret-value --secret-id=my_name | jq ".VersionId" --raw-output)
@luispabon
luispabon / main window
Created April 21, 2022 10:28
New jetbrains windows
View main window
{
"id": 577,
"type": "con",
"orientation": "none",
"percent": 0.49679487179487181,
"urgent": false,
"marks": [
],
"focused": false,
"layout": "none",
@luispabon
luispabon / sway.log
Created October 27, 2021 11:12
Killed workspaces
View sway.log
This file has been truncated, but you can view the full file.
00:00:00.000 [INFO] [sway/main.c:310] Sway version 1.6-e76e13ef (Oct 26 2021, branch 'HEAD')
00:00:00.000 [INFO] [sway/main.c:311] wlroots version 0.15.0
00:00:00.001 [INFO] [sway/main.c:118] Linux luis-XPS-15-9560 5.13.0-20-generic #20-Ubuntu SMP Fri Oct 15 14:21:35 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
00:00:00.001 [INFO] [sway/main.c:134] Contents of /etc/lsb-release:
00:00:00.001 [INFO] [sway/main.c:118] DISTRIB_ID=Ubuntu
00:00:00.001 [INFO] [sway/main.c:118] DISTRIB_RELEASE=21.10
00:00:00.001 [INFO] [sway/main.c:118] DISTRIB_CODENAME=impish
00:00:00.001 [INFO] [sway/main.c:118] DISTRIB_DESCRIPTION="Ubuntu 21.10"
00:00:00.001 [INFO] [sway/main.c:134] Contents of /etc/os-release:
00:00:00.001 [INFO] [sway/main.c:118] PRETTY_NAME="Ubuntu 21.10"
@luispabon
luispabon / move_snapd_folder.sh
Created October 14, 2021 15:58
Move snapd folder elsewhere
View move_snapd_folder.sh
#!/bin/bash
# Found here https://askubuntu.com/questions/1029562/move-snap-packages-to-another-location-directory
##############################################################################
# Take Care this section may break your System !!!
##############################################################################
##Move snap folder to Home instead of root.
#Create the directory : you can change the location
mkdir -p /${NEW_LOCATION}/snapd
@luispabon
luispabon / wait-for-mysql.sh
Created November 24, 2020 15:53
Waiting for DB docker edition - these scripts require the standard env vars the docker images use to initially provision themselves
View wait-for-mysql.sh
#!/usr/bin/env bash
# Make sure you run this in the mysql container
RETRIES=5
echo "Waiting for mysql"
until mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" "${MYSQL_DATABASE}" -e "select 1" &> /dev/null || [ $RETRIES -eq 0 ]
do
echo "Waiting for mysql server, $((RETRIES--)) remaining attempts..."
View outputs
~ swaymsg -t get_outputs Thu 02 Apr 2020 11:03:11 BST
Output eDP-1 'Sharp Corporation 0x1476 0x00000000' (focused)
Current mode: 3840x2160 @ 59.997002 Hz
Position: 0,1081
Scale factor: 2.000000
Scale filter: nearest
Subpixel hinting: unknown
Transform: normal
Workspace: 2
Max render time: off
@luispabon
luispabon / wofi-swytch.sh
Created February 11, 2020 16:49
Swytch with Wofi
View wofi-swytch.sh
#!/bin/bash
# Swytch is a script providing a window switcher for sway using rofi, awk and jq.
# The script is based on:
# https://www.reddit.com/r/swaywm/comments/aolf3u/quick_script_for_rofi_alttabbing_window_switcher/
# Copyright (C) 2019 Björn Sonnenschein
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or