Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
"""
The idea here is to have one demo of each common argparse format
type. This is useful for me to be able to copy/paste into a new
script and have something to quickly edit and trim down to get
the functionality I need.
Expect this file to grow/change as I need new options.
This is, however, a working example. I hate examples that don't
@awsumco
awsumco / Installing Arch on a ThinkPad X1 Extreme.md
Created October 8, 2019 08:59 — forked from CodingCellist/Installing-Arch-on-a-ThinkPad-X1-Extreme-Gen-1.md
A detailed overview of how I installed Arch Linux on my Lenovo ThinkPad X1 Extreme, having never installed Arch before.

DISCLAIMER

I am not responsible for any damages, loss of data, system corruption, or any other mishap you may somehow cause by following this guide.

This is mainly a step-by-step reminder/log for myself of how I installed Arch on my laptop. I am putting this out there in case it is useful for someone else, it is not intended to be an official guide. As a result, you may find that this guide is very tedious or lists a lot of unnecessary/intuitive steps or just straight up does things in a way that is considered bad practice. Apart from the latter, this is intentional, as I did not find these steps intuitive at all when

export PS1="🍺 [\[$(tput sgr0)\]\[\033[38;5;10m\]\A\[$(tput sgr0)\]\[\033[38;5;15m\]][\[$(tput sgr0)\]\[\033[38;5;13m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;14m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]][\[$(tput sgr0)\]\[\033[38;5;11m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\]]\\$ \[$(tput sgr0)\]"
@awsumco
awsumco / gist:c66ed6ed39b0d0bf524ead95e5df6477
Created November 2, 2016 07:28
Python - Getting Data Into Graphite
#!/usr/bin/env python
import socket
import time
CARBON_SERVER = '0.0.0.0'
CARBON_PORT = 2003
message = 'foo.bar.baz 42 %d\n' % int(time.time())
#!/usr/bin/env python
import imaplib
USER = '[email protected]'
PASSWORD = 'xxx'
mail = imaplib.IMAP4_SSL('imap.gmail.com', 993)
mail.login(USER, PASSWORD)
mail.select('Inbox')
@awsumco
awsumco / block_https_with_reject.sh
Created August 11, 2015 10:07
Block https with connection refused, helps with AutoDiscovry of A records that have invalid SSL certs.
iptables -A INPUT -d $IP -p tcp -m multiport --dports 443 -j REJECT --reject-with icmp-host-prohibited