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/sh | |
# Print the current version number of Firefox for Desktop. | |
FIREFOX_RELEASE_FOLDER_URL='https://download-installer.cdn.mozilla.net/pub/firefox/releases/' | |
get_current_firefox_ver() | |
{ | |
elinks -dump 1 -no-numbering "${FIREFOX_RELEASE_FOLDER_URL}" | | |
grep -E '^ \. ' | |
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 | |
# Add supplementary group permissions and update the shell prompt. | |
# Requires adding the following to .bashrc after PS1 has been set: | |
# if [ -n "${PS1_PREFIX}" ] | |
# then | |
# export PS1="${PS1_PREFIX}${PS1}" | |
# unset PS1_PREFIX | |
# fi | |
declare newsubgrp="${1}" |
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
$ # Problem: | |
$ # * Official Debian GNU/Linux AMIs don't have gpg pre-installed. | |
$ # * We want to bootstrap a host using a salt-cloud deploy script. | |
$ # * This will add the key to the new host to add the Salt repository. | |
$ # * We cannot use apt-key so must add the gpg binary into trusted.conf.d | |
$ # directly. | |
$ # * We can base64 encode (base64 command is part of coreutils) | |
$ # but ideally won't store the key base64-encoded in pillar. | |
$ # Solution: | |
$ # A) Run `apt-get update`, install GnuPG, add the Salt repo key, |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline'; img-src * data: blob: 'unsafe-inline';" /> | |
<title>Local storage test</title> | |
</head> | |
<body> | |
<h1>This is a local storage test</h1> | |
<script src="localforage.min.js"></script> |
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
I am Dev | |
Dev I am | |
That Dev-I-am | |
That Dev-I-am! | |
I do not like | |
That Dev-I-am | |
Do you like | |
Malware and spam |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<h1>Help me, Arno-Wan Kenobi. You're my only hope.</h1> | |
</body> | |
</html> |
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 | |
# | |
# Find a specific version of a file in the current directory by | |
# searching back through Git commit history. The file version is | |
# identified by the MD5 checksum. | |
# | |
declare -r check_file="${1}" | |
declare -r target_hash="${2}" |
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 | |
exec {times}> times {typescript}> typescript < "${1-/dev/stdin}" | |
while read -r; do [[ $REPLY = ' "stdout": [' ]] && break; done # skip to this line | |
LANG=C | |
printf "Script started on %(%c)T\n" -1 >&"$typescript" # dummy | |
while read -r open; [[ $open = '[' ]]; do | |
read -r elapsed; read -r string; read -r close | |
eval printf %b%n "$string" characters >&"$typescript" # put count in $characters | |
printf "%s %s\n" "${elapsed%,}" "$characters" >&"$times" | |
done |
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 -e | |
# The tag name (or branch) of whatever you want to package. | |
declare -r tag="${1-v2017.7.5}" | |
declare -r pbuilder_target="${2-stretch}" | |
declare -r git_dir=./salt | |
# This makes no sense to me. Why are these different? | |
declare -r salt_upstream_version="${tag:1}" |
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 -e | |
# Copyright (c) 2017 Adam Bolte | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# You should have received a copy of the GNU General Public License | |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
NewerOlder