Skip to content

Instantly share code, notes, and snippets.

View purwandi's full-sized avatar
🏠
Working from home

purwandi purwandi

🏠
Working from home
View GitHub Profile
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",

Useful Postgres Commands

1. Determine disk usage of a particular table/database

For a particular table,

SELECT pg_size_pretty( pg_total_relation_size('tablename') );
{
"ignition": {
"version": "3.3.0"
},
"passwd": {
"users": [
{
"groups": [
"wheel",
"sudo",
@purwandi
purwandi / packer-build.json
Created January 8, 2023 11:04 — forked from charandas/packer-build.json
coreos container linux OVA generation using Packer
{
"variables": {
"name": "coreos-baseimage",
"release": "stable",
"iso_checksum": "",
"iso_checksum_type": "none",
"disk_size": "40000",
"cpus": "4",
"memory": "2048",
"boot_wait": "15s",
cat > grub <<'EOF'
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
EOF
sudo mv grub /etc/default/grub
@purwandi
purwandi / docker-compose.yaml
Created August 26, 2022 09:48
Elasticsearch master and data node
version: '3'
services:
elasticsearch-mastera:
image: elasticsearch:7.17.6
container_name: elastic-mastera
restart: always
environment:
ES_JAVA_OPTS: "-Xmx1G -Xms1G"
cluster.name: elastic-cluster
version: '3'
services:
monitor:
build: .
environment:
PGPORT: 5432
command: pg_autoctl create monitor --hostname monitor --ssl-self-signed --auth trust --run
ports:
- 5000:5000
@purwandi
purwandi / eventbus.yaml
Last active June 30, 2021 03:56
ArgoCD Workflow
apiVersion: argoproj.io/v1alpha1
kind: EventBus
metadata:
name: default
namespace: optimus
spec:
nats:
native:
# Optional, defaults to 3. If it is < 3, set it to 3, that is the minimal requirement.
replicas: 3
@purwandi
purwandi / application.yaml
Last active June 21, 2021 02:07
Argo Continuos Deployment (ARGOCD)
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argocd-git
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
@purwandi
purwandi / docker-compose.yaml
Last active June 17, 2021 14:39
Jenkins Nexus
version: '3'
services:
nexus:
image: sonatype/nexus3
volumes:
- ./storage-nexus:/nexus-data
ports:
- 8081:8081
- 8082:8082 # docker proxy
- 8083:8083 # docker hosted