Skip to content

Instantly share code, notes, and snippets.

View k3karthic's full-sized avatar
💭
I may be slow to respond.

Karthic Kumaran k3karthic

💭
I may be slow to respond.
View GitHub Profile
@k3karthic
k3karthic / notes.md
Last active October 15, 2025 13:34
Fedora Silverblue - DNS
@k3karthic
k3karthic / notes.md
Last active February 19, 2026 12:01
Fedora Silverblue - LUKS with TPM + SSD Trim
@k3karthic
k3karthic / update_nvim.sh
Created June 3, 2023 21:57
Update Neovim (AppImage w/o FUSE)
#!/usr/bin/env sh
cd /tmp
echo https://github.com/neovim/neovim/releases/download/stable/nvim.appimage
curl -OL https://github.com/neovim/neovim/releases/download/stable/nvim.appimage
chmod u+x nvim.appimage
./nvim.appimage --appimage-extract
mkdir -p ~/bin/nvim
mv /tmp/squashfs-root ~/bin/nvim
rm nvim.appimage
@k3karthic
k3karthic / update_dust.sh
Last active July 10, 2022 08:48
Update bootandy/dust
#!/usr/bin/env sh
## https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' | # Pluck JSON value
tr -d 'v' # Remove v
}
@k3karthic
k3karthic / update_aws.sh
Created June 7, 2022 05:11
Update AWS CLI v2
#!/usr/bin/env bash
cd /tmp
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
curl -o awscliv2.sig https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip.sig
gpg --verify awscliv2.sig awscliv2.zip
if [ $? -eq 0 ]; then
unzip awscliv2.zip
./aws/install --update -i $HOME/aws -b $HOME/bin
@k3karthic
k3karthic / sqlServerListenOnWSL2IP.ps1
Last active May 1, 2022 05:11
Allow WSL2 to connect to SQL Server on Windows
#
# This script configures SQL Server on Windows to listen for connections
# from the network adapter connected to WSL2
#
# Assumptions:
# 1) There is only a single SQL Server instance
# 2) SQL Server should only listen for local and WSL2 connections
# 3) The network adapter connected to WSL2 has the phrase "(WSL)" in the name
#
# Requirement:
@k3karthic
k3karthic / get_credentials.sh
Created April 1, 2022 06:01
Fetch Temporary AWS Credentials from CloudShell
#!/usr/bin/env bash
# Based on information from https://hackingthe.cloud/aws/post_exploitation/get_iam_creds_from_console_session/
TOKEN=$( curl -s -X PUT localhost:1338/latest/api/token -H "X-aws-ec2-metadata-token-ttl-seconds: 60" )
JSON=$( curl -s localhost:1338/latest/meta-data/container/security-credentials -H "X-aws-ec2-metadata-token: $TOKEN" )
if [ $? -eq 0 ]; then
ak=$( echo $JSON | jq .AccessKeyId )
sk=$( echo $JSON | jq .SecretAccessKey )
token=$( echo $JSON | jq .Token )
@k3karthic
k3karthic / update_rclone.sh
Created November 4, 2021 16:17
Update rclone
#!/usr/bin/env sh
## https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' | # Pluck JSON value
tr -d 'v' # Remove v
}
@k3karthic
k3karthic / update_node.sh
Created September 7, 2021 05:29
Update NVM Node
#!/usr/bin/env bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm install 'lts/*' --reinstall-packages-from=current
#!/usr/bin/env bash
## Forked from https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' | # Pluck JSON value
tr -d 'v' # Remove v
}