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
# Configure your own custom Rec Mono for Code font | |
# | |
# /$$$$$$ /$$ | |
# /$$ / / / $$$ | |
# /$$$$$$$ /$$$$$$$ /$$ $$$$$ /$$$$$$$$$ /$$$$$ /$$$$$$$ / | |
# /$$_____/ /$$____ $$ | $$$___ $$ |___ $$__/ |___ $$ /$$ $$ | |
# | $$ | $$ | $$ | $$ | $$ | $$ | $$ \ $$$$$$$ | |
# | $$ | $$ | $$ | $$ | $$ | $$ | $$ \ $$ / | |
# \ $$$$$$$ \ $$$$$$$ | $$ | $$ /$$$$$$$$$ /$$$$$$$$$ / $$$$$$$$ |
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
openssl req -new -newkey ec:<(openssl ecparam -name prime256v1) -nodes -keyout key.pem -out csr.pem |
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
package damm | |
import "strconv" | |
// DefaultDamm10 has as its Matrix a 10x10 totally anti-symmetric quasigroup | |
// retrieved from Damm's doctoral dissertation. | |
// | |
// https://en.wikipedia.org/wiki/Damm_algorithm | |
var DefaultDamm10 = Damm{Matrix: [][]int{ | |
[]int{0, 3, 1, 7, 5, 9, 8, 6, 4, 2}, |
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
package ecies | |
import ( | |
"encoding/binary" | |
"hash" | |
"io" | |
) | |
type nistConcatKDF struct { | |
hash hash.Hash |
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
syntax = "proto3"; | |
option go_package = "proxy"; | |
// Frames an API request message. | |
// | |
// Each request to the API has a unique stream id per-connection, starting at one. | |
// This stream id associates all request and response messages for a single request | |
// together. | |
// |
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
package raven | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"net/http/httptest" | |
"net/url" | |
) |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"os" | |
) |
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
// GetBasicAuth parses the username and password from an HTTP request Basic Authorization header. | |
// See RFC 2617. | |
func GetBasicAuth(r *http.Request) (username, password string, err error) { | |
// Get the Authorization header. | |
authHeader := r.Header.Get("Authorization") | |
if authHeader == "" { | |
return "", "", errors.New("authorization header was not provided") | |
} | |
// Check the Authorization type is "Basic" |
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
package main | |
// UserError contains error information presented to the users of our API | |
type UserError struct { | |
Msg string `json:"message"` | |
Code int `json:"error"` | |
} | |
// ApplicationError contains information about errors that arise while accessing resources. | |
type ApplicationError struct { |
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
sudo iptables -A INPUT -i lo -j ACCEPT # Local loopback | |
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # Established connections | |
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT # SSH | |
sudo iptables -A INPUT -p tcp --dport 28600:28699 -j DROP # Block 286XX | |
sudo iptables -A INPUT -j DROP # Drop everything else |
NewerOlder