Skip to content

Instantly share code, notes, and snippets.

@spvkgn
spvkgn / fmplay.json
Created Jan 18, 2021
fmplay stations
View fmplay.json
{
"silver": {
"name": "Серебряный Дождь",
"site": "http://www.silver.ru/",
"logo": "img/silver.jpg",
"logo_webp": "img/silver.webp",
"position": "0",
"category": "fed",
"partner": "0",
"xtra_low": "http://109.239.133.138:8000/silver-16.aac",
@spvkgn
spvkgn / adb-tcpip.sh
Created Dec 5, 2020
Enable ADB over TCP/IP
View adb-tcpip.sh
#!/bin/sh
adb -d tcpip 5555 && sleep 1
adb -d connect `adb -d shell ip -4 addr show wlan0 | grep -oP 'inet \K[0-9.]*'`:5555
@spvkgn
spvkgn / build-imagemagick7.sh
Last active Aug 17, 2020 — forked from SoftCreatR/README.md
ImageMagick® 7 for Debian/Ubuntu
View build-imagemagick7.sh
#!/bin/sh
##############################################################
# Title : build-imagemagick7.sh #
# Description : ImageMagick® 7 for Debian/Ubuntu, #
# including (nearly) full delegate support. #
##############################################################
# Make sure, that we are on Debian or Ubuntu
if ! lsb_release -d | grep -qE 'Ubuntu|Debian'; then
View imagemagick_tips.sh
#!/bin/sh
# 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
spvkgn / opus-tools_static_build.sh
Last active Apr 7, 2020
Script to build a statically linked opus-tools
View opus-tools_static_build.sh
#!/bin/sh
# ==============================================================
# Script to build a statically linked version of opus-tools
#
# Release tarballs:
# http://downloads.xiph.org/releases/opus/
# http://downloads.xiph.org/releases/ogg/
# http://downloads.xiph.org/releases/flac/
#
@spvkgn
spvkgn / m3u.py
Last active Aug 21, 2018 — forked from jonlabelle/m3u.py
Generate an mp3 playlist file (.m3u), sorted by album track number.
View m3u.py
#!/usr/bin/env python3
import os
import sys
import glob
from mutagen.mp3 import MP3
from mutagen.easyid3 import EasyID3
#
# MP3 playlist generator
@spvkgn
spvkgn / ddb-lyrics.sh
Last active Jul 15, 2018
Fetch lyrics with DeaDBeeF player
View ddb-lyrics.sh
#!/bin/sh
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
spvkgn / compton.service
Created May 2, 2018
systemd user units
View compton.service
[Unit]
Description=Compton X11 compositor
After=graphical.target
[Service]
Type=forking
Restart=always
RestartSec=10
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 https://ffmpeg.org/ffmpeg-bitstream-filters.html#aac_005fadtstoasc
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
spvkgn / suspend-modules
Last active Apr 6, 2018 — forked from mauron85/suspend-modules
Ubuntu 16.04 systemd unload modules on sleep
View suspend-modules
#!/bin/bash
# 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:
# https://bbs.archlinux.org/viewtopic.php?pid=1540125#p1540125