I hereby claim:
- I am renfredxh on github.
- I am renfredxh (https://keybase.io/renfredxh) on keybase.
- I have a public key whose fingerprint is C33E B29E 79D7 B679 C3AC 9EB4 4896 719E C9F7 6CF3
To claim this, I am signing this object:
| from urllib.request import urlopen | |
| from bs4 import BeautifulSoup | |
| webpage = urlopen('https://www.google.com') | |
| soup = BeautifulSoup(webpage) | |
| print(soup.prettify()) |
| from urllib.parse import urlencode | |
| def extract_form_fields(self, soup): | |
| "Turn a BeautifulSoup form into url encoded fields and default values" | |
| fields = "" | |
| for input in soup.findAll('input'): | |
| # ignore submit/image with no name attribute | |
| if input['type'] in ('submit', 'image') and not input.has_attr('name'): | |
| continue | |
| #!/usr/local/bin/python3 | |
| # Make a new reminder via terminal script | |
| # args: remind <title> <date> <time> | |
| # example: remind clean 12/10/2012 10:00:00PM | |
| import subprocess | |
| import sys | |
| from datetime import datetime, timedelta | |
| # A apple script that creates a new reminder given a name date and time | |
| OSASCRIPT = ('<<END\n' |
| #!/usr/bin/env ruby | |
| # Description: Forwards one or more ports from your localhost to a Vagrant VM | |
| # via ssh. Useful for viewing multiple dev applications in Vagrant at once. | |
| # | |
| # Installation: | |
| # $ mv vforward.rb /usr/bin/vforward | |
| # $ chmod +x /usr/bin/vforward | |
| # | |
| # Usage: vforward [ports ...] |
| <html> | |
| <head> | |
| <title>404</title> | |
| <style> | |
| body { | |
| width: 100%; | |
| height: 100%; | |
| margin: 0; | |
| padding: 0; | |
| background: #000; |
| ############################################################ | |
| # Dockerfile to build SRCTweb flask application | |
| # Based on Ubuntu | |
| ############################################################ | |
| # Instructions: | |
| # | |
| # Build: sudo docker build -t srctweb . | |
| # Run: sudo docker run -p 8000:80 -i -t -d srctweb | |
| # |
| """ | |
| Two things are wrong with Django's default `SECRET_KEY` system: | |
| 1. It is not random but pseudo-random | |
| 2. It saves and displays the SECRET_KEY in `settings.py` | |
| This snippet | |
| 1. uses `SystemRandom()` instead to generate a random key | |
| 2. saves a local `secret.txt` |
| ############################################################ | |
| # Dockerfile to build What's Open Django App | |
| ############################################################ | |
| # Instructions: | |
| # | |
| # Note: You need to edit the empty string on the line that | |
| # says "ENV SECRET_KEY" to be a secure random value. | |
| # | |
| # Any initialized data that needs to be imported should be |
| #!/bin/bash | |
| path="../grails-app" | |
| command="grails compile" | |
| chsum1="" | |
| echo "Watching ${path} for changes" | |
| while [[ true ]] | |
| do | |
| chsum2=`find ${path} -type f -exec md5sum {} \;` |
I hereby claim:
To claim this, I am signing this object: