Skip to content

Instantly share code, notes, and snippets.

@johndiego
johndiego / install.sh
Created June 30, 2023 14:56 — forked from iul1an/install.sh
install k3s with cilium CNI
#!/bin/bash
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC='--flannel-backend=none --no-flannel' sh -s - \
--disable-network-policy \
--disable "servicelb" \
--disable "traefik" \
--disable "metrics-server"
sudo cat /etc/rancher/k3s/k3s.yaml > ~/.kube/config
kubectl create -f https://raw.githubusercontent.com/cilium/cilium/v1.7/install/kubernetes/quick-install.yaml
@johndiego
johndiego / dump-restore
Created October 12, 2022 03:30 — forked from ricjcosme/dump-restore
DUMP / RESTORE PostgreSQL Kubernetes
DUMP
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
kubectl exec [pod-name] -- bash -c "pg_dump -U [postgres-user] [database-name]" > database.sql
RESTORE
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
@johndiego
johndiego / wp-fix.sql
Created October 11, 2022 17:59 — forked from JPry/wp-fix.sql
Remove funky characters in WordPress database
update wp_posts set post_content = replace(post_content,'’','\'');
update wp_posts set post_title = replace(post_title,'’','\'');
update wp_comments set comment_content = replace(comment_content,'’','\'');
update wp_postmeta set meta_value = replace(meta_value,'’','\'');
update wp_posts set post_content = replace(post_content,'…','...');
update wp_posts set post_title = replace(post_title,'…','...');
update wp_comments set comment_content = replace(comment_content,'…','...');
update wp_postmeta set meta_value = replace(meta_value,'…','...');
@johndiego
johndiego / install-fs16.sh
Created August 8, 2022 13:29 — forked from areski/install-fs16.sh
Install FreeSWITCH 1.6
#!/bin/bash
#
FS_CONFIG_PATH=/etc/freeswitch
FS_CONF_PATH=/usr/src/newfies-dialer/install/freeswitch-conf
#Set branch to install develop / default: master
if [ -z "${INSTALL_FS}" ]; then
INSTALL_FS='yes'
fi
version: '3'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
networks:
- broker-kafka
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
@johndiego
johndiego / blinker_signal.py
Created November 11, 2020 02:35 — forked from doobeh/blinker_signal.py
Blinker/Signal Flask Example
from flask import Flask, current_app
from blinker import Namespace
app = Flask(__name__)
app.secret_key = 'WOO'
my_signals = Namespace()
def moo_signal(app, message, **extra):
@johndiego
johndiego / kube-registry.yaml
Created September 24, 2020 15:57 — forked from coco98/kube-registry.yaml
Docker registry on minikube
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-registry-v0
namespace: kube-system
labels:
k8s-app: kube-registry
version: v0
spec:
replicas: 1
version: '3.4'
services:
app:
image: voip_app:1.0
build:
context: .
dockerfile: Dockerfile
target: voip
tty: true
volumes:
@johndiego
johndiego / flask.py
Created April 10, 2020 01:59 — forked from kageurufu/flask.py
Flask-WTF FieldLists with Dynamic Entries
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.wtf import Form
from flask.ext.babel import gettext
from wtforms import SelectField, TelField, TextField, FormField, Fieldlist, SubmitField
from wtforms.validators import Optional, Required
app = Flask(__name__)
db = SQLAlchemy(app)
instalacao