Skip to content

Instantly share code, notes, and snippets.

View yashodhank's full-sized avatar
🎯
Manifesting

Yashodhan yashodhank

🎯
Manifesting
View GitHub Profile
@yashodhank
yashodhank / docker-compose.yml
Last active November 28, 2022 01:33 — forked from smashnet/docker-compose.yml
Docker-Compose: Mastodon v4.0.2 with Traefik v2.9
version: "3.9"
# Install docker on Linux
# curl -fsSL https://get.docker.com | sudo sh
# Variables to fill in:
# Line 44: <LETSENCRYPT_MAIL_ADDRESS> - your mail address for contact with Let's Encrypt
# Line 57: <TRAEFIK_DASHBOARD_ADMIN_PASSWORD> - MD5 hash of your password (use http://www.htaccesstools.com/htpasswd-generator/)
# Line 76: <POSTGRES_PASSWORD> - the password for the postgres db. Use the same during mastodon:setup!
# Lines 52, 110, 136: <DOMAIN> - e.g. social.yourdomain.com (Must have an A record pointing to your box' IP) (AAAA for IPv6 ;)
@yashodhank
yashodhank / gist:96dc27d6a1e1899b398e33819c19baa2
Created November 19, 2022 06:00 — forked from Darkflib/gist:8c40e9e0bb60883bd70fb34972b5954a
minio gateway to s3 compatible wasabi with cache + s3fs and ecryptfs
mkdir /mnt/wasabi-cache
lvcreate -L 100G -n wasabi-cache vg0
mkfs.ext4 /dev/vg0/wasabi-cache
docker run -d -p 9000:9000 --name minio-wasabi -e "MINIO_CACHE_DRIVES=/mnt/wasabi-cache" -e "MINIO_CACHE_EXPIRY=40" \
-e "MINIO_ACCESS_KEY=AKKEYKEYKEYKEYKEY" -e "MINIO_SECRET_KEY=mysecret123123123123123" \
minio/minio gateway s3 https://s3.wasabisys.com:443
@yashodhank
yashodhank / Tweet functions.gs
Created September 15, 2022 22:35 — forked from iamdaniele/Tweet functions.gs
Add public metrics
const BearerTokenKey = 'twitterBearerToken';
function onOpen() {
SpreadsheetApp
.getUi()
.createMenu('Twitter')
.addItem('Set Bearer token', 'helpers.requestBearerToken')
.addItem('Sign out', 'helpers.logout')
.addToUi();
}
@yashodhank
yashodhank / shell-setup.ps1
Created September 13, 2022 11:03 — forked from mikepruett3/shell-setup.ps1
Packages to install via scoop, winget, choco, and other tools...
<#
.SYNOPSIS
Script to Initialize my custom powershell setup.
.DESCRIPTION
Script uses scoop
.NOTES
**NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted.
Author: Mike Pruett
Date: October 18th, 2018
# ## Overview
# Instructions on how to game in the cloud inspired by:
# https://lg.io/2015/07/05/revised-and-much-faster-run-your-own-highend-cloud-gaming-service-on-ec2.html
# https://medium.com/@bmatcuk/gaming-on-amazon-s-ec2-83b178f47a34
#
# ## Additional reading
# https://gstreamer.freedesktop.org/documentation/tutorials/basic/streaming.html?gi-language=c
# https://trac.ffmpeg.org/wiki/StreamingGuide
## Yashodhan
#Set-ExecutionPolicy Unrestricted -Force
# baseline
Set-TimeZone -ID "India Standard Time"
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
#Set-ExecutionPolicy RemoteSigned -Force
# Office and communication
@yashodhank
yashodhank / windows.ps1
Created September 13, 2022 09:53 — forked from shurick81/windows.ps1
Laptop provisioning
# Baseline
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module PnP.PowerShell -Force
Install-Module MSOnline -Force
Install-Module AzureAD -Force
Set-ExecutionPolicy Bypass -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Connection and security
choco install -y forticlientvpn
@yashodhank
yashodhank / auto_plesk_trial.php
Created August 17, 2022 10:01 — forked from likecyber/auto_plesk_trial.php
Auto Plesk Trial Renewal (using Anti-Captcha to solve ReCaptcha)
<?php
/*
Make sure to enter $anticaptcha_key before upload to server.
Upload "auto_plesk_trial.php" file to "/home/centos/auto_plesk_trial.php"
Then create Schedule Task in Root account of Plesk.
Task Type: Run a PHP script
Script path: /home/centos/auto_plesk_trial.php
Use PHP version: 7.x.x / 8.x.x
Run: Cron style * * * * *
@yashodhank
yashodhank / TorPrivoxyPython.md
Created July 15, 2022 10:39 — forked from DusanMadar/TorPrivoxyPython.md
A step-by-step guide how to use Python with Tor and Privoxy

A step-by-step guide how to use Python with Tor and Privoxy

Latest revision: 2021-12-05.

Tested on Ubuntu 18.04 Docker container. The Dockerfile is a single line FROM ubuntu:18.04. Alternatively, you can simply run docker run -it ubuntu:18.04 bash.

NOTE: stopping services didn't work for me for some reason. That's why there is kill $(pidof <service name>) after each failed service <service name> stop to kill it.

References

Using keepalived for node ingress and dns relaibility

This assumes you have installed a docker swarm

Introduction

When one has a docker swarm a container running on any node in the swarm can be accesed using any IP address of any swarm memeber.

For example if you had a single web server running on port 80, on one node of a swarm you could access the web server with any of the following IP addresses:

  • server1-ip:80
  • server2-ip:80