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 ( | |
"encoding/json" | |
"errors" | |
"fmt" | |
"reflect" | |
"github.com/tidwall/gjson" | |
) |
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
20:57:08 $ curl -v 'http://www.google.com/' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36' --compressed > /dev/null | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 172.217.6.36... | |
* TCP_NODELAY set | |
* Connected to www.google.com (172.217.6.36) port 80 (#0) | |
> GET / HTTP/1.1 | |
> Host: www.google.com | |
> Accept: */* |
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 mysql | |
COPY migrations /migrations | |
RUN cp /migrations/*.up.sql /docker-entrypoint-initdb.d/ |
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 ( | |
"bufio" | |
"fmt" | |
"net/http" | |
_ "net/http/pprof" | |
"os" | |
"reflect" | |
"runtime" |
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 dsn | |
type DSN string | |
func (d DSN) String() string { | |
i := strings.Index(string(d), "&password=") | |
if i == -1 { | |
return string(d) | |
} | |
ret := []byte(d) |
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/bash -xe | |
cat <<EOF > "${HOME}/.config/systemd/user/zoom.slice" | |
[Slice] | |
AllowedCPUs=0-4 | |
MemoryHigh=6G | |
EOF | |
cat /usr/share/applications/Zoom.desktop | sed -E 's#^(Exec=).*$#Exec=/usr/bin/systemd-run --user --slice=zoom.slice /opt/zoom/ZoomLauncher#' > "${HOME}/.local/share/applications/Zoom.desktop" |
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
export interface Result<T> { | |
success: true | |
data: T | |
} | |
export interface InternalError { | |
success: false | |
user: false | |
error: string | |
} |
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
http { | |
log_format json_combined escape=json | |
'{' | |
'"ts":"$time_iso8601",' | |
'"remote_addr":"$remote_addr",' | |
'"remote_user":"$remote_user",' | |
'"request_time":"$request_time",' | |
'"request":{' | |
'"http_referrer":"$http_referer",' | |
'"http_user_agent":"$http_user_agent",' |
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
B2_ACCOUNT_ID=XXXXXXXXXXXXXXXXXXXXXXXXX | |
B2_ACCOUNT_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
RESTIC_REPOSITORY=b2:XXXXXXXXXXXXXXXXXX:/ | |
RESTIC_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
BACKUP_PATHS="/home/naomi.nagata" | |
BACKUP_EXCLUDES="--exclude-file /home/rupert/.restic_excludes --exclude-if-present .exclude_from_backup" | |
RETENTION_DAYS=7 | |
RETENTION_WEEKS=4 |