A simple host and client script written in Elixir. Hosting a little Elixir quiz.
Run the following in two Terminal windows:
iex -r host.ex
[ | |
{ | |
"name": "Phillip Bode", | |
"phone": "(463) 776-7503", | |
"title": "Miss", | |
"car": "Jeep Land Cruiser" | |
}, | |
{ | |
"name": "Vickie Homenick", | |
"phone": "(763) 838-2156", |
[ | |
{ | |
"name": "Harvey Renner", | |
"phone": "(478) 245-7781", | |
"title": "Mrs.", | |
"car": "Cadillac Explorer" | |
}, | |
{ | |
"name": "Gwendolyn Brown", | |
"phone": "(832) 215-8487", |
[ | |
{ | |
"name": "Santiago Bartell", | |
"phone": "(005) 538-8149", | |
"title": "Miss", | |
"car": "BMW Camry" | |
}, | |
{ | |
"name": "Phil Hessel", | |
"phone": "(371) 656-8970", |
#!/bin/bash | |
# Usage: | |
# | |
# curl -sL https://gist.githubusercontent.com/archan937/d35deef3b1f2b5522dd4b8f397038d27/raw/setup-dnsmasq.sh | sudo bash | |
# | |
DOMAIN=".test" | |
ensure_ping() { |
const MyCoolModule = (() => { | |
let | |
privateState = {}, | |
privateVariable = 'private', | |
bothPrivateAndPublicVariable = 'private and public', | |
init = () => { | |
// do some initialization stuff | |
console.log('Initialized MyCoolModule!'); | |
}, |
# This file contains important security parameters. If you modify this file | |
# manually, Certbot will be unable to automatically provide future security | |
# updates. Instead, Certbot will print and log an error message with a path to | |
# the up-to-date file that you will need to refer to when manually updating | |
# this file. | |
ssl_session_cache shared:le_nginx_SSL:10m; | |
ssl_session_timeout 1440m; | |
ssl_session_tickets off; |
-----BEGIN DH PARAMETERS----- | |
MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz | |
+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a | |
87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7 | |
YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi | |
7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD | |
ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg== | |
-----END DH PARAMETERS----- |
require "net/telnet" | |
def keys(hosts, pattern = nil) | |
[hosts].flatten.each do |host| | |
slabs = {} | |
telnet = Net::Telnet::new("Host" => host, "Port" => 11211, "Timeout" => 3) | |
telnet.cmd("String" => "stats items", "Match" => /^END/) do |stats| | |
slabs = Hash[stats.scan(/STAT items:(\d+):number (\d+)/)] | |
end |
# iex(1)> | |
ast = quote do: 1 + 1 | |
# iex(2)> | |
Code.eval_quoted(ast) | |
# iex(3)> | |
ast = quote do: sum(1, 2 + 3) | |
# iex(4)> |