Skip to content

Instantly share code, notes, and snippets.

:octocat:
‏‏‎ Eating github stars for breakfast.

Andrzej Rehmann hoto

:octocat:
‏‏‎ Eating github stars for breakfast.
Block or report user

Report or block hoto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hoto
hoto / validate.sh
Created Aug 10, 2017 — forked from hrwgc/validate.sh
bash wget - check if file exists at url before downloading
View validate.sh
#!/bin/bash
# simple function to check http response code before downloading a remote file
# example usage:
# if `validate_url $url >/dev/null`; then dosomething; else echo "does not exist"; fi
function validate_url(){
if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then echo "true"; fi
}
@hoto
hoto / systemd-prblm.service
Created Jun 27, 2017 — forked from nickjacob/systemd-prblm.service
execute arbitrary bash code/variable substitution in systemd units
View systemd-prblm.service
[Unit]
Description=Demonstrate Bash
[Service]
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment MYVAR=$(( 2 + 2 ))"
ExecStart=/usr/bin/ech "2 + 2 = ${MYVAR}"
You can’t perform that action at this time.