Skip to content

Instantly share code, notes, and snippets.

@cozingo
cozingo / defineforalltables.sql
Last active August 17, 2024 09:59
log every insert/update/delete of each table in db
DO $$
DECLARE
table_name TEXT;
trigger_name TEXT;
query TEXT;
BEGIN
FOR table_name IN
SELECT tablename
FROM pg_tables
WHERE schemaname = 'public'
@cozingo
cozingo / common
Created April 17, 2024 09:09
k8s kubernetes kubeadm install
multipass launch --name master --cpus 2 -m 2G -d 10G
multipass shell master
sudo hostnamectl set-hostname "nodenameofcluster"
sudo modprobe overlay
sudo modprobe br_netfilter
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
@cozingo
cozingo / dockerfile
Created October 16, 2023 15:27
docker debian archive
RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \
-e 's|security.debian.org|archive.debian.org/|g' \
-e '/stretch-updates/d' /etc/apt/sources.list
@cozingo
cozingo / mitm
Created March 12, 2023 13:00
apk https intercept
apk-mitm
https://github.com/shroudedcode/apk-mitm/
@cozingo
cozingo / gist:43da4b6bcd45628e5c20a2a7bb784a72
Created January 24, 2023 12:02
desktop entry start menu
~/.local/share/applications
@cozingo
cozingo / error.php
Created December 28, 2022 19:37
show all errors in php
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
@cozingo
cozingo / docker
Last active March 5, 2022 15:43
docker
docker compose run --rm composer install
docker exec -it [containder-id] /bin/bash | /bin/sh
docker container|image list
@cozingo
cozingo / revert
Created January 24, 2022 12:48
git revert
git revert --no-commit #commit
@cozingo
cozingo / postgre.sql
Created January 24, 2022 08:32
fulltext search
1. gin dolwe insert, bistree poisk, bolwe mesto zanimaet
2. gist menwe insert, medlenee poisk, menwe mesto zanimaet
@cozingo
cozingo / ffmpeg
Created September 14, 2021 12:35
convert video to mp3
ffmpeg -i "file" -vn out.mp3