Skip to content

Instantly share code, notes, and snippets.

View audacioustux's full-sized avatar
🤌
Actively Looking for Job, Internship, Scholarship Opportunities

Tanjim Hossain audacioustux

🤌
Actively Looking for Job, Internship, Scholarship Opportunities
View GitHub Profile
#!/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
defmodule Philopets.Repo.Migrations.CreateEmails do
use Ecto.Migration
def change do
create table(:emails) do
# :citext for case-insensitivity
add :email, :citext, null: false
add :is_primary, :boolean, default: false, null: false
add :is_public, :boolean, default: false, null: false
# can be used for password recovery. default set to false, as weak
@audacioustux
audacioustux / daemon.json
Created August 31, 2023 12:07
local /etc/docker/daemon.json
{
"features": {
"buildkit": true
},
"dns": ["1.1.1.1", "8.8.8.8", "192.168.0.1"],
"log-driver": "local",
"log-opts": {
"max-size": "1m"
}
}