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
| # -*- coding: UTF-8 -*- | |
| import sys, locale | |
| import csv | |
| import copy | |
| reload(sys) | |
| sys.setdefaultencoding('utf-8') | |
| class Vertex(object): |
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 ( | |
| "bytes" | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "crypto/rand" | |
| "errors" | |
| "io" | |
| "io/ioutil" |
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
| // License: MIT | |
| package main | |
| import ( | |
| "crypto/rand" | |
| "fmt" | |
| "math/big" | |
| ) | |
| // GenerateRandomASCIIString returns a securely generated random ASCII string. |
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
| """Federated queries with Virtuoso.""" | |
| import sys | |
| from SPARQLWrapper import SPARQLWrapper, JSON | |
| QUERY_WIKIDATA = """ | |
| PREFIX wd: <http://www.wikidata.org/entity/> |
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 "fmt" | |
| func main() { | |
| slice := make([]int, 159) | |
| // Split the slice into batches of 20 items. | |
| batch := 20 |
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
| * CloudFare IP list: https://www.cloudflare.com/ips/ | |
| * Google's IP addresses: | |
| nslookup -q=TXT _netblocks.google.com 8.8.8.8 | |
| nslookup -q=TXT _netblocks2.google.com 8.8.8.8 | |
| nslookup -q=TXT _netblocks3.google.com 8.8.8.8 | |
| Each of the above line will display a CIDR block or Google’s IP addresses. | |
| * Amazon IP addresses: https://ip-ranges.amazonaws.com/ip-ranges.json |
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
| # Requirements | |
| # debian/ubuntu | |
| apt-get -y update && apt-get -y upgrade | |
| apt-get -y install strongswan xl2tpd libstrongswan-standard-plugins libstrongswan-extra-plugins | |
| VPN_SERVER_IP='' | |
| VPN_IPSEC_PSK='y' | |
| VPN_USER='' | |
| VPN_PASSWORD='' |
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
| /* tinygccpe.scr: GNU ld linker script for smaller PE .exe output | |
| * by [email protected] at Fri Feb 3 15:41:13 CET 2017 | |
| * | |
| * It's different from the default by: | |
| * | |
| * * It drops initializers (e.g. .init, .ctors), and fails if the code tries | |
| * to use them. | |
| * * It drops exceptions (e.g. .pdata), and fails if the code tries | |
| * to use them. | |
| * * It merges .data and .rdata. |
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
| /// This defines a custom Diesel type for storing a 6-bit integer and a 58-bit | |
| /// integer in the same 64-bit SQL column | |
| use std::error::Error; | |
| use std::fmt; | |
| use std::io::Write; | |
| use diesel::backend::Backend; | |
| use diesel::types::{FromSqlRow,FromSql,ToSql,HasSqlType,IsNull,BigInt,Nullable}; | |
| use diesel::expression::AsExpression; | |
| use diesel::row::Row; |
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
| # RS256 | |
| # private key | |
| openssl genrsa -out rs256-4096-private.rsa 4096 | |
| # public key | |
| openssl rsa -in rs256-4096-private.rsa -pubout > rs256-4096-public.pem | |
| # ES512 | |
| # private key | |
| openssl ecparam -genkey -name secp521r1 -noout -out ecdsa-p521-private.pem | |
| # public key |