Skip to content

Instantly share code, notes, and snippets.

View akhiljalagam's full-sized avatar
🎯
Focusing

Akhil Jalagam akhiljalagam

🎯
Focusing
View GitHub Profile
@akhiljalagam
akhiljalagam / install-arch.md
Created June 15, 2023 20:41 — forked from jqtrde/install-arch.md
Install Arch Linux with Full Disk Encryption (LVM on LUKS)
@akhiljalagam
akhiljalagam / restyling_template.user.js
Created January 6, 2023 16:16 — forked from Hunter-Github/restyling_template.user.js
A simple GreaseMonkey script template to implement a user-defined CSS without Stylish
// ==UserScript==
// @name Fix some style in GreaseMonkey
// @match *://example.com/*
// @copyright 2016+, You
// @grant GM_addStyle
// ==/UserScript==
GM_addStyle ( " \
// ADD YOUR CSS HERE
" );
@akhiljalagam
akhiljalagam / docker.sh
Created August 3, 2022 11:34 — forked from monkeym4ster/docker.sh
Docker: save/load container using tgz file (tar.gz)
#for not running docker, use save:
docker save <dockernameortag> | gzip > mycontainer.tgz
#for running or paused docker, use export:
docker export <dockernameortag> | gzip > mycontainer.tgz
#load
gunzip -c mycontainer.tgz | docker load
@akhiljalagam
akhiljalagam / README.md
Created February 8, 2022 09:50 — forked from etiennetremel/README.md
Simple Wireguard setup as VPN server and multiple clients

Simple WireGuard configuration

1 server, 2 clients

Getting started

Install Wireguard on all machines.

Generate all keys

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

@akhiljalagam
akhiljalagam / letsencrypt-webroot-apache.md
Created December 8, 2020 05:27 — forked from daronco/letsencrypt-webroot-apache.md
Letsencrypt with webroot on Apache

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 November 26, 2020 03:16 — forked from agarzon/queueCounter.sh
alert based in mail queue size for postfix and plesk
#!/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 August 20, 2020 17:59 — 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.)
# 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.
@akhiljalagam
akhiljalagam / create-mysql.bash
Created April 10, 2020 15:45 — forked from omeinusch/create-mysql.bash
Simple bash script to create mysql db, user with generated password
#!/bin/bash
PASS=`pwgen -s 40 1`
mysql -uroot <<MYSQL_SCRIPT
CREATE DATABASE $1;
CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost';
FLUSH PRIVILEGES;
MYSQL_SCRIPT