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 json | |
import random | |
import string | |
import urllib.request | |
import urllib.parse | |
url = "https://dns.google/resolve" | |
def get_mx_record(domain): | |
if validate_domain(domain): |
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
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
labels: | |
k8s-app: traefik-ingress-lb | |
name: traefik-ingress-controller | |
annotations: | |
flux.weave.works/automated: "true" | |
namespace: kube-system | |
spec: |
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
defmodule LeakyBucket.Bucket do | |
@moduledoc """ | |
Simulates a leaky bucket implementation | |
""" | |
use GenServer | |
@initial_amount 0 | |
@increment_rate 1 | |
@leak_rate 2 | |
@leak_interval 500 |
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
defmodule EtsLog do | |
@moduledoc """ | |
GenServer to manage an in-memory log table. Start with EtsLog.start_link/0 | |
""" | |
use GenServer | |
@size 3 | |
# Public API | |
@doc """ |
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
#!/usr/bin/env bash | |
# install docker | |
# https://docs.docker.com/engine/installation/linux/ubuntulinux/ | |
# install docker-compose | |
# https://docs.docker.com/compose/install/ | |
# install letsencrypt | |
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04 |
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
defmodule Sample.PdfPlug do | |
import Plug.Conn | |
import Plug.Upload | |
@wkhtmltopdf_path System.find_executable("wkhtmltopdf") | |
def init(opts) do | |
opts | |
end |
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
#Stories are embedded docs in a Feed | |
class Feed | |
include MongoMapper::Document | |
many :stories | |
end | |
class Story | |
include MongoMapper::EmbeddedDocument | |
key :title, String |