Skip to content

Instantly share code, notes, and snippets.

Pavel spvkgn

Block or report user

Report or block spvkgn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
# resize jpeg
mogrify -format jpg -strip -interlace plane -sampling-factor 4:2:0 -define jpeg:dct-method=float -density 300x300 -resize 50% -quality 85 -path /tmp *.jpg
convert -format jpg -strip -interlace plane -sampling-factor 4:2:0 -define jpeg:dct-method=float -density 300x300 -resize 50% -quality 85 file.jpg
spvkgn /
Last active Oct 12, 2019
Script to build a statically linked version of opus-tools
# ==============================================================
# Script to build a statically linked version of opus-tools
# Release tarballs:
spvkgn /
Last active Aug 21, 2018 — forked from jonlabelle/
Generate an mp3 playlist file (.m3u), sorted by album track number.
#!/usr/bin/env python3
import os
import sys
import glob
from mutagen.mp3 import MP3
from mutagen.easyid3 import EasyID3
# MP3 playlist generator
spvkgn /
Last active Jul 15, 2018
Fetch lyrics with DeaDBeeF player
DEADBEEF=$(which deadbeef)
ARTIST_NAME=$($DEADBEEF --nowplaying-tf "%artist%")
TRACK_TITLE=$($DEADBEEF --nowplaying-tf "%title%")
printf "\033c"
ARTIST=$(echo "$ARTIST_NAME" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"')
spvkgn / compton.service
Created May 2, 2018
systemd user units
View compton.service
Description=Compton X11 compositor
ExecStart=/usr/bin/compton -b
ExecReload=/bin/kill -SIGUSR1 $MAINPID
View ffmpeg_tips.txt
# Convert HLS .m3u8 playlist to MP4
ffmpeg -i playlist.m3u8 -acodec copy -vcodec copy output.mp4
# for stream with AAC audio also needs to add the bitstream filter
ffmpeg -i playlist.m3u8 -acodec copy -bsf:a aac_adtstoasc -vcodec copy output.mp4
# lossless cut from URL. -ss input seeking point, -t duration
ffmpeg -ss 00:00:00 -i <URL> -t 00:00:00 -acodec copy -vcodec copy output.mp4
# get URL with youtube-dl. -to output seeing point
ffmpeg -ss 00:00:00 -i `youtube-dl -g <URL>` -t 00:00:00 -acodec copy -bsf:a aac_adtstoasc -vcodec copy -copyts -avoid_negative_ts 1 output.mp4
spvkgn / suspend-modules
Last active Apr 6, 2018 — forked from mauron85/suspend-modules
Ubuntu 16.04 systemd unload modules on sleep
View suspend-modules
# Put into /lib/systemd/system-sleep/suspend-modules
# chmod a+x /lib/systemd/system-sleep/suspend-modules
# Create /etc/suspend-modules.conf
# with one module per line
# credits to:
View gist:e518345500a608231c9f2c29c2dc2b8b
dget -ux
wget -O xkb-switch-on-release.patch
cd cd xorg-server-1.19.3
quilt import ../xkb-switch-on-release.patch
dch -l ppa~artful -D artful 'Add xkb-switch-on-release.patch'
debuild -S -sd -d
View gist:0e64d620bf5ef41f81cda115ffcff108
sudo apt install -y gcc-4.9 g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
spvkgn /
Created Jun 25, 2017
Show bitrate of audio files in current dir with mediainfo
FILETYPES="*.mp3 *.m4a *.mpc *.ogg *.flac *.ape *.wav"
MEDIAINFO_PARAMS=--inform="Audio;%BitRate/String% %BitRate_Mode% %Format%\n"
if [ ! -z "$1" ]
then mediainfo "$MEDIAINFO_PARAMS" "$@" | sed '${/^$/d}'
else mediainfo "$MEDIAINFO_PARAMS" $FILETYPES | sed '${/^$/d}'
You can’t perform that action at this time.