$ cat /etc/h2o/h2o.conf
listen: 8080
http1-request-timeout: 5
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 | |
regex='(s3)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]' | |
if [[ $@ =~ $regex ]] | |
then | |
aws s3 ls $@ --recursive | grep -v -E "(Bucket: |Prefix: |LastWriteTime|^$|--)" | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024/1024" GB"}' | |
else | |
echo "format err, input e.g. s3://bucket/path/to/calc" | |
exit 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 ( | |
"fmt" | |
"net/url" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/credentials/stscreds" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/s3" |
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" | |
"net/url" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/credentials/stscreds" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/s3" |
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
url_effective\t\t: %{url_effective}\n | |
http_code\t\t: %{http_code}\n | |
http_connect\t\t: %{http_connect}\n | |
time_total\t\t: %{time_total}\n | |
time_namelookup\t\t: %{time_namelookup}\n | |
time_connect\t\t: %{time_connect}\n | |
time_appconnect\t\t: %{time_appconnect}\n | |
time_pretransfer\t: %{time_pretransfer}\n | |
time_redirect\t\t: %{time_redirect}\n | |
time_starttransfer\t: %{time_starttransfer}\n |
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 <WioCellLibforArduino.h> | |
WioCellular Wio; | |
void setup() { | |
delay(200); | |
SerialUSB.begin(115200); | |
SerialModule.begin(115200); | |
SerialUSB.println(""); |
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" | |
"net/http" | |
"net/http/httputil" | |
) | |
func handler(w http.ResponseWriter, r *http.Request) { | |
var formatted, err = httputil.DumpRequest(r, true) |
I hereby claim:
- I am 2matzzz on github.
- I am 2matzzz (https://keybase.io/2matzzz) on keybase.
- I have a public key ASCwbIugCDY3ZsV8t6iStaVkz2rocD0G-3YFTomomQvlOgo
To claim this, I am signing this object:
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
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import os | |
import sys | |
from urllib.parse import unquote | |
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): | |
def do_POST(self): | |
file_name = os.path.basename(unquote(self.path)) | |
if file_name: |
OlderNewer