Skip to content

Instantly share code, notes, and snippets.

Working from home

Istvan l1x

Working from home
View GitHub Profile
l1x /
Created Jul 21, 2022
Getting all objects in a S3 bucket (based on a prefix)
def get_files(bucket: str, prefix: str):
max_files = 100000
files = []
truncated = True
continuation_token = None
response = s3_client.list_objects_v2(
Két végéről égetem a gyertyám,
reggelig sem tart ki tán, tudom,
de addig ellenség s te édes jóbarát,
hullócsillag fényemnél vigasztalódj
l1x /
Created Apr 10, 2022
Creating an AWS Apigateway HTTP API with custom domain
resource "aws_apigatewayv2_domain_name" "api-gw-domain-name" {
domain_name = var.domain-name
domain_name_configuration {
certificate_arn = var.acm-certificate-arn
endpoint_type = "REGIONAL"
security_policy = "TLS_1_2"
doas apt-get install bpfcc-tools linux-headers-(uname -r)

Creating a mirror using two disks

This uses the partition UUID to be able to tolarate device name changes.

 doas /sbin/mdadm \
 --verbose --create /dev/md/nas0 \
 --level=mirror --raid-devices=2 \
 /dev/disk/by-partuuid/7b139fcf-e971-4806-b0f9-cbbd8c1d24de \
View npm.insane.txt
doas apt install npm
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
binutils binutils-aarch64-linux-gnu binutils-common build-essential dpkg-dev fakeroot g++ g++-10 gcc gcc-10 gyp libalgorithm-diff-perl
libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan6 libatomic1 libbinutils libc-dev-bin libc-devtools libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0
libctf0 libfakeroot libgcc-10-dev libitm1 libjs-inherits libjs-is-typedarray libjs-psl libjs-typedarray-to-buffer liblsan0 libnode-dev libnsl-dev libssl-dev
libstdc++-10-dev libtirpc-dev libtsan0 libubsan1 libuv1-dev linux-libc-dev make manpages-dev node-abbrev node-agent-base node-ajv node-ansi node-ansi-regex
node-ansi-styles node-ansistyles node-aproba node-archy node-are-we-there-yet node-asap node-asn1 node-assert-plus node-asynckit node-aws-sign2 node-aws4
aws:s3:Bucket (l1x.tld):
    error: aws:s3/bucket:Bucket resource 'l1x.tld' has a problem: 
    Conflicting configuration arguments: "acl": conflicts with grant. Examine values at 'Bucket.Acl'.
    error: aws:s3/bucket:Bucket resource 'l1x.tld' has a problem: 
    Conflicting configuration arguments: "grant": conflicts with acl. Examine values at 'Bucket.Grants'.
(venv) ➜  mano.local bi-data git:(main)
> pip install polars
Collecting polars
  Downloading polars-0.10.10.tar.gz (543 kB)
     |████████████████████████████████| 543 kB 2.0 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing wheel metadata (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
l1x /
Created Sep 28, 2021
Installing PostgreSQL 13 on Amazon Linux 2
sudo amazon-linux-extras enable postgresql13
sudo yum -y clean metadata
sudo yum -y install postgresql

➜ rpi4-3.lan ui git:(main) ✗ cat docker/base/Dockerfile

FROM debian:bullseye-slim
RUN DEBIAN_FRONTEND=noninteractive apt-get clean && apt-get update \
&& apt install apt-utils && apt-get install doas -y

RUN useradd -m -u 5000 -s /sbin/nologin app || :
RUN useradd -m -u 5001 -s /bin/bash admin || :
RUN echo 'permit nopass admin as root' > /etc/doas.conf