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
@riskiwah
riskiwah / user_expired.yml
Created October 5, 2022 15:41
simple ansible playbook check user expired
---
- name: ansible user expired test
hosts: localhost
connection: local
become: yes
gather_facts: no
tasks:
- name: check user expire
shell: |
for user in $(cat /etc/passwd | cut -d: -f1)
[Unit]
Description=Files Cleaner
[Service]
Type=oneshot
ExecStart=/bin/echo "lets clean!"
# Dry run
ExecStart=/usr/bin/find /home/tarjow/ -type f -mtime +6 -exec echo rm {} \;
@riskiwah
riskiwah / ns-inet.sh
Created August 11, 2022 16:42 — forked from dpino/ns-inet.sh
Setup a network namespace with Internet access
#!/usr/bin/env bash
# set -x
if [[ $EUID -ne 0 ]]; then
echo "You must be root to run this script"
exit 1
fi
# Returns all available interfaces, except "lo" and "veth*".
@riskiwah
riskiwah / docker-compose.yaml
Created April 20, 2022 19:50
haproxxy dataplane api
---
version: '3.9'
services:
apps:
image: riskiwah/kustomize-poc:base
haproxy1:
image: haproxytech/haproxy-debian:2.0.28
ports:
- "8080:80"
@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:
@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 / 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.
#!/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 / 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"
}
@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"