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
contract random{ | |
function rand(uint min, uint max) public returns (bytes32){ | |
uint256 lastBlockNumber = block.number - 1; | |
bytes32 hashVal = bytes32(block.blockhash(lastBlockNumber)); | |
return bytes32(hashVal); | |
} | |
} |
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 | |
[ $# -ge 6 ] || { | |
echo "Usage: $0 <NICK> <MAIL> <GPG> <AS> <ENDPOINT> <IPV4> [PORT] [FASTD-PUBKEY]" >&2 | |
exit 1 | |
} | |
# You may want to change variables below and check if "/etc/bird/bird-dn42.conf" | |
# is included in your bird-config (same for bird6 with bird6-dn42.conf) |
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
# Origin whitelist | |
map $http_origin $allowed_origin { | |
default "false"; | |
"~*\.?test\.com" "true"; | |
"~*\.?example\.com" "true"; | |
} | |
# Methods | |
map $request_method $cors { |
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
Install: | |
---------- | |
* Activate Hetzner Rescue System (Debian) | |
* Connect to Hetzner Rescue System using SSH and live boot RancherOS | |
(thanks goes to William Fleurant for showing how this can be done: https://github.com/wfleurant/boot-rancheros-hetzner/) | |
* apt-get update | |
* apt-get install kexec-tools aria2 |
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
#cloud-config | |
# vim: syntax=yaml | |
disable_root: false | |
ssh_authorized_keys: [] | |
write_files: | |
- path: "/etc/ssh/sshd_config.d/permit_root" | |
owner: "root:root" | |
permissions: "0644" | |
content: | |
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/python | |
import socket | |
import struct | |
import sys | |
# We want unbuffered stdout so we can provide live feedback for | |
# each TTL. You could also use the "-u" flag to Python. | |
class flushfile(file): | |
def __init__(self, f): |
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
contract random { | |
/* Generates a random number from 0 to 100 based on the last block hash */ | |
function randomGen(uint seed) constant returns (uint randomNumber) { | |
return(uint(sha3(block.blockhash(block.number-1), seed ))%100); | |
} | |
/* generates a number from 0 to 2^n based on the last n blocks */ | |
function multiBlockRandomGen(uint seed, uint size) constant returns (uint randomNumber) { | |
uint n = 0; | |
for (uint i = 0; i < size; i++){ |
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
// Get the key from the "DSN" at: https://sentry.io/settings/<org>/projects/<project>/keys/ | |
// The "DSN" will be in the form: https://<SENTRY_KEY>@sentry.io/<SENTRY_PROJECT_ID> | |
// eg, https://0000aaaa1111bbbb2222cccc3333dddd@sentry.io/123456 | |
const SENTRY_PROJECT_ID = '123456' | |
const SENTRY_KEY = '0000aaaa1111bbbb2222cccc3333dddd' | |
// Useful if you have multiple apps within a project – not necessary, only used in TAGS and SERVER_NAME below | |
const APP = 'my-app' | |
// https://docs.sentry.io/error-reporting/configuration/?platform=javascript#environment |
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
/* base32 */ | |
/* | |
Copyright (c) 2011, Chris Umbel | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"os" | |
"github.com/miekg/dns" | |
) |
OlderNewer