https://github.com/phpenv/phpenv
brew install \
autoconf \
bzip2 \
// 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" |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"github.com/julienschmidt/httprouter" | |
) | |
func main() { |
// config/initializers/appconfig.rb | |
APP_CONFIG = YAML.load_file(Rails.root.join('config/app_config.yml'))[Rails.env] |
mplayer -ao null out.ogv -vo jpeg:outdir=output | |
convert output/* output.gif | |
convert output.gif -fuzz 10% -layers Optimize optimised.gif |