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 ( | |
"archive/tar" | |
"compress/gzip" | |
"io" | |
"os" | |
"path/filepath" | |
) |
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 -eu | |
INPUT="input.mp4" | |
OUTPUT="output.mp4" | |
W=1920 | |
H=1080 | |
OVERLAY_W=1080 # Increase this to remove the bottom part of the portrait recording | |
OVERLAY_X=$( | |
echo "(${W} - (${H} * ${OVERLAY_W} / ${W})) / 2" | bc | |
) |
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 -eu | |
: ${SCANNER:="brother4:bus9;dev1"} # My USB scanner | |
: ${OCR_LANG:=nld} # Tesseract language | |
: ${SCAN_DPI:=300} # A good resolution for OCR | |
: ${FINAL_RES:=1240x} # A good resolution for PDF | |
: ${SHOW:=0} # Show the result | |
: ${NICE:=10} # Priority of this process - this prevents Tesseract from hogging your machine | |
: ${UNPAPER:=1} # Whether to run unpaper | |
: ${FILENAME:=AUTO} # If no FILENAME is set, or set to 'AUTO': make one up based on time |
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 -eu | |
# Usage: scandoc [expected number of pages] | |
# Eg: | |
# scandoc 1 # Scan one page, then process | |
# scandoc 5 # Scan 5 pages, then process | |
# scandoc # Scan until page 99 or other action triggers end | |
# | |
# Description: | |
# Scandoc interactively scans a number (1 or more) of pages, runs |
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 -eu | |
COVERFILE=$(mktemp "coverXXX.out") | |
trap "{ rm -vf $COVERFILE; }" EXIT | |
DIR=${1:-./...} | |
case "${FULL:-no}" in | |
y*) | |
: ${REV:=} | |
: ${P:=--color=always} | |
;; |
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 -eu | |
# We don't need to switch if current signal has at least this this strength: | |
GOOD_ENOUGH=50 | |
# Signal to switch to, must at least have this strength: | |
BETTER=60 | |
# We use 'autoconnect' here, to later filter SSID's explicitly not | |
# configured as 'autoconnect'. | |
KNOWN_SSIDS=$(nmcli -g name,type,autoconnect connection show) |
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" | |
"os" | |
"strconv" | |
"syscall" | |
"time" | |
"github.com/dustin/go-humanize" |
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 ( | |
"io" | |
"log" | |
"net" | |
"os" | |
) | |
func main() { |
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 -e | |
yum -y install boost-devel zlib-devel openssl-devel libcurl-devel xml-security-c-devel gcc gcc-c++ make file wget httpd-devel unzip tar sed grep patch | |
( | |
if ! test -d log4shib-1.0.9; then | |
wget -c https://shibboleth.net/downloads/log4shib/latest/log4shib-1.0.9.tar.gz -O log4shib-1.0.9.tar.gz | |
tar xfz log4shib-1.0.9.tar.gz | |
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
#!/bin/bash -eu | |
url="$1" | |
output="$2" | |
base=$(dirname "$url") | |
chunklist=$(curl -s "$url" | grep "^chunklist") | |
if [[ -f "$output" ]] | |
then |
NewerOlder