Skip to content

Instantly share code, notes, and snippets.

View qbart's full-sized avatar
🧀

Bartłomiej Wójtowicz qbart

🧀
View GitHub Profile
@qbart
qbart / set.sh
Created September 3, 2025 13:39
Setting secrets for differnte providers
gh secret set --repo Selleo/mentingo --env demo1-production -f .github.env.sample
aws ssm put-parameter --type "SecureString" --region "eu-central-1" --name "/learn/production/api/editable/SENTRY_DSN" --value "null"
az keyvault secret set --vault-name VAULT --name NAME-HERE --value "s3.me-central-1.amazonaws.com"
@qbart
qbart / random.ts
Created March 31, 2025 12:44
Random int TS
export const randomRange = (min: number, max: number) => {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
};
@qbart
qbart / dbs.sql
Created March 21, 2025 23:08
Postgres
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,
module "ci_vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 4.0"
name = "ci"
cidr = "10.0.0.0/16"
azs = ["${var.region}a"]
private_subnets = []
public_subnets = ["10.0.101.0/24"]
@qbart
qbart / Dockerfile
Created January 31, 2025 13:19
ubuntu dockerfile
FROM ubuntu:latest
CMD ["bash", "-c", "while :; do echo 'just looping here... nothing special'; sleep 1; done"]
@qbart
qbart / setup.sh
Last active October 6, 2024 13:35
Ubuntu server
#!/bin/bash
if command -v docker &> /dev/null
then
echo "Docker already installed."
else
apt update
apt -y install ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
@qbart
qbart / pg.sh
Created September 28, 2024 17:25
pg dump and resote with different owner
pg_dump $DATABASE_URL -F c -f db.dump
pg_restore -d $DATABASE_URL --no-owner --role=new_owner --clean db.dump
@qbart
qbart / build.sh
Created September 2, 2024 13:20
Docker build for mulit platform
docker build --platform linux/amd64,linux/arm64/v8,darwin/arm64,darwin/amd64 -f pgvector-with-postgis.Dockerfile -t pgvg .
@qbart
qbart / es.sh
Last active August 27, 2024 15:18
auth for ES 2.x
curl -kO https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/shield/2.4.6/shield-2.4.6.zip
curl -kO https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/shield/2.4.6/shield-2.4.6.zip.sha1
curl -kO https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/license/2.4.6/license-2.4.6.zip
curl -kO https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/license/2.4.6/license-2.4.6.zip.sha1
./bin/plugin install file:///usr/share/elasticsearch/downloads/license-2.4.6.zip
./bin/plugin install file:///usr/share/elasticsearch/downloads/shield-2.4.6.zip
@qbart
qbart / script.sh
Last active July 23, 2024 13:47
ffmpeg add captions
ffmpeg -i bubble-01-modeling.mp4 -vf subtitles=bubble-01-modeling.srt output.mp4