Data URI manipulation made easy.
This isn't very robust, and will reject a number of valid data URIs. However, it meets the most useful case: a mimetype, a charset, and the base64 flag.
| #################################### | |
| # BASIC REQUIREMENTS | |
| # http://graphite.wikidot.com/installation | |
| # http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/ | |
| # Last tested & updated 10/13/2011 | |
| #################################### | |
| sudo apt-get update | |
| sudo apt-get upgrade |
| #!/etc/init/carbon-cache.conf | |
| description "Carbon server" | |
| start on filesystem or runlevel [2345] | |
| stop on runlevel [!2345] | |
| umask 022 | |
| expect fork | |
| respawn |
| # -*- coding: utf-8 -*- | |
| import Image | |
| def resize_and_crop(img_path, modified_path, size, crop_type='top'): | |
| """ | |
| Resize and crop an image to fit the specified size. | |
| args: | |
| img_path: path for the image to resize. |
| #!/bin/bash | |
| # bash generate random alphanumeric string | |
| # | |
| # bash generate random 32 character alphanumeric string (upper and lowercase) and | |
| NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
| # bash generate random 32 character alphanumeric string (lowercase only) | |
| cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| #!/usr/bin/env python | |
| # http://www.vnsecurity.net/t/length-extension-attack/ | |
| # sha1 padding/length extension attack | |
| # by [email protected] | |
| # | |
| import sys | |
| import base64 | |
| from shaext import shaext |
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| import argparse | |
| try: | |
| from boto.ec2.connection import EC2Connection | |
| except ImportError: | |
| sys.stderr.write('Please install boto ( http://docs.pythonboto.org/en/latest/getting_started.html )\n') | |
| sys.exit(1) |
| from collections import OrderedDict | |
| import argparse | |
| import logging | |
| # Suppress ipv6 warning when importing scapy | |
| logging.getLogger("scapy.runtime").setLevel(logging.ERROR) | |
| from scapy.all import IP, UDP, send, L3RawSocket, conf | |
| PACKET_FORMAT = "tag=%s&%s&seq=0x%04x" |