Skip to content

Instantly share code, notes, and snippets.

View adyavanapalli's full-sized avatar
💭
Fighting entropy

Anand Dyavanapalli adyavanapalli

💭
Fighting entropy
  • Veradigm
  • 01:33 (UTC -04:00)
View GitHub Profile
@adyavanapalli
adyavanapalli / init.sh
Last active January 13, 2024 08:42
Arch Linux Installation
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace
if [[ $(cat /sys/firmware/efi/fw_platform_size) != 64 ]]; then
echo "ERROR: Bad fw_platform_size."
exit 1
@adyavanapalli
adyavanapalli / install-terraform.sh
Created October 16, 2023 02:45
Terraform Installation Convenience Script
sudo apt-get update
sudo apt-get install -y gnupg software-properties-common
wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
gpg --no-default-keyring \
--keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \
--fingerprint
@adyavanapalli
adyavanapalli / Set-SecondsInSystemClock.ps1
Created April 29, 2022 20:31
Make Windows 10’s taskbar clock display seconds
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ `
-Name ShowSecondsInSystemClock `
-Value 1
@adyavanapalli
adyavanapalli / .vimrc
Last active February 7, 2024 10:20
Easy peasy .vimrc for all terminals good in the world.
" ------------------------------- "
" | Tab and Space Configuration | "
" ------------------------------- "
set tabstop=2 "Tab is 2 spaces in length."
set shiftwidth=2 "Indentation is 2 spaces in length."
set expandtab "Inserts space chars instead of tab."
set softtabstop=2 "Spaces in place of tabs still behave like tabs."
" ------------------------------ "
@adyavanapalli
adyavanapalli / download_book.sh
Created August 12, 2019 03:09
Download OSTEP Book
#!/usr/bin/env bash
# download_book.sh
# - Downloads all chapters from the OSTEP website and creates a single PDF.
while read -r dest src; do
wget "$src" -O "$dest" &
done < files.txt
wait
@adyavanapalli
adyavanapalli / count_nginx_access.sh
Created February 6, 2019 15:22
Counts and sorts each unique IP address in the NGINX `access.log` file, and pipes the output to `less`.
#!/usr/bin/env bash
# count_nginx_access.sh
sudo sudo awk '{print $1}' access.log | sort | uniq -c | sort -nr | less
@adyavanapalli
adyavanapalli / client.py
Last active December 2, 2018 20:34
Send single byte payloads via UDP on a LAN.
#!/usr/bin/env python3
'''Sends a single byte payload to the specified IP address on UDP port 8080.
Should be run on the Intel Edison.
'''
import socket
# TARGET IP address should be that of the device you're running `server.py`.
TARGET = ('192.168.1.1', 8080)
MESSAGE = b'0'