Skip to content

Instantly share code, notes, and snippets.

@fffx
fffx / docker_setup
Created May 16, 2025 19:56
Steamdeck
# set -e
sudo steamos-readonly disable
sudo pacman-key --init
sudo pacman-key --populate archlinux
sudo pacman -S gnome-terminal
wget https://download.docker.com/linux/static/stable/x86_64/docker-20.10.24.tgz
tar xzvf ./docker-20.10.24.tgz
sudo cp docker/* /usr/bin/
@fffx
fffx / kobo-readme.md
Last active May 12, 2025 19:37
Kobo reader notes

covert mdx dictionary to kobo dict format with pyglossary

  1. Put your the mdx and mdd files to the same folder, pyglossary would pick up the mdd file automatically

  2. covert

pyglossary  --write-format=Kobo  some.mdx  dicthtml-dict-name.zip

@fffx
fffx / 1-sekiro.md
Last active April 20, 2024 08:22
backup Sekiro save file in steam deck with bash-shortcuts
  1. Install decky-loader and bash-shortcuts
  2. Go to desk mode, you may need Anydesk
  3. Put the bash-shortcuts.json to the path $HOME/homebrew/settings/bash-shortcuts/bash-shortcuts.json

And from now on, you can backup Sekiro progress without switching to deskmode!

image

@fffx
fffx / readme.md
Created July 20, 2023 21:01
Install nerdfont for Lazyvim
@fffx
fffx / analyzer.rb
Last active March 22, 2024 12:04
blurhash rails-7 with libvips
class BlurhashAnalyzer < ActiveStorage::Analyzer::ImageAnalyzer::Vips
def metadata
read_image do |image|
if rotated_image?(image)
{ width: image.height, height: image.width }
else
{ width: image.width, height: image.height }
end.merge blurhash(image)
end
end
@fffx
fffx / .cloud-init.yml
Created March 18, 2022 13:35
multipass notes
ssh_authorized_keys:
- < your public key here>
@fffx
fffx / main.yml
Created March 18, 2022 08:24
Ansible run multiple task in parallel
- name: Clone repositories
git: repo={{item.repo}} dest={{item.dest}} depth=1
loop:
- {repo: "{{git_server}}/project1.git", dest: "some where" }
- {repo: "{{git_server}}/project2.git", dest: "some where else" }
register: clone_result
async: 600
poll: 0
# - debug: var=clone_result
- name: Check on an async task
@fffx
fffx / aria2.conf
Created January 5, 2022 06:08 — forked from qzm/aria2.conf
Best aria2 Config
### Basic ###
# The directory to store the downloaded file.
dir=${HOME}/Downloads
# Downloads the URIs listed in FILE.
input-file=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to FILE on exit.
save-session=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to a file specified by --save-session option every SEC seconds. If 0 is given, file will be saved only when aria2 exits. Default: 0
save-session-interval=60
# Set the maximum number of parallel downloads for every queue item. See also the --split option. Default: 5
@fffx
fffx / fix_minidlna.md
Created August 22, 2021 04:21
Fix MiniDLNA not scan new files

First make sure in /etc/minidlna.conf

inotify=true

check /var/log/minidlna.log may found

[2021/08/22 04:14:10] monitor.c:216: warn: WARNING: Inotify max_user_watches [8192] is low or close to the number of used watches [30] and I do not have permission to increase this limit.  Please do so manually by writing a higher value into /proc/sys/fs/inotify/max_user_watches
@fffx
fffx / backup.sh
Created July 4, 2021 04:38
openwrt auto backup 自动备份
#!/usr/bin/env bash
## usage
# chmod +x ./backup.sh
# add it to your crontab
set -u
filepath=/tmp/${HOSTNAME}-$(date +%F)-backup.tar.gz
umask go=
/sbin/sysupgrade -b $filepath