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
# Usual build | |
docker build --rm -t mmage/db . | |
# Create a container to hold a volume but don't run as daemon | |
docker run --name=mmage_db_data -v /var/lib/mysql mmage/db true | |
# Initialize data from previous volume using an intermediate container | |
# and kill it immediately after (no daemon) | |
docker run --rm --volumes-from=mmage_db_data mmage/db /config_mariadb.sh |
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 | |
if [ "$1" == "" ]; then | |
echo "Usage: script <css|js|php|etc> <str>" | |
exit 1 | |
fi | |
if [ "$2" == "" ]; then | |
echo "Usage: script <css|js|php|etc> <str>" | |
exit 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/sh | |
if [ "$1" == "" ]; then | |
echo "Usage: pkgfind <package-name>" | |
exit 1 | |
fi | |
ls /var/log/packages | grep "$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 | |
# Excludes local hostnames/machines from proxy, ex: localhost, *.dev, 192.168.1.160 | |
# To resolve to 192.168.1.160, we need to define the host resolver mapping | |
# Where *.dev resolves to 192.168.1.160 - it is a vagrant box by the way | |
google-chrome-stable --proxy-server="socks5://127.0.0.1:8888" --host-resolver-rules="MAP *.dev 192.168.1.160, MAP * ~NOTFOUND , EXCLUDE 127.0.0.1, EXCLUDE 192.168.1.160, EXCLUDE *.dev, EXCLUDE localhost" --proxy-bypass-list="127.0.0.1;localhost;localhost:8080;192.168.1.160,*.dev" |
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 | |
rsync -rvz --delete rsync://slackware.osuosl.org/slackware/slackware-current/ /zdata/Downloads/slackware-current/ |
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
SELECT CONCAT(table_schema, '.', table_name), | |
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, | |
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
ROUND(index_length / data_length, 2) idxfrac | |
FROM information_schema.TABLES | |
ORDER BY data_length + index_length DESC | |
LIMIT 10; |
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
DELETE FROM elgg_metastrings WHERE id NOT IN( | |
SELECT DISTINCT(name_id) FROM elgg_metadata | |
UNION | |
SELECT DISTINCT(value_id) FROM elgg_metadata) AND id NOT IN( | |
SELECT DISTINCT(name_id) FROM elgg_annotations | |
UNION SELECT DISTINCT(value_id) | |
FROM elgg_annotations | |
); |
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
SELECT table_schema "DB Name", | |
Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" | |
FROM information_schema.tables | |
GROUP BY table_schema; |
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
curl --verbose -H "X-API-KEY: 8888888888888888888888888888888888888888" -d "username=foo&password=bar" https://magicservice.com/api/derp/register |
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
openssl genrsa 2048 > host.key | |
openssl req -new -x509 -nodes -sha1 -days 3650 -key host.key > host.cert | |
#[enter domain.com for the Common Name] | |
openssl x509 -noout -fingerprint -text < host.cert > host.info | |
cat host.cert host.key > host.pem | |
chmod 400 host.key host.pem |