Skip to content

Instantly share code, notes, and snippets.

# patch the server string away
perl -pi -e 's/nginx\/1\.16\.1/xxxxx\/0\.00\.0/g' /sbin/nginx
%global _hardened_build 1
%global debug_package %{nil}
# https://github.com/varnishcache/varnish-cache/issues/2269
%global _use_internal_dependency_generator 0
%global __find_provides %{_builddir}/%{name}-%{version}/find-provides %__find_provides
# Package scripts are now external
# https://github.com/varnishcache/pkg-varnish-cache
%global commit1 ef90bd19d04bd31a10d58ba4c12a78495c3c3bc5
%global shortcommit1 %(c=%{commit1}; echo ${c:0:7})
@borisisok
borisisok / dnf.sh
Last active October 18, 2019 15:48
Centos 8 - rebuild rpm packages using dnf
# prepare builds
dnf install mock
adduser mockbuild
usermod -a -G mock mockbuild
# rebuild collectd
dnf install epel-release
dnf config-manager --set-enabled PowerTools
@borisisok
borisisok / siridb.sh
Created October 17, 2019 12:48
SiriDB first steps
# default credentials and account
/siridb-admin_1.2.0.bin -u sa -p siri get-accounts
@borisisok
borisisok / sshfs.bat
Created October 13, 2019 06:55
SSHFS for Windows
# 1) install https://github.com/billziss-gh/winfsp
# 2) install https://github.com/billziss-gh/sshfs-win
# 3) mount remote host now
net use X: \\sshfs\pi@172.16.2.251
@borisisok
borisisok / goodby-world.spec
Last active September 9, 2019 08:05
rpm trigger processing example
Name: goodby-world
Version: 1
Release: 1
Summary: Next to most simple RPM package
License: FIXME
%description
This is my second RPM package, which does nothing.
%prep
@borisisok
borisisok / mockbuild.sh
Last active June 17, 2020 14:58
Rebuild varnish-6.2.0 Centos7 rpm packages with the help of mock.
yum -y install mock
adduser mockbuild
usermod -a -G mock mockbuild
su - mockbuild
mock -r epel-7-x86_64 --init
wget https://packagecloud.io/varnishcache/varnish62/el/7/SRPMS/varnish-6.2.0-1.el7.src.rpm
# rebuild without modification
mock -r epel-7-x86_64 --target=x86_64 \
@borisisok
borisisok / bash_lib_video.sh
Last active June 1, 2022 19:22
Bash functions for movie processing
function ffmpeg_c112 { # create content for acer c112 pico beamer
m=$(dirname "$1")
n=$(basename "$1" | sed 's/mp4$//')
dir=/run/media/bgom/FCA7-F289/avi.c112
ffmpeg -i "${m}/${n}mp4" -c:v libx264 -profile:v baseline -c:a libmp3lame -b:a 128k -vf scale=720:406 -r 30 -pix_fmt yuv420p -ar 44100 "${dir}/${n}avi"
}
@borisisok
borisisok / mirabox_rec_ffmpgeg.sh
Last active April 6, 2022 19:36
Mirabox - Record via ffmpeg
# The Linux version
VDEV=$(v4l2-ctl --list-devices | grep -A1 -i mirabo | grep /dev | sed 's/\s//g')
ADEV=$(grep "Capture.*Mira" /proc/asound/cards | cut -f2 -d" ")
TS=$(date +%Y%m%d_%H%M%S)
nohup ffmpeg -f alsa -ac 2 -i hw:${ADEV=},0 -f video4linux2 -i ${VDEV} -acodec ac3 -ab 128k -f matroska -movflags frag_keyframe -s 1920x1080 -vcodec libx264 -preset ultrafast -qp 16 ${TS}.mkv &
sleep 5;
vlc ${TS}.mkv
killall ffmpeg
echo ${TS}.mkv
@borisisok
borisisok / nanoKONTROL.control.js
Created December 10, 2018 01:14
bitwig / custom controller scripts
loadAPI(7);
host.defineController("Korg", "nanoKONTROL", "1.22", "E74ABCE1-7BA8-4526-A769-25A7E1F8212F");
host.defineMidiPorts(1, 1);
var ECHO_ID = "12";
host.addDeviceNameBasedDiscoveryPair(["nanoKONTROL"], ["nanoKONTROL"]);
var SYSEX_HEADER = "F0 42 40 00 01 04 00";
var CC =