Skip to content

Instantly share code, notes, and snippets.

View janvojt's full-sized avatar

Jan Vojt janvojt

  • Zilina, Slovakia
View GitHub Profile
@janvojt
janvojt / manualduplex.sh
Last active January 26, 2017 14:06
Manual duplex printing wizard.
#!/bin/bash
#
# author: Jan Vojt
# number of pages
nop=
while ! [[ "$nop" =~ ^[0-9]+$ ]]; do
echo -n "Total number of pages in document: "
read nop
done;
@janvojt
janvojt / avi2mp4.sh
Last active December 18, 2015 16:38
Video converter for compressing large videos from camera to x264.
#!/bin/bash
# author: Jan Vojt
path="$1"
br="1200k"
res="1280x720"
vcodec="libx264"
if [ -z "$path" ]; then
echo "Please enter path as first argument."
@janvojt
janvojt / update-resolv-conf.sh
Created December 5, 2016 22:54
Script for updating DNS configuration after openvpn creates a new virtual network interface for forwarding traffic into VPN.
#!/bin/bash
#
# Parses DHCP options from openvpn to update resolv.conf
# To use set as 'up' and 'down' script in your openvpn *.conf:
# up /etc/openvpn/update-resolv-conf
# down /etc/openvpn/update-resolv-conf
#
# Used snippets of resolvconf script by Thomas Hood <jdthood@yahoo.co.uk>
# and Chris Hanson
# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL.
#!/bin/bash
#
# This script will compress videos from GoPro Hero 5 using h.265 codec.
USAGE="Usage: $0 file1 file2 ... fileN"
if [ "$#" == "0" ]; then
echo "$USAGE"
exit 1
fi
#!/bin/bash
CONF="$HOME/.lnd-backup.conf"
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "Create configuration file at '${CONF}' with the below variables:"
echo
echo "LND_PATH path to lnd configuration directory, can be absolute or relative to current working directory"
echo "REMOTE_PATH ssh-compatible specification to the directory where backup will be uploaded via scp"
echo "TMP_DIR temporary directory for caching encrypted files, will be created if it does not exist, e.g.: /tmp/backup-lnd"
.idea/
*.iml
*~