Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
mr Marathi | |
bs Bosnian | |
ee_TG Ewe (Togo) | |
ms Malay | |
kam_KE Kamba (Kenya) | |
mt Maltese | |
ha Hausa | |
es_HN Spanish (Honduras) | |
ml_IN Malayalam (India) | |
ro_MD Romanian (Moldova) |
#!/usr/bin/env bash | |
function runCommand | |
{ | |
echo "${CMD}" | |
eval ${CMD}; | |
} | |
function getDb | |
{ | |
echo $(grep [\']db[\'] -A 20 app/etc/env.php | grep $1 | head -n1 | sed "s/.*[=][>][ ]*[']//" | sed "s/['][,]//"); | |
return 0; |
#!/bin/bash -e | |
IFADDR="192.168.3.1/24" | |
if [[ ! "$(ip link show docker0)" ]]; then | |
ip link add docker0 type bridge | |
ip addr add "$IFADDR" dev docker0 | |
ip link set docker0 up | |
iptables -t nat -A POSTROUTING -s "$IFADDR" ! -d "$IFADDR" -j MASQUERADE | |
fi |
#!/bin/bash | |
# First generate the config file | |
cat >ca-config.json <<EOF | |
{ | |
"signing": { | |
"default": { | |
"expiry": "43800h" | |
}, | |
"profiles": { |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
apiVersion: v1 | |
kind: PersistentVolume | |
metadata: | |
name: pv0001 | |
spec: | |
capacity: | |
storage: 1Gi | |
accessModes: | |
- ReadWriteOnce | |
hostPath: |
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: openstack-demo | |
namespace: default | |
type: "kubernetes.io/openstack" | |
data: | |
tenant-id: ZDI3ZGM1NzQxOGFlNGVlMmI3MTJmYTI5OTY1NGY0ZTc= | |
tenant-name: ZGVtbw== | |
username: ZGVtbw== |
Example /etc/nginx/nginx.conf
using FastCGI (e.g. to PHP-FPM) with FastCGI cache enabled. This will capture returned data and persist it to a disk based cache store for a configurable amount of time, great for robust full page caching.
Will need to create a directory to hold cache files, for the example given here that would be:
$ sudo mkdir -p /var/cache/nginxfastcgi
$ chown www-data: /var/cache/nginxfastcgi
#!/bin/sh | |
# | |
# Usage: ./redis-delkeys.sh [-h host] [-p port] [-n db] pattern | |
# | |
# Matches keys with the KEYS command matching pattern | |
# and deletes them from the specified Redis DB. | |
set -e | |
HOST="localhost" |