Skip to content

Instantly share code, notes, and snippets.

@ayush--s
ayush--s / Dockerfile
Created December 17, 2023 07:27
docker custom runtime
FROM public.ecr.aws/lambda/provided:latest
COPY bootstrap ${LAMBDA_RUNTIME_DIR}
COPY function.sh ${LAMBDA_TASK_ROOT}
RUN chmod a+x ${LAMBDA_RUNTIME_DIR}/bootstrap
CMD [ "function.handler" ]
REPOSITORY TAG IMAGE ID CREATED SIZE
ghcr.io/cloudquery/cloudquery latest a200c736c13e 6 days ago 34.7MB
timescale/timescaledb latest-pg15 80c18ad8ec6e 11 days ago 388MB
bridgecrew/checkov latest 8720c8fa38b4 4 weeks ago 456MB
poetry py36 fa08a983b2a3 4 weeks ago 89.8MB
kopia/kopia 20230328.0.94629 b2dc63e4220e 4 weeks ago
; <<>> DiG 9.10.6 <<>> TXT squadstack.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24996
;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
FROM caddy:2.6.2-builder-alpine AS builder
RUN xcaddy build \
--with github.com/caddyserver/nginx-adapter \
--with github.com/hairyhenderson/caddy-teapot-module@v0.0.3-0
FROM caddy:2.6.2-alpine
COPY Caddyfile /etc/caddy/Caddyfile
@ayush--s
ayush--s / finds.csv
Last active September 5, 2022 07:56
spotify playlist dump
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
"Track URI","Track Name","Artist URI(s)","Artist Name(s)","Album URI","Album Name","Album Artist URI(s)","Album Artist Name(s)","Album Release Date","Album Image URL","Disc Number","Track Number","Track Duration (ms)","Track Preview URL","Explicit","Popularity","Added By","Added At"
"spotify:track:4axJVUV9DMlM9YdeI0uhOM","1972","spotify:artist:4HF38EKEfCpf5qexvLmt2E","Tobias","spotify:album:2bKTPc28bPoq57uE4FXxw9","1972","spotify:artist:4HF38EKEfCpf5qexvLmt2E","Tobias","2020-02-14","https://i.scdn.co/image/ab67616d0000b273e2c4a4d38ef2a11eb8d85389","1","1","525769","https://p.scdn.co/mp3-preview/af0384223822b0060b31c8d58c5d4be349846ea6?cid=9950ac751e34487dbbe027c4fd7f8e99","false","7","spotify:user:ayush--s","2020-03-21T20:45:54Z"
"spotify:track:4cOVTA2GfYTHw99AJDQpHo","The Worst In Me","spotify:artist:6qgnBH6iDM91ipVXv28OMu, spotify:artist:0NIIxcxNHmOoyBx03SfTCD","KAYTRANADA, Tinashe","spotify:album:5FQ4sOGqRWUA5wO20AwPcO","BUBBA","spotify:artist:6qgnBH6iDM91ipVXv28OMu","KAYTRANADA","2019-12-13","https://i.sc
@ayush--s
ayush--s / chunk-details.sql
Created October 15, 2021 10:27
get chunk size + start, end for given table in timescaledb
WITH size AS (
SELECT
concat(chunk_schema, '.', chunk_name) AS name,
round(table_bytes / (1024 * 1024.0), 2) AS table_megs,
round(index_bytes / (1024 * 1024.0), 2) AS index_megs,
round(total_bytes / (1024 * 1024.0), 2) AS total_megs
FROM
chunks_detailed_size ('%%table%%')
ORDER BY
chunk_name,
#!/usr/bin/bash
# convert '*.png[800x>]' main.png
for i in *.png ; do
pngquant --quality 90 --speed 1 $i --output fin/final-$i --force
done
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
@ayush--s
ayush--s / Dockerfile
Created September 20, 2020 10:13
poetry
FROM ubuntu:focal
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.8 wget python3-distutils python3-venv \
&& rm -fr /var/cache/apt/*
RUN wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
&& python3.8 get-pip.py \
#!/bin/bash
intern=LVDS-1
extern=HDMI-1
if xrandr | grep "$extern disconnected"; then
xrandr --output "$extern" --off --output "$intern" --auto
else
xrandr --output "$intern" --off --output "$extern" --auto
fi