This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| This script generates an origin certificate from Cloudlare using their API. | |
| It requires the 'requests' library to make HTTP requests. | |
| """ | |
| from cryptography import x509 | |
| from cryptography.x509.oid import NameOID | |
| from cryptography.hazmat.primitives import hashes, serialization | |
| from cryptography.hazmat.primitives.asymmetric import rsa | |
| import requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM golang:1.14.4 AS builder | |
| RUN apt-get update && apt-get install -y ca-certificates | |
| RUN git clone -b v2.9.1 --depth=1 https://github.com/drone/drone | |
| RUN cd drone && go install -trimpath -ldflags='-w -s' -tags nolimit ./cmd/drone-server | |
| FROM debian:buster-slim | |
| COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This script converts an mp4 into an mp3 | |
| # It works by running ffmpeg in a docker container | |
| set -euo pipefail | |
| IFS=$'\n' | |
| convert () { | |
| input="$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Redirects ### | |
| # Change IP address to domain name | |
| server { | |
| listen 80; | |
| server_name netdata.albertyw.com; | |
| return 301 https://netdata.albertyw.com$request_uri; | |
| } | |
| ### Servers ### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| import time | |
| commands = ['./time.sh'] * 5 | |
| outputs = [None] * len(commands) | |
| processes = [None] * len(commands) | |
| start = time.time() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: ASDF | |
| # Required-Start: $remote_fs $syslog | |
| # Required-Stop: $remote_fs $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: ASDF | |
| # Description: ASDF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import urllib2 | |
| import json | |
| url="http://letsrevolutionizetesting.com/challenge.json" | |
| opener = urllib2.build_opener() | |
| opener.addheaders = [('User-agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36')] | |
| def follow(url): | |
| print url | |
| page = opener.open(url).read() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OTHER | AI | 128.52.0.0/16 | Artificial Intelligence Laboratory | |
|---|---|---|---|---|
| OTHER | WHOI | 128.128.0.0/16 | Woods Hole Oceanographic Institute | |
| OTHER | LINCOLN | 129.55.0.0/16 | Lincoln Laboratories | |
| OTHER | NEARNET | 192.52.0.0/16 | NEARnet | |
| OTHER | HAYSTACK | 192.52.64.0/24 | Haystack Observatory (EAPS/CSR) | |
| INFRA | EXTERNAL-ETHER | 192.54.222.0/24 | MIT External Ethernet | |
| OTHER | SAP-FDDI | 192.168.1.0/24 | FDDI for SAP (Unconnected) | |
| OTHER | EXTERNAL-FDDI | 192.233.33.0/24 | MIT External FDDI | |
| INFRA | NET1-RESERVED | 18.1.0.0/16 | ||
| INFRA | N42-DHREG | 18.2.0.0/21 | Building N42 DHREG hack |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Sort the letters of the alphabet by their frequency in the 1000 most common words | |
| """ | |
| # Read text file | |
| WORDS_LIST_FILE = "common-words-list.txt" | |
| file_handle = open(WORDS_LIST_FILE, 'r') | |
| text = file_handle.read() | |
| file_handle.close() | |
| text = text.lower().replace("\n",'') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| This script finds the total size of an ftp directory by recursively opening directories | |
| @author: Albert Wang ([email protected]) | |
| September 18, 2010 | |
| """ | |
| from ftplib import FTP | |
| import re | |
| import sys |
NewerOlder