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
#!/usr/bin/env python | |
# coding=utf8 | |
# Copyright (C) 2010 Saúl ibarra Corretgé <saghul@gmail.com> | |
# | |
""" | |
pydmesg: dmesg with human-readable timestamps | |
""" |
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
#!/usr/bin/env bash | |
DATABASE_CONTAINER="dev-db" | |
WEBSERVER_CONTAINER="dev-web" | |
MYSQL_ROOT_PASSWORD="my-secret" | |
MYSQL_USER="dev" | |
MYSQL_PASSWORD="dev" | |
MYSQL_DATABASE="wordpress" | |
docker pull wordpress:latest | |
docker pull mysql:${MYSQL_VERSION} |
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
. | |
├── env | |
│ ├── config | |
│ │ ├── 01production_dump.sql | |
│ │ ├── 02update-development-site.sh.sh | |
│ │ └── php.ini-development | |
│ └── dev-env.sh | |
└── src | |
└── wp-content | |
├── plugins |
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
#!/usr/bin/env bash | |
cmd="mysql -u ${MYSQL_USER} --password=${MYSQL_PASSWORD} ${MYSQL_DATABASE} -e" | |
table_prefix=$($cmd "show tables;" -N -B 2>/dev/null | tail -1 | awk -F\_ '{print $1}') | |
$cmd "update ${table_prefix}_options set option_value = 'http://localhost' where option_name in ('siteurl', 'home');" 2>/dev/null |
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
#!/usr/bin/env bash | |
commit_message=$1 | |
commit_type=$2 | |
commit_hash=$3 | |
prefix="[commit prefix]" | |
heading=$(head -1 ${commit_message}) | |
if [ -z "${heading}" ] |
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
#!/usr/bin/env bash | |
DICTIONARY="/tmp/diceware.lst" | |
DICTIONARY_URL="http://world.std.com/~reinhold/diceware.wordlist.asc" | |
WORDS="3" | |
COUNT="1" | |
SEPARATOR="-" | |
while getopts ":w:n:s:" optchar; do | |
case "${optchar}" in | |
w) |
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
.PHONY = all install reinstall uninstall test _wrapped_stow _pre_stow _stow _post_stow _stow_ignore _install_args _reinstall_args _uninstall_args _test_args | |
all: | |
$(error You probably want to run 'make test' first) | |
_stow_ignore: | |
$(foreach file,$(wildcard *),$(eval ARGS += --ignore=$(file))) | |
_stow: _stow_ignore | |
@stow -t $(HOME) -v $(ARGS) . |
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
#!/usr/bin/env bash | |
wifi_interface="$(nmcli d | awk '$2 ~ /wifi/ {print $1}')" | |
description="${1:-${wifi_interface}}" | |
sudo true | |
samples=10 | |
sequences=($(seq 1 ${samples})) |
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
cat > /etc/systemd/network/10-wifi.link <<EOF | |
[Match] | |
MACAddress=<wifi mac> | |
[Link] | |
Name=wifi0 | |
EOF | |
cat > /etc/systemd/network/10-usb.link <<EOF | |
[Match] | |
MACAddress=<usb mac> |
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
test_unicode() { | |
echo -ne "\xe2\x88\xb4\033[6n\033[1K\r" | |
# shellcheck disable=SC2034 | |
read -d R foo | |
echo -ne "\033[1K\r" | |
echo -e "${foo}" | cut -d \[ -f 2 | cut -d";" -f 2 | ( | |
read UNICODE | |
[[ $UNICODE -eq 2 ]] | |
) 2>/dev/null | |
} |
OlderNewer