Skip to content

Instantly share code, notes, and snippets.

View qbart's full-sized avatar
🧀

Bartłomiej Wójtowicz qbart

🧀
View GitHub Profile
resource "aws_amplify_app" "cloud" {
name = "xxxxx"
description = "Documentation."
platform = "WEB"
enable_basic_auth = true
basic_auth_credentials = base64encode("xxxx")
tags = {
namespace = "devops"
@qbart
qbart / main.go
Created January 24, 2024 20:14
sns webhook
type SubscriptionConfirmation struct {
Type string `json:"Type"`
MessageId string `json:"MessageId"`
Token string `json:"Token"`
TopicArn string `json:"TopicArn"`
Message string `json:"Message"`
SubscribeURL string `json:"SubscribeURL"`
Timestamp string `json:"Timestamp"`
SignatureVersion string `json:"SignatureVersion"`
Signature string `json:"Signature"`
@qbart
qbart / css.html
Created December 4, 2023 19:34
dot tailwind
<div
class="absolute inset-0 h-full w-full bg-white bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px]"
></div>
@qbart
qbart / policy.json
Created September 8, 2023 21:18
minio policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:DeleteObjectTagging",
"s3:PutObject",
"s3:GetObject",
"s3:GetObjectTagging",
@qbart
qbart / run.sh
Created September 7, 2023 21:48
generate httpaccess file
docker run --rm --entrypoint htpasswd httpd:2 -Bbn testuser testpassword | Set-Content -Encoding ASCII auth/htpasswd
@qbart
qbart / settings.json
Last active October 7, 2024 20:54
VSCODE
{
"files.associations": {
"*.nomad.hcl": "terraform",
"*.nginx": "nginx",
"*.templ": "html",
"*.shader" : "hlsl"
},
"workbench.tree.indent": 20,
"telemetry.telemetryLevel": "off",
"vim.easymotion": true,
@qbart
qbart / list_databases.sql
Last active June 8, 2023 20:09
postgres catalog
select
d.oid as id,
d.datname AS name,
d.datdba AS owner_id,
auth.rolname AS owner_name,
d.datistemplate AS is_template,
d.datconnlimit AS connection_limit,
d.dattablespace AS tablespace_id,
ts.spcname AS tablespace_name,
pg_size_pretty( pg_database_size(d.datname)) as size,
@qbart
qbart / Caddyfile.tmpl
Created April 17, 2023 20:15 — forked from optiz0r/Caddyfile.tmpl
Caddy with Nomad + Consul
{{- range services -}}
{{- if .Name | contains "sidecar" | not -}}
{{- $groupedServices := (service .Name | byMeta "caddy_enable") -}}
{{- $enabledServices := (index $groupedServices "true" ) -}}
{{- range $enabledServices -}}
{{- $vhost := index .ServiceMeta "caddy_vhost" -}}
{{- scratch.MapSetX "vhosts" $vhost . -}}
{{- end -}}
{{- end -}}
{{- end -}}
@qbart
qbart / cli.md
Last active February 10, 2023 17:37
generate terraform app
@qbart
qbart / envs.go
Created February 4, 2023 11:14
export env with "*" - show last 3
for k, v := range secrets {
envs = append(envs, fmt.Sprint(k, "=", v))
startFrom := len(v)
if len(v) > 10 {
startFrom -= 3
}
hashedV := fmt.Sprint(strings.Repeat("*", startFrom), v[startFrom:])
fmt.Fprintf(w, "exporting %s%s=%s%s%s\n", ctc.ForegroundGreen, k, ctc.ForegroundBlue, hashedV, ctc.Reset)
}