This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# Generate SystemD .network files for network interface automatically | |
# (c) Pekka Järvinen 2019- | |
# Check that there are arguments given | |
if [ "$#" -eq 0 ]; then | |
echo "No arguments were given. See $0 --help or $0 -h for usage instructions." 1>&2 | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Pekka Järvinen | |
# FreeBSD's pkg git (source) version | |
# Intended use is for building FreeBSD binary packages on Arch Linux with: | |
# % pkg create --format txz --root-dir $(PWD) --manifest manifest.sh | |
pkgname=freebsd-pkg-git | |
pkgver=1 | |
pkgrel=1 | |
pkgdesc="FreeBSD pkg from source (for building FreeBSD packages on Linux)" | |
url="https://github.com/freebsd/pkg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"strings" | |
) | |
func main() { | |
b, _ := ioutil.ReadFile(`/proc/sys/kernel/random/uuid`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Cut a part of a video with FFMPEG | |
if [[ $# -eq 0 ]] ; then | |
echo "Usage:" | |
echo " $0 <filename> <start position timestamp> <duration> [additional params]" | |
echo "" | |
echo "Example:" | |
echo " Cut 50 seconds starting from timestamp 01:23:45 from file myvid.mp4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fetch system specific information | |
# -- Get Operating system name such as "Win 10 Pro" | |
$replaceTable = @{ | |
"Microsoft" = "" | |
"Windows" = "Win" | |
"Professional" = "Pro" | |
"Ultimate" = "Ult" | |
"Enterprise" = "Ent" | |
"Edition" = "Ed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# IP address range to CIDR | |
import sys | |
import ipaddress | |
if (len(sys.argv) - 1) != 2: | |
print("Usage: ") | |
print(f" {sys.argv[0]} <ip address> <ip address>") | |
print("Example: ") | |
print(f" {sys.argv[0]} 192.168.0.0 192.168.0.255") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# systemctl --user enable murmur | |
# systemctl --user start murmur | |
# .config/systemd/user/murmur.service : | |
[Unit] | |
Description=Mumble Daemon | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/murmurd -ini murmur.ini -fg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Usage: | |
$ php dump.php "SELECT * FROM mytable" > mytable.json | |
*/ | |
error_reporting(E_ALL | E_STRICT); | |
ini_set('display_startup_errors', 1); | |
ini_set('display_errors', 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
set -o pipefail | |
DEST=127.0.0.1 | |
# this adjusts the latency in the receiver | |
LATENCY=0 | |
VIDEO_CAPS="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find . -maxdepth 1 -type f -iname "*.pdf" -exec gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dDownsampleColorImages=true -dColorImageResolution=150 -dNOPAUSE -dBATCH -sOutputFile={}.new.pdf {} \; |