This file contains 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
trait Node: std::fmt::Debug { | |
fn value(&self) -> usize; | |
fn visit(&self) -> Result<usize, &str>; | |
} | |
#[derive(Debug)] | |
struct FixedNode; | |
impl Node for FixedNode { | |
fn value(&self) -> usize { 100 } |
This file contains 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 | |
# Should be set to run monthly as a cron job | |
# If the renewal fails abort immediately | |
set -o errexit | |
LOG_FILE="/var/log/acme.log" | |
# Perform the actual renewal, logging the output and saving the certificate |
This file contains 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
# The following is broken, it doesn't consider module documentation in other | |
# files (mostly a problem for namespace modules), it doesn't properly respect | |
# :nodoc: as claimed in the documentation and it doesn't consider a module a | |
# namespace module if if contains a constant definition. | |
Style/Documentation: | |
Enabled: false | |
require: | |
- rubocop-rspec |
This file contains 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
upnp2 { | |
acl { | |
rule 10 { | |
action deny | |
local-port 0-1024 | |
subnet 0.0.0.0/0 | |
} | |
rule 20 { | |
action deny | |
external-port 0-1024,1080,5432,8000,8080,8081,8088,8443,8888,9100,9200 |
This file contains 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
unexpected fault address 0xc420dac140 | |
fatal error: fault | |
[signal SIGSEGV: segmentation violation code=0x2 addr=0xc420dac140 pc=0xc420dac140] | |
goroutine 211 [running]: | |
runtime.throw(0x38a42e3, 0x5) | |
/usr/lib64/go/src/runtime/panic.go:605 +0x95 fp=0xc420aa6c98 sp=0xc420aa6c78 pc=0x42ea55 | |
runtime.sigpanic() | |
/usr/lib64/go/src/runtime/signal_unix.go:374 +0x227 fp=0xc420aa6ce8 sp=0xc420aa6c98 pc=0x445947 | |
created by k8s.io/kubernetes/pkg/kubelet/volumemanager.(*volumeManager).Run |
This file contains 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
INFO [11-26|19:03:38] Starting peer-to-peer node instance=Geth/v1.7.3-stable-4bb3c89d/linux-amd64/go1.7.3 | |
INFO [11-26|19:03:38] Allocated cache and file handles database=/root/.ethereum/geth/chaindata cache=2048 handles=1024 | |
INFO [11-26|19:03:41] Initialised chain configuration config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Engine: ethash}" | |
INFO [11-26|19:03:41] Disk storage enabled for ethash caches dir=/root/.ethereum/geth/ethash count=3 | |
INFO [11-26|19:03:41] Disk storage enabled for ethash DAGs dir=/root/.ethash count=2 | |
INFO [11-26|19:03:41] Initialising Ethereum protocol versions="[63 62]" network=1 | |
INFO [11-26|19:03:41] Loaded most recent local header number=4615166 hash=9b0e97…d2ebdf td=1553373258111240174199 | |
INFO [11-26|19:03:41] Loaded most recent local full block number=4615166 hash=9b0e97…d2ebdf td=1553373258111240174199 | |
INFO [11-26|19:03 |
This file contains 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
✓ ~/ $ echo -ne '\x7f\x45\x4c\x46\x02\x01\x01\x03\x00' > test | |
✓ ~/ $ chmod +x test | |
✓ ~/ $ ./test | |
-bash: ./test: cannot execute binary file: Exec format error |
This file contains 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 ruby | |
require 'openssl' | |
require 'socket' | |
require 'timeout' | |
Thread.abort_on_exception = true | |
SERVER_KEY = OpenSSL::PKey::RSA.new(2048) |
This file contains 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
$TTL 14400 | |
@ IN SOA nsd01.prd.btv.example.tld. hostmaster.example.tld. ( | |
2017051601 ; Serial number YYYYMMDDNN | |
2d ; Refresh | |
2h ; Retry | |
30d ; Expire | |
5m ; Min TTL | |
) | |
$ORIGIN example.tld. ; Default zone domain |
This file contains 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
module Statistics | |
def self.sum(data) | |
data.inject(0.0) { |s, val| s + val } | |
end | |
def self.mean(data) | |
sum(data) / data.size | |
end | |
def self.median(data) |
NewerOlder