Skip to content

Instantly share code, notes, and snippets.

@coresh
coresh / ioslocaleidentifiers.csv
Created September 18, 2019 17:24 — forked from jacobbubu/ioslocaleidentifiers.csv
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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)
@coresh
coresh / m2dump
Created September 10, 2019 14:33 — forked from yvoronoy/m2dump
Magento 2 Code and DB dumps
#!/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;
@coresh
coresh / setup-bridge.sh
Last active April 20, 2023 15:16 — forked from ismell/setup-bridge.sh
Scripts to re-create the docker0 bridge and setup a different ip subnet
#!/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
@coresh
coresh / generate-etcd-certs.sh
Created June 6, 2019 17:10 — forked from thojkooi/generate-etcd-certs.sh
Generate etcd certificates for kubeadm
#!/bin/bash
# First generate the config file
cat >ca-config.json <<EOF
{
"signing": {
"default": {
"expiry": "43800h"
},
"profiles": {
@coresh
coresh / kubernetes_commands.md
Created September 29, 2018 17:19 — forked from edsiper/kubernetes_commands.md
Kubernetes Useful Commands
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==
@coresh
coresh / mage2-multiweb-subdir.md
Created August 22, 2018 11:20 — forked from thagxt/mage2-multiweb-subdir.md
Set up Magento 2 multiple websites in sub directories

Set up Magento 2 multiple websites in sub directories

  1. Go to Admin > Stores > All Stores
  2. Click > Create Web Site
  3. In the Name field, enter store name.
    • e.g. Japan
  4. In the Code field, enter a unique string without spaces and > Save Web Site
    • e.g. super_jp
  5. Create Store
  6. Create Store View
@coresh
coresh / README.md
Created July 25, 2018 05:48 — forked from magnetikonline/README.md
Nginx FastCGI cache configuration example.

Nginx FastCGI cache

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
@coresh
coresh / redis-delkeys.sh
Created September 27, 2017 07:46 — forked from jdp/redis-delkeys.sh
Delete keys matching a pattern from Redis
#!/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"