Skip to content

Instantly share code, notes, and snippets.

View hammerill's full-sized avatar
🚘
learns to drive

Kirill hammerill

🚘
learns to drive
View GitHub Profile

FFmpeg Convert 1.jpg to .jpg

for file in *1.jpg; do ffmpeg -i "$file" "${file%1.jpg}".jpg && rm "$file"; done

mpv Autofit Window to 80%

This fixes the mpv window being too big when launching a 4K video on a 1080p screen, for example, by limiting it at 80% of the screen.

Add to ~/.config/mpv/mpv.conf:

autofit-larger=80%x80%

mpv Copy Timestamp

Lines to add to your ~/.config/mpv/input.conf:

n run sh -c 'echo ${time-pos} | oscopy'
N run sh -c 'echo ${time-pos/full} | oscopy'

This adds two keys:

Unified Copy

Sometimes it's not easy to get things from a terminal to your system clipboard. If you're connected locally, it has to be a special tool which handles this (like wl-clipboard under Wayland) or something other when connected remotely.

This is a Shell executable which ultimately solves the problem by always reaching your local system clipboard:

#!/bin/bash

printf "\e]52;c;$(base64 -w0)\a"

Sunshine Lock Systemd Entry

/etc/systemd/user/sunshine-lock.service:

[Unit]
Description=Lock Screen When Sunshine Loaded
After=sunshine.service

[Service]

Arch Linux Printer

sudo pacman -S --needed cups system-config-printer
sudo systemctl enable cups --now

system-config-printer
@hammerill
hammerill / arch-pandoc.md
Created April 7, 2025 09:08
Install minimal dependencies in Arch Linux to get Pandoc MD -> PDF conversion working.

Arch Linux Install Pandoc MD -> PDF Convertor

sudo pacman -S --needed pandoc texlive-latexrecommended texlive-fontsrecommended
@hammerill
hammerill / vimrc.md
Last active April 8, 2025 12:24
Define global Vim config.

Define "/etc/vimrc" Config

VIMRC_PATH=/etc/vimrc

echo -e '\nset number\nset relativenumber\n\nset shiftwidth=4\nset smarttab\n\nsyntax on' | sudo tee -a "$VIMRC_PATH"

Force Command+Number Shortcuts for Tabs in VS Code for macOS

Keyboard Shortcuts.

{ "key": "cmd+1","command": "workbench.action.openEditorAtIndex1" },
{ "key": "cmd+2","command": "workbench.action.openEditorAtIndex2" },
{ "key": "cmd+3","command": "workbench.action.openEditorAtIndex3" },
{ "key": "cmd+4","command": "workbench.action.openEditorAtIndex4" },
{ "key": "cmd+5","command": "workbench.action.openEditorAtIndex5" },
@hammerill
hammerill / macbook-name.md
Last active May 5, 2025 09:38
Change MacBook name

Change MacBook Name

NEW_NAME="pommier"

sudo scutil --set ComputerName "$NEW_NAME"
sudo scutil --set LocalHostName "$NEW_NAME"
sudo scutil --set HostName "$NEW_NAME"