Fix runtime/track length after using mp3wrap
# join files
mp3wrap "output.mp3" input*.mp3
# fix runtime
mp3val -f "output.mp3"
LOOK MOM! I'M A FAIL STÅCK DEVELOSAUR!
# join files
mp3wrap "output.mp3" input*.mp3
# fix runtime
mp3val -f "output.mp3"
update-alternatives --config gnome-www-browser
update-alternatives --config x-www-browser
Get current configuration:
update-alternatives --get-selections | grep browser
pdfjoin --paper a4paper --rotateoversize false <input.pdf>
As Android does not support OpenVPN out-of-the-box, I was searching for alternatives. It’s quite easy setting up an IPsec/L2TP PSK server, but a script collection by Lin Song (hwdsl2) makes it even easier: checkout setup-ipsec-vpn
.
pdfsandwich
is a handy tool developed by Tobias Elze for OCR’ing (via tesseract
) scanned documents. Recognized text is added as an background layer, making it possible to search and index scanned documents.
pdfsandwich -lang eng+deu scanned.pdf
xfce4-panel -r
rcvboxadd quicksetup all
Small bash script to apply a delay to MKV/eac3to chapter files (CHAPTERXX=
/CHAPTERXXNAME=
format):
#!/bin/bash
# usage: ./chapshift.sh "+0.792 seconds" < <input> > <output>
set -o errexit -o noclobber -o nounset -o pipefail
date_offset="$1"
apply_delay() {
date --date="$1 $date_offset" +%T,%N | cut -c 1-12
}
while read -r origline
do
line=`echo ${origline} | sed 's/\=/\=\ /g' | sed 's/\n//g'`
if [[ $line =~ ^CHAPTER[0-9][0-9]=\ [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9] ]]
then
read -r chapter start_date <<<"$line"
if [[ $start_date =~ 00:00:00.000.* ]]
then
new_start_date="00:00:00.000"
else
new_start_date="$(apply_delay "$start_date")"
fi
chapter=`echo ${chapter} | sed 's/=\ /=/g'`
new_start_date=`echo ${new_start_date} | sed 's/\,/\./g'`
printf "%s%s\n" "${chapter}" "$new_start_date"
else
printf "%s\n" "$origline"
fi
done
proxychains-ng enables you to easily route any program trough a proxy (chain) without the need to work yourself through tons of man pages and parameter lists.
git clone https://github.com/rofl0r/proxychains-ng.git
cd proxychains-ng/
./configure --prefix=/usr/
make
sudo make install
After installing you can either create a default config at /etc/proxychains.conf
or pass a custom location/file using -f <filename>
. A sample config is located at src/proxychains.conf
, which can be installed at the default location using sudo make install-config
.
strict_chain #chain proxies in the order as they appear in the list (all proxies must be online)
proxy_dns #proxy DNS requests
remote_dns_subnet 224 #subnet for internal remote DNS mapping
# Some timeouts in milliseconds (defaults)
tcp_read_time_out 15000
tcp_connect_time_out 8000
chain_len=1 # Chain length
[ProxyList]
socks5 127.0.0.1 1080 # shadowsocks
socks4 127.0.0.1 9050 # tor
http somehost 8080 <user> <password> # http
proxychains-ng
supports different chaining modes:
strict_chain
: use all proxies in the order they appear in the configdynamic_chain
: use all online proxies in the order they appearround_robin_chain
: proxy chain of online proxies with a length of chain_len
random_chain
: as the name says… random proxy chain with a length of chain_len
Using proxychains-ng
is as simple as:
proxychains4 wget <url>
proxychains4 -f <file.conf> ssh user@host
Sometimes you want to limit the number of times a script can run in parallel. You can do so by using lockfile
(part of procmail). For example: want to make sure a script only has one instance? Simply add
lockfile -r 0 "<lock file name>" || exit 1
to the start of your script. Retry count, sleep time, etc are configurable. The -!
flag inverts the exit status, making in possible to use lockfile
as break conditions in a while
loops with bash.