Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Fighting entropy

Anand Dyavanapalli adyavanapalli

💭
Fighting entropy
View GitHub Profile
@adyavanapalli
adyavanapalli / .vimrc
Created Oct 20, 2019
Easy peasy .vimrc for all terminals good in the world.
View .vimrc
" ------------------------------- "
" | Tab and Space Configuration | "
" ------------------------------- "
set tabstop=4 "Tab is 4 spaces in length."
set shiftwidth=4 "Indentation is 4 spaces in length."
set expandtab "Inserts space chars instead of tab."
set softtabstop=4 "Spaces in place of tabs still behave like tabs."
" ------------------------------ "
View download_book.sh
#!/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 Feb 6, 2019
Counts and sorts each unique IP address in the NGINX `access.log` file, and pipes the output to `less`.
View count_nginx_access.sh
#!/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 Dec 2, 2018
Send single byte payloads via UDP on a LAN.
View client.py
#!/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'