- Show table collation from a database:
show table status from <database>;
- Show collation from an entire database;
#!/bin/bash | |
# | |
# Source: http://serverfault.com/a/369430 | |
mysqlconn="mysql -u XXX -p XXX" | |
olddb=XXX | |
newdb=XXX | |
table_names=$($mysqlconn -N -e "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='${olddb}'") |
[Unit] | |
Description=Unicorn Server | |
Requires=redis.service | |
Wants=mysqld.service postgresql.service | |
After=redis.service mysqld.service postgresql.service | |
[Service] | |
Type=forking | |
User=netengine | |
WorkingDirectory=/var/www/unicorn/current |
[Unit] | |
Description=delayed_job | |
After=syslog.target | |
After=postgresql.service | |
[Service] | |
Type=forking | |
User=netengine | |
Environment=RAILS_ENV=production | |
WorkingDirectory=/var/www/unicorn/current |
[Unit] | |
Description=Puma Server | |
[Service] | |
Type=forking | |
User=netengine | |
WorkingDirectory=/var/www/puma/current | |
Environment=RAILS_ENV=staging | |
SyslogIdentifier=puma | |
PIDFile=/var/www/puma/current/tmp/pids/puma.pid |
# letsencrypt.service | |
[Unit] | |
Description=Renew Letsencrypt certificates | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/letsencrypt renew -n --no-self-upgrade | |
# letsencrypt.timer | |
[Unit] |
<!DOCTYPE html> | |
<head> | |
<title>autosizing</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<style> | |
div { border: 1px solid #aaa; } | |
.w70 { width: 70%; } | |
.w20 { width: 20%; } | |
</style> | |
</head> |
# If a second instance of this script starts, it won't run the command and exit with 1. | |
flock -n /tmp/.process-name.lock <long command with args here> |
SELECT | |
table_name AS `Table`, | |
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` | |
FROM information_schema.TABLES | |
WHERE table_schema = "$DB_NAME" | |
AND table_name = "$TABLE_NAME"; |
function (user, context, callback) { | |
var namespace = 'https://example.com/'; | |
context.idToken[namespace + 'first_name'] = user.user_metadata.first_name; | |
context.idToken[namespace + 'last_name'] = user.user_metadata.last_name; | |
context.idToken[namespace + 'mobile_number'] = user.user_metadata.mobile_number; | |
context.idToken[namespace + 'organizations_name'] = user.user_metadata.organizations_name; | |
callback(null, user, context); | |
} |