Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Akhil Jalagam akhiljalagam

🎯
Focusing
View GitHub Profile
@akhiljalagam
akhiljalagam / README.md
Created Feb 8, 2022 — forked from etiennetremel/README.md
Simple Wireguard setup as VPN server and multiple clients
View README.md

Simple WireGuard configuration

1 server, 2 clients

Getting started

Install Wireguard on all machines.

Generate all keys

View Google Drive Sync Wine Scripting.md

Google Drive Sync Wine Scripting

This is a set of scripts that help running Google Drive Backup and Sync under Wine, with multiple Google accounts.

Each account is given its own Wine prefix (a separate wine configuration).

To install, run install-gdrive-sync google_account

List the accounts set up in ~/.config/gdrive-accounts

View spaceship-prompt_ssh.zsh
#
# Alive SSH Connections
#
SPACESHIP_SSH_SHOW="${SPACESHIP_SSH_SHOW=true}"
SPACESHIP_SSH_COLOR="${SPACESHIP_SSH_COLOR="yellow"}"
# ------------------------------------------------------------------------------
# Section
# ------------------------------------------------------------------------------
View letsencrypt-webroot-apache.md

Config Apache with /etc/apache2/conf-available/le.conf:

Alias /.well-known/acme-challenge/ "/var/www/html/.well-known/acme-challenge/"
<Directory "/var/www/html/">
    AllowOverride None
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
</Directory>
@akhiljalagam
akhiljalagam / queueCounter.sh
Created Nov 26, 2020 — forked from agarzon/queueCounter.sh
alert based in mail queue size for postfix and plesk
View queueCounter.sh
#!/bin/sh
MAIL_BIN=`command -v mail`
QUEUE_SIZE=`/usr/sbin/postqueue -p | tail -n1 | awk '{print $5}'`
QUEUE_SUMMARY=`/usr/sbin/qshape -s deferred | head`
MAILTO="xxx@gmail.com"
LIMIT=100
function send_notification_mail() {
echo $QUEUE_SUMMARY | $MAIL_BIN -s "WARNING: mail queue critical on $HOSTNAME" $MAILTO
@akhiljalagam
akhiljalagam / encrypt_decrypt.sh
Created Aug 20, 2020 — forked from pmarreck/encrypt_decrypt.sh
Some easy bash scripts to encrypt/decrypt data, for anyone who wants to go all cloak&dagger. (bitcoin private keys, etc.)
View encrypt_decrypt.sh
# Encryption functions. Requires the GNUpg "gpg" commandline tool. On OS X, "brew install gnupg"
# Explanation of options here:
# --symmetric - Don't public-key encrypt, just symmetrically encrypt in-place with a passphrase.
# -z 9 - Compression level
# --require-secmem - Require use of secured memory for operations. Bails otherwise.
# cipher-algo, s2k-cipher-algo - The algorithm used for the secret key
# digest-algo - The algorithm used to mangle the secret key
# s2k-mode 3 - Enables multiple rounds of mangling to thwart brute-force attacks
# s2k-count 65000000 - Mangles the passphrase this number of times. Takes over a second on modern hardware.
# compress-algo BZIP2- Uses a high quality compression algorithm before encryption. BZIP2 is good but not compatible with PGP proper, FYI.
View keybase.md

Keybase proof

I hereby claim:

  • I am akhiljalagam on github.
  • I am akhiljalagam (https://keybase.io/akhiljalagam) on keybase.
  • I have a public key ASA2eZrK4wVipx-wpBWXaW3fj8tcfpT5d9OAnR6igb9qcAo

To claim this, I am signing this object:

@akhiljalagam
akhiljalagam / do-bulk-ip-add-firewall.sh
Last active Jul 15, 2020
How to bulk add IP addresses to DigitalOcean firewall?
View do-bulk-ip-add-firewall.sh
#!/bin/bash
# Author: Akhil Jalagam
# update TOKEN, FIREWALL NAME, IP addresses and then run the script
TOKEN=dfjvbidvbasb4l5tu45hvu46vgl45h6vl
FIREWALL_NAME=internalaccess
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d \
@akhiljalagam
akhiljalagam / WindowsTerminal-Settings.json
Last active Jul 4, 2020
My Windows Terminal Settings with Solarized Dark scheme
View WindowsTerminal-Settings.json
// This file was initially generated by Windows Terminal 1.0.1811.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
View viewing distance calculator
function calc1(form) {
a = form.a.value;
b = Math.round(Math.pow(Math.pow(a, 2)/1.31640624208984, .5)/2.97869411418791);
c = Math.round(Math.pow(Math.pow(a, 2)/1.31640624208984, .5)/4.46804291661112);
d = Math.round(Math.pow(Math.pow(a, 2)/1.31640624208984, .5)/6.70206437491669);
e = Math.round(Math.pow(Math.pow(a, 2)/1.31640624208984, .5)/13.9626341144098);
f = Math.round(Math.pow(Math.pow(a, 2)/1.31640624208984, .5)/27.9252682288196);
form.total1.value = b;
form.total2.value = c;
form.total3.value = d;