Skip to content

Instantly share code, notes, and snippets.

View spvkgn's full-sized avatar

spvkgn

  • Russia
View GitHub Profile
#!/bin/bash
export MPD_HOST=$HOME/.config/mpd/socket
#MIME_CMD="file -bL --mime-type"
MIME_CMD="mimetype -biL"
[ -z "$1" ] || tmpfile=$(mktemp)
add_file() {
@spvkgn
spvkgn / far2l-OpenWrt.md
Last active July 23, 2023 04:39
Build far2l for OpenWrt

Build Far2L using OpenWrt SDK toolchain

  • wget https://downloads.openwrt.org/releases/21.02.3/targets/ramips/mt7621/openwrt-sdk-21.02.3-ramips-mt7621_gcc-8.4.0_musl.Linux-x86_64.tar.xz

  • tar xvf $(ls openwrt-sdk-*.tar.xz) && cd $(ls -d openwrt-sdk-*/) && mkdir -p package/far2l && nano package/far2l/Makefile

include $(TOPDIR)/rules.mk

GIT_HASH:=$(shell wget -qO- https://api.github.com/repos/elfmz/far2l/commits/master | grep -Po -m1 '"sha": "\K.{7}')
@spvkgn
spvkgn / fmplay.json
Created January 18, 2021 15:19
fmplay stations
{
"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 / opus-tools_static_build.sh
Last active September 10, 2022 23:06
Script to build a statically linked opus-tools
#!/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 / ffmpeg_tips.txt
Last active May 6, 2022 07:27
FFmpeg tips
# 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 / GA-P35-DS3.conf
Last active November 4, 2021 06:31
GA-P35-DS3 / Xeon L5420 lm-sensors config
chip "it8718-*"
### Voltages
label in0 "CPU Vcore"
set in0_min 0.85
set in0_max 1.35
label in1 "DDR18V"
set in1_min 1.8 * 0.95
@spvkgn
spvkgn / bitrate.sh
Created June 25, 2017 05:41
Show bitrate of audio files in current dir with mediainfo
#!/bin/sh
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}'
fi
@spvkgn
spvkgn / adb-tcpip.sh
Created December 5, 2020 09:26
Enable ADB over TCP/IP
#!/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 August 17, 2020 05:06 — forked from SoftCreatR/README.md
ImageMagick® 7 for Debian/Ubuntu
#!/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
@spvkgn
spvkgn / compton.service
Created May 2, 2018 09:35
systemd user units
[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