Skip to content

Instantly share code, notes, and snippets.

@bse666
bse666 / ffmpeg-file-merger.md
Created October 24, 2022 12:38
How to merge movies with ffmpeg fast.

ffmpeg File merging:

##Create File List

echo file file1.mp4 >  mylist.txt 
echo file file2.mp4 >> mylist.txt
echo file file3.mp4 >> mylist.txt

Concatenate Files

I had problems with drifting in PC2 as opposed to Assetto corsa. These settings solved the issue for me hope it helps
In Profiler:
Gain 107%
Spring:0
Damper:0
Disable Centering spring!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
720 Deg
In game: RAW
Gain: 80
Volume 25-35 ( depending on the car)
@bse666
bse666 / minetest
Created April 16, 2020 17:55
minetest jail startupscript
# REQUIRE: LOGIN
# KEYWORD: shutdown
# FILE: /usr/local/etc/rc.d/minetest
# Add the following line to /etc/rc.conf[.local] to enable minetest server
#
# minetest_enable (bool): Set to "NO" by default
# Set it to "YES" to enable minetest server
# minetest_conffile (str): Path to config file (required).
# (default: /usr/local/etc/minetest.conf)
# minetest_rundir (str): Path to directory holding a pidfile.
@bse666
bse666 / sndswitcher.sh
Created April 3, 2020 19:22
Pulseaudio Soundcard Switcher
#!/bin/bash
outputsinks=$(pacmd list-sinks | grep index | awk '{print $NF}')
defaultsink=$(pacmd list-sinks | grep index | grep \* | awk '{print $NF}'| tr -d "[[:space:]]")
for i in ${outputsinks[@]/$defaultsink/};
do
newOutputIndex=$i
done
@bse666
bse666 / rip_dvd
Created December 8, 2019 19:08 — forked from postmodern/rip_dvd
Script to automate ripping DVDs using Handbrake-CLI and mkvmerge
#!/usr/bin/env bash
#
# Author: postmodern
# Description:
# Rips a DVD to a H.264 MKV file, with chapters and tags. Ignores any
# bad blocks or sectors on the DVD.
# Dependencies:
# * gddrescue
# * handbrake-cli
# * mkvtoolnix
@bse666
bse666 / mpc_add
Last active May 5, 2019 20:45
add random song from mpd
#!/bin/bash
# stdin check
if (( "$#" < 2 )); then
echo "Usage: `basename $0` HOSTNAME MIN_PLAYLIST_LENGTH PLAYLIST [NEXT_ON_ERROR (y/N)]"
exit 65
fi
# variables
host=$1
@bse666
bse666 / k8s-pi.md
Created June 14, 2018 19:43 — forked from alexellis/k8s-pi.md
K8s on Raspbian

Kubernetes on (vanilla) Raspbian Lite

Yes - you can create a Kubernetes cluster with Raspberry Pis with the default operating system called Raspbian. This means you can carry on using all the tools and packages you're used to with the officially-supported OS.

Pre-reqs:

  • You must use an RPi 2 or 3 for use with Kubernetes
  • I'm assuming you're using wired ethernet (Wi-Fi also works, but it's not recommended)

Master node setup

@bse666
bse666 / tinc-conf.sh
Created May 8, 2018 22:25
tinc in jail
#!/bin/sh
# Jails in Freenas use a tun Device for each Restart.
# This script gets the actual Device and sets it in the tinc config
# Edit NETWORKNAME to match your's.
TUN_DEVICE="/dev/`ifconfig | grep tun | awk '{print $1}' | sed s/://g`"
sed -i .orig "s#Device.*#Device = $TUN_DEVICE#" /usr/local/etc/tinc/NETWORKNAME/tinc.conf
@bse666
bse666 / pdf_shrink.sh
Created April 16, 2018 21:20
shrink_your_pdf's
#!/bin/sh
# Settings for PDF
# /screen screen-view-only quality, 72 dpi images
# /ebook low quality, 150 dpi images
# /printer high quality, 300 dpi images
# /prepress high quality, color preserving, 300 dpi imgs
# /default almost identical to /screen
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=$1-shrunk.pdf $1
@bse666
bse666 / crop-it.sh
Created April 15, 2018 20:38
video-crop
# get the coordinates with some mplayer script
# ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4
ffmpeg -i "$1" -vf crop=695:395:530:260 "$1"-cropped.mkv