This file contains hidden or 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
[Unit] | |
Description=JDownloader Headless | |
After=network.target | |
[Service] | |
Restart=on-failure | |
User=jdownloader | |
Group=jdownloader | |
LogsDirectory=jdownloader | |
StateDirectory=jdownloader |
This file contains hidden or 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 | |
function read { | |
declare -n var="${@: -1}" | |
case "$1" in | |
-Z) until [[ -n "$var" ]]; do | |
builtin read "${@:2}"; | |
done ;; | |
-D) until [[ "$var" =~ ^[0-9]+$ ]]; do | |
builtin read "${@:2}"; |
This file contains hidden or 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 bash | |
__iterate_on_args() { | |
for a; do echo "arg: $a"; done | |
} | |
__iterate_on_glob() { | |
#shopt -o nullglob | |
for f in *."${1:-sh}"; do | |
echo "file: $f" |
This file contains hidden or 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 -x | |
dir="$(mktemp -d)" | |
mkfifo "${fifo:=$dir/FIFO}" | |
inotifywait -m -e create $dir 1>$fifo 2>/dev/null & jobs %% | |
for i in {1..10}; do | |
( sleep 2; touch "$dir/$i" ) & |
This file contains hidden or 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 -x | |
function job { | |
: ${RANDOM:0:2} | |
sleep $_ && echo "Job $1 done in $_ sec" | |
} | |
for n in {1..12}; do | |
if [[ ${jobs:=0} -ge 3 ]]; then |
This file contains hidden or 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 bash | |
#set +x | |
# Create an array named as param ($1) or 'FOO' | |
# and fill it with random numbers without naming it | |
rand() { | |
declare -n ref="${1:-FOO}" | |
for i in {1..10}; do | |
ref[$i]=$RANDOM | |
done |
This file contains hidden or 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
function miio_request(from, method, req) | |
-- Disable buzzer when switch alarm type (issue #1279) | |
if from == 32 and method == "local.status" and req:find("alarm_long_one") then | |
return nil | |
end | |
end |
This file contains hidden or 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
# Setup FIFO | |
mkfifo ${f:=$(mktemp -u)} | |
trap "rm -f $f" EXIT | |
exec {fd}<>$f # Needed to enable FIFO |
This file contains hidden or 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
$TunnelName = "IPv6Tunnel" | |
$TunnelID = "123456" | |
$ServerIPv6Address = "2001:a:b:c::1" | |
$ServerIPv4Address = "200.1.2.3" | |
# When behind a firewall appliance that passes protocol 41, | |
# use the IPv4 address you get from your appliance's DHCP service | |
# instead of the IPv4 endpoint you provided to Tunnelbroker |
This file contains hidden or 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
# This is the main Samba configuration file. You should read the | |
# smb.conf(5) manual page in order to understand the options listed | |
# here. Samba has a huge number of configurable options (perhaps too | |
# many!) most of which are not shown in this example | |
# | |
# For a step to step guide on installing, configuring and using samba, | |
# read the Samba-HOWTO-Collection. This may be obtained from: | |
# http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf | |
# | |
# Many working examples of smb.conf files can be found in the |
OlderNewer