Skip to content

Instantly share code, notes, and snippets.

View riskiwah's full-sized avatar
🐻
Nothing to do

riskiwah

🐻
Nothing to do
View GitHub Profile
kind: Service
apiVersion: v1
metadata:
name: nginx-debug-svc
spec:
selector:
app: nginx-debug
type: ClusterIP
ports:
- name: http
#! /bin/bash
# Change repo
sudo sed -i "s*es.archive.ubuntu.com*kartolo.sby.datautama.net.id*g" /etc/apt/sources.list
# Change default pass
sudo passwd osboxes
#!/usr/bin/env bash
for f in /etc/apt/sources.list.d/*.list; do
grep -Po "(?<=^deb\s).*?(?=#|$)" "$f" | while read -r ENTRY ; do
echo "ENTRY: $ENTRY"
HOST=$(cut -d/ -f3 <<< "$ENTRY")
if [ "ppa.launchpad.net" = "$HOST" ]; then
USER=$(cut -d/ -f4 <<< "$ENTRY")
PPA=$(cut -d/ -f5 <<< "$ENTRY")
packageCount=$(awk '$1=="Package:" {if (a[$2]++ == 0) {system("dpkg -l "$2)}}' /var/lib/apt/lists/*"$USER"*"$PPA"*Packages 2>/dev/null | awk '/^ii/' | wc -l)

Docker-wordpress

Task

  • Deploy wordpress on docker as the company looking for modern tech & portable stack
  • Please mind on how to scale the platform if the user/viewer of the content growing

Method

  • Using docker-compose for handle deployment.
  • Use volume persistent as part portable stack like ./html:/var/www/html at wordpress services.
  • For scaling purpose, can do it with docker-compose up --scale wordpress=4
@riskiwah
riskiwah / config-kind.yaml
Last active December 10, 2020 10:56
Daily-k8s-dev
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
@riskiwah
riskiwah / gcp-stats.sh
Created February 18, 2021 03:09 — forked from kszarek/gcp-stats.sh
Bash script to get VM count and disk volume sizes from GCP projects
#!/usr/bin/env bash
envs='airhelp-staging airhelp-production ah-test-174206'
get_vm_count(){
ENV_NAME="$1"
count=$(gcloud --project="$ENV_NAME" compute instances list|grep -v NAME -c)
echo "VM count for $ENV_NAME: $count"
}
#!/bin/sh
set -e
function help () {
cat <<EOF >&2
Run script via curl:
sh -c "\$(curl -s https://gitlab.com/romanilin/alis/-/raw/main/install.sh)"
or equivalently:
sh -c "\$(curl -sL https://v.gd/alisa)"
or run version from development branch:
sh -c "\$(curl -s https://gitlab.com/romanilin/alis/-/raw/dev/install.sh)"
@riskiwah
riskiwah / build_nginx_with_lua.sh
Last active March 20, 2025 05:33 — forked from kanna5/build_nginx_with_lua.sh
A simple script to build nginx with lua support
#!/bin/sh
# Script to build nginx with lua support.
NGINX_VERSION='1.18.0'
NGX_DEVEL_KIT_VERSION='0.3.1'
LUA_NGINX_MODULE_VERSION='0.10.16rc5'
STREAM_LUA_NGINX_MODULE_VERSION='0.0.8rc3'
# we use openresty's version of luajit here.
@riskiwah
riskiwah / docker-compose.yml
Created December 22, 2021 15:11
secret-stack-dev
version: '3'
services:
redis:
image: redis:alpine
hostname: redis
ports:
- "6379:6379"
postgres:
image: postgres:9.6.23-alpine3.14
hostname: postgres
@riskiwah
riskiwah / 0_drone_minio_gitea_local.md
Created April 10, 2022 17:31 — forked from ruanbekker/0_drone_minio_gitea_local.md
Drone, Minio, Gitea, Sqlite on Docker Compose
  • docker-compose.yml
version: '3.6'

services:
  minio:
    image: minio/minio:RELEASE.2020-01-03T19-12-21Z
    container_name: minio
    volumes: