Skip to content

Instantly share code, notes, and snippets.

View MartinNowak's full-sized avatar
🎯
Focusing

dawg MartinNowak

🎯
Focusing
View GitHub Profile
@miohtama
miohtama / gist:5389146
Created April 15, 2013 15:56
Decoding emails in Python e.g. for GMail and imapclient lib
import email
def get_decoded_email_body(message_body):
""" Decode email body.
Detect character set if the header is not set.
We try to get text/plain, but if there is not one then fallback to text/html.
:param message_body: Raw 7-bit message body input e.g. from imaplib. Double encoded in quoted-printable and latin-1
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 14 columns, instead of 6 in line 4.
Name,Full name,Description,Location,Coordinates,URL,Version,DNSSEC validation,No logs,Namecoin,Resolver address,Provider name,Provider public key,Provider public key TXT record
adamas,Adamas.ai DNSCrypt,DNSCrypt Server in LUX provided by adamas.ai,Luxembourg,,http.//adamas.ai,1,no,yes,no,80.90.43.162:5678,2.dnscrypt-cert.adamas.ai,6484:544A:4B91:F23A:E8AD:2AA3:6661:C419:D09B:C88D:B1AF:C314:E59D:2C36:0F81:FB99,
cisco,Cisco OpenDNS,Remove your DNS blind spot,Anycast,,https://www.opendns.com,1,no,no,no,208.67.220.220:443,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,
cisco-familyshield,Cisco OpenDNS with FamilyShield,Blocks web sites not suitable for children,Anycast,,https://www.opendns.com/home-internet-security/parental-controls/,1,no,no,no,208.67.220.123:443,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,
cisco-ipv6,Cisco OpenDNS over IPv6,Cisco OpenDNS IPv6 sandbox,Anycast,,https://www.
@maoueh
maoueh / test-cloud-init-run.sh
Created June 2, 2016 14:28
Small script to test changes made to cloud init config without rebooting
rm -rf /var/lib/cloud/instance && rm -rf /var/lib/cloud/instances/* && rm -rf /var/lib/cloud/sem/*
cloud-init init && cloud-init modules --mode config && cloud-init modules --mode final
@prasincs
prasincs / apache_dl.bash
Created August 28, 2016 19:41
Download from apache closer.cgi url directly
apache_dl(){
wget $(curl -L "$1?as_json=1" | python -c 'import sys, json; i =json.load(sys.stdin); print i["preferred"]+i["path_info"].strip()')
}
@butla
butla / wait_for_tcp_port.py
Last active December 8, 2022 19:52
Waiting for a TCP port to start accepting connections (Python >=3.6)
"""
MIT License
Copyright (c) 2017 Michał Bultrowicz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
#!ipxe
#dhcp
echo Starting Ubuntu arm64 installer for ${hostname}
set base-url http://ports.ubuntu.com/ubuntu-ports/dists/zesty/main/installer-arm64/current/images/netboot
boot ${base-url}/ubuntu-installer/arm64/bootnetaa64.efi url=http://ports.ubuntu.com/ubuntu-ports/dists/artful/main/installer-arm64/current/images/netboot/ubuntu-installer/arm64/grub/grub.cfg
# If everything failed, give the user some options
echo Boot from ${base-url} failed
prompt --key 0x197e --timeout 2000 Press F12 to investigate || exit
shell