View gh-dl-release
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 | |
# | |
# gh-dl-release! It works! | |
# | |
# This script downloads an asset from latest or specific Github release of a | |
# private repo. Feel free to extract more of the variables into command line | |
# parameters. | |
# | |
# PREREQUISITES | |
# |
View restic-backup.conf
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 |
View nginx.conf
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",' |
View ResultOrError.ts
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 | |
} |
View chill-zoom.sh
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" |
View dsn.go
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) |
View slicequeue.go
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" |
View Dockerfile.mysql
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/ |
View gist:f9d5bbcc7ef4af8962006c1f30039a6d
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: */* |
NewerOlder