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 | |
# this is a script to recursively shorten all the file names in a directory | |
function shorten() { | |
cd "$1" | |
pwd | |
# rename all the files in the directory to numbers | |
# if nessisary, move them to the temp directory to avoid name collisions | |
i=1 |
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 ( | |
"crypto/md5" | |
"encoding/binary" | |
"encoding/hex" | |
"fmt" | |
"net" | |
"github.com/miekg/dns" |
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 ( | |
"net" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func(resp http.ResponseWriter, req *http.Request) { | |
resp.Header().Set("Access-Control-Allow-Origin", "*") |
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" | |
"log" | |
"net" | |
"time" | |
"golang.org/x/crypto/ssh" | |
) |
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
use blake2::{Blake2b, Digest}; | |
pub struct CertHash<'a>(pub &'a str); | |
impl rustls::ServerCertVerifier for CertHash<'_> { | |
fn verify_server_cert( | |
&self, | |
_roots: &rustls::RootCertStore, | |
presented_certs: &[rustls::Certificate], | |
_dns_name: webpki::DNSNameRef<'_>, |
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" | |
"strings" | |
"github.com/9072997/jgh" | |
"github.com/godbus/dbus" | |
"github.com/holoplot/go-avahi" | |
) |
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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mQENBFsbXioBCACoC6cuYFjNjnlR6BZazWo08xj3+OYb8BVxgZOFJBhHd0S62ZpD | |
gxz8OSlstn2d+rGT9ORkk6D6TxurWsT6HStVqmxXSttqhKVghOUeHFmkXy89PiYp | |
hLhWvSkjBeAy4FlM7f1LxLjbkcoTTvzxVvmW3dBZV6tTOWCAgyKdaasu7zZQ4m7A | |
1Xx6QWkJ0GxU4y5aJMmTqt5idlm9MsJe1LnT8mxJH+vtOcNQPslNB2AVVapP7yWo | |
Sy02izlFQyVIusS7VhRCi5Lajx1Fb820yVcYgekv5NEb6xf3xCDLmM/1fuknRatG | |
eJv9p8E58YenKykTgq4UvWn842RIluwnVCWbABEBAAG0PkpvbmF0aG9uIFBlbm4g | |
KGJ1c2luZXNzIGNhcmQgaGFyZHdhcmUga2V5KSA8OTA3Mjk5N0BnbWFpbC5jb20+ | |
iQE9BBMBCAAnBQJbG14qAhsDBQkB4TOABQsJCAcCBhUICQoLAgQWAgMBAh4BAheA |
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
{ | |
"mappings": { | |
"my_new_type" : { | |
"properties" : { | |
"name" : { | |
"type" : "string", | |
"analyzer": "english" | |
}, | |
"age" : { | |
"type" : "long" |
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/php | |
<?php | |
// public domain, requires php curl extensions | |
// Note: this script can be called with a comma seperated list of | |
// shards from the source cluster (ex 1,3,4) and it will only pull | |
// data from those shards. This can allow you to run this script in | |
// parallell like this: | |
// For 5 shards, all primary, in 5 threads | |
// echo $logPrefix . "0 1 2 3 4" | xargs -n 1 -P 100 -- ./reindex.php | |
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
#include <stdio.h> | |
//#pragma warning(disable: 4996) | |
#include <stdlib.h> | |
#include <math.h> | |
#define NUMPOINTS 3 | |
#define STEPS 5000 | |
//#define G 6.673E-11 | |
#define G 5E-5 //bigger | |
#define CLOUDDIAMETER 1000 | |
#define MINMASS 1000 |
NewerOlder