Skip to content

Instantly share code, notes, and snippets.

@kramerc
kramerc / unfollow_all_hashtags.rb
Created December 22, 2023 16:45
Unfollow all hashtags on Mastodon
account_id = User.find_by(email: 'REPLACE@example.com').account.id
TagFollow.where(account_id: account_id).each { |follow| follow.destroy!; TagUnmergeWorker.perform_async(follow.tag.id, account_id) }; nil
@kramerc
kramerc / rekordbox6_path_replace.sql
Last active December 20, 2023 23:01
Query to update paths in a rekordbox 6 library
update
djmdContent
set
FolderPath = b.FolderPath
from
(
select
id,
replace(FolderPath, 'M:', 'E:') as FolderPath
from
@kramerc
kramerc / discord_timestamps.md
Created December 19, 2023 22:36
Specification of timestamps format in Discord that show in the user's time zone
<t:1702933920:T>

t: - prefix

1702933920 - unix timestamp

Suffix codes:

  • :t - short time
@kramerc
kramerc / deploy_version.sh
Created December 10, 2023 00:42
Mastodon upgrade scripts
#!/bin/sh
VERSION=$1
if [ -z $VERSION ]
then
echo "No version specified. Example: deploy_version.sh v4.1.3"
exit 1
fi
sudo systemctl stop mastodon-web mastodon-sidekiq mastodon-streaming && \
Fixes sleep bug on AMD cards including DisplayPort ports.
Based on https://gitlab.freedesktop.org/drm/amd/-/issues/662#note_909333
Index: linux-source-5.10/drivers/gpu/drm/amd/display/dc/core/dc_link.c
===================================================================
--- linux-source-5.10.orig/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ linux-source-5.10/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -153,7 +153,7 @@ static bool program_hpd_filter(const str
case SIGNAL_TYPE_HDMI_TYPE_A:
/* Program hpd filter */
delay_on_connect_in_ms = 500;
# vim:ft=zsh ts=2 sw=2 sts=2
#
# kramerc's theme
# Based on philips's theme.
prompt_context() {
local context user_fg
if [ $UID -eq 0 ]; then
# Root user