https://github.com/phpenv/phpenv
brew install \
autoconf \
bzip2 \
# Context: | |
# make sure the URL is valid, and Docker 18.09 or later is installed on the remote host. | |
# zsh:1: command not found: docker | |
# Add /usr/local/bin to PATH for SSH session | |
echo 'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin' >> ~/.ssh/environment | |
# Permit set user environment for SSH session | |
sudo sh -c 'echo "PermitUserEnvironment PATH" >> /private/etc/ssh/sshd_config' |
colors: | |
# Default colors | |
primary: | |
background: '0x1e2127' | |
foreground: '0xabb2bf' | |
# Bright and dim foreground colors | |
# | |
# The dimmed foreground color is calculated automatically if it is not present. |
/** | |
* Find the amount of auto-increment "space" has been used. This may can help identify | |
* tables that are running out of available ID values. | |
*/ | |
SELECT | |
t.table_name, | |
t.column_name, | |
-- The highest possible ID that can be created with this data-type. | |
t.max_value, | |
-- The last ID created in this table. |
// Database Information about RDS instance | |
type Database struct { | |
// Database identifier | |
Identifier string | |
// Database ARN | |
Arn string | |
// Database engine (mysql2, postgres, etc.) | |
Engine string | |
// Database engine version | |
EngineVersion string |
#!/bin/sh | |
# you might want to add some user authentication here | |
mysql -e "show variables; show status" | awk ' | |
{ | |
VAR[$1]=$2 | |
} | |
END { | |
MAX_CONN = VAR["max_connections"] | |
MAX_USED_CONN = VAR["Max_used_connections"] | |
BASE_MEM=VAR["key_buffer_size"] + VAR["query_cache_size"] + VAR["innodb_buffer_pool_size"] + VAR["innodb_additional_mem_pool_size"] + VAR["innodb_log_buffer_size"] |
https://github.com/phpenv/phpenv
brew install \
autoconf \
bzip2 \
-- Thank @sbengo to figure out foreign_keys constraints is defaults to false in sqlite | |
-- Enable to delete logs by cascading delete | |
PRAGMA foreign_keys = ON; | |
WITH n_build_ids_per_repo as ( | |
SELECT build_id | |
FROM ( | |
SELECT | |
build_id, | |
build_repo_id, |
# systemd unit file | |
# /etc/systemd/system/run-before-shutdown.service | |
# TimeoutStartSec - set a timeout for your task or set "0" to disable. | |
# When the timeout is turned off and the task "hangs", | |
# the process will never be interrupted and the system | |
# shutdown will stop | |
# Before - Specify the services before which the task should run | |
# after add unit file in systemd/system catalogue, "run systemctl daemon-reload" | |
# and enable new service "systemctl enable run-before-shutdown.service" |
package main | |
import ( | |
"bytes" | |
"encoding/base64" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" |
# .cron_env | |
# Save to /root directory, chmod 400/600 | |
export DB_HOST="127.0.0.1" | |
export DB_USER="postgres" | |
export DB_PASSWORD="postgres" | |
# cron | |
59 23 * * * . /root/.cron_env; /usr/bin/psql_super_puper.sh $DB_USER $DB_PASSWORD $DB_HOST "select * from ololo" |