Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am svmt on github.
  • I am svmashtaler (https://keybase.io/svmashtaler) on keybase.
  • I have a public key ASCsF_qZwdfsBDGA3M4YR5Sz03D0KkB4kuviFbV28ShyJwo

To claim this, I am signing this object:

apiVersion: v1
kind: Secret
metadata:
name: my-secret
type: Opaque
stringData:
user: 'root'
password: 'toor'
@svmt
svmt / haproxy.cfg
Created May 28, 2020 13:26 — forked from arkady-emelyanov/haproxy.cfg
haproxy check: postgresql is master
# Sample haproxy postgresql master check
#
# haproxy listen: 5431
# pg, instance #1 listen: 5432 (master node)
# pg, instance #2 listen: 5433 (replica node)
# external failover, promoting replica to master in case of failure
# passwordless auth for user web
# template1 database is accessible by user web
#
# haproxy will pass connection to postgresql master node:
NORMAL="\[\033[0m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
YELLOW="\[\033[0;33m\]"
# Swith K8S config
function kx() {
if [[ ! -f ~/.kube/$1 ]]; then
apiVersion: v1
kind: Pod
metadata:
name: nodehelloworld.example.com
labels:
app: helloworld
spec:
containers:
- name: k8s-demo
image: wardviaene/k8s-demo
wmic path softwarelicensingservice get OA3xOriginalProductKey
Using dig with OpenDNS as resolver:
dig +short myip.opendns.com @resolver1.opendns.com
Perhaps alias it in your bashrc so it's easy to remember
alias wanip='dig +short myip.opendns.com @resolver1.opendns.com'
Responds with a plain ip address:
$ wanip
80.100.192.168
@svmt
svmt / gist:beffe00d4e26b530f4f34ec63f05f39d
Created June 16, 2017 06:52
Magento PHP requirements
PHP Extension curl.
PHP Extension dom.
PHP Extension mcrypt.
PHP Extension simplexml.
PHP Extension spl.
PHP Extension xsl.
PHP Extension intl.
PHP Extension mbstring.
PHP Extension ctype.
PHP Extension hash.
@svmt
svmt / php_function_disable
Last active October 20, 2016 15:06
List of potentially dangerous functions
disable_functions = dl, exec, shell_exec, system, passthru, popen, pclose, proc_open, proc_nice, proc_terminate,
proc_get_status, proc_close, pfsockopen, leak, apache_child_terminate, posix_kill, posix_mkfifo,
posix_setpgid, posix_setsid, posix_setuid
Extra INFO
# Command Execution
exec - Returns last line of commands output
passthru - Passes commands output directly to the browser
system - Passes commands output directly to the browser and returns last line