Skip to content

Instantly share code, notes, and snippets.

View audacioustux's full-sized avatar
🐧

Tanjim Hossain audacioustux

🐧
View GitHub Profile

/etc/systemd/system/ssh_watchdog.service
/usr/local/bin/ssh_watchdog.sh

x-postgres-environment: &postgres-environment
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
# POSTGRES_DB: ${POSTGRES_DB:-postgres}
POSTGRESQL_REPLICATION_USER: ${POSTGRESQL_REPLICATION_USER:-replicator}
POSTGRESQL_REPLICATION_PASSWORD: ${POSTGRESQL_REPLICATION_PASSWORD:-replicator}
POSTGRESQL_LOG_HOSTNAME: ${POSTGRESQL_LOG_HOSTNAME:-true}
x-postgres-healthcheck: &postgres-healthcheck
test: [ "CMD", "pg_isready", "-U", "postgres" ]
interval: 5s
#!/bin/bash
cd /tmp
wget https://amazoncloudwatch-agent.s3.amazonaws.com/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb
sudo dpkg -i -E ./amazon-cloudwatch-agent.deb
echo '{
"agent": {
"metrics_collection_interval": 60,
"run_as_user": "cwagent"
},
#!/bin/bash
# Function to create swap files
create_swap_files() {
local count=$1
local swap_directory=${2:-/var/}
local swap_file_prefix="swapfile"
for ((i=1; i<=count; i++)); do
swap_file="${swap_directory}/${swap_file_prefix}${i}"
git diff --word-diff
git config --global rerere.enabled true
git config --global rerere.autoUpdate true
git config --global branch.sort -committerdate
git config --global column.ui auto
git push --force-with-lease
@audacioustux
audacioustux / ca-issuer.yaml
Last active December 30, 2023 12:37
open Edx configs
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: self-signed
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
@audacioustux
audacioustux / main.rs
Last active December 15, 2023 19:57
ec billing - initial draft
use std::{any::Any, collections::HashMap, net::SocketAddr, ops::Range, sync::Arc, time::Duration};
use anyhow::{anyhow, bail, Error, Result};
use axum::{
// debug_handler,
extract::{FromRef, Path, State},
http::{header::HeaderMap, StatusCode},
routing::{get, post},
Json,
Router,
version: "3"
tasks:
default: task --list-all
# provision
prod:up: INFRA=prod bin/up.sh
dev:up: bin/up.sh
# access
argo:password: echo "Bearer $(kubectl get secret -n argo default.service-account-token -o=jsonpath='{.data.token}' | base64 --decode)"
argo:port-forward: kubectl port-forward -n argo svc/argo-server 2746
ipam:
operator:
clusterPoolIPv4PodCIDRList: "10.42.0.0/16"
kubeProxyReplacement: "strict"
ingressController:
enabled: true
loadbalancerMode: "dedicated"
default: true
local docker_auth=`echo -n ${DOCKER_USERNAME:?}:${DOCKER_TOKEN:?} | base64 -w 0`
local docker_config=`cat <<EOF
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "${docker_auth}"
}
}
}
EOF