Skip to content

Instantly share code, notes, and snippets.

View ergoz's full-sized avatar
😈
let's rock

Sergio [ergoz] Escarchado ergoz

😈
let's rock
View GitHub Profile
@ergoz
ergoz / kubectl-jq-select-not-null.sh
Created June 26, 2025 17:56 — forked from zulhfreelancer/kubectl-jq-select-not-null.sh
kubectl/jq - How to select/filter not `null` objects?
# List all deleted pods
kubectl get pods -o json | jq -r '.items[] | select(.metadata.deletionTimestamp != null)'
@ergoz
ergoz / os.sh
Created June 23, 2025 13:48 — forked from gmolveau/os.sh
Bash/shell script detect/check OS and distribution (+WSL Windows Subsystem for Linux)
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
local DISTRIB=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
if [[ ${DISTRIB} = "Ubuntu"* ]]; then
if uname -a | grep -q '^Linux.*Microsoft'; then
# ubuntu via WSL Windows Subsystem for Linux
else
# native ubuntu
fi
elif [[ ${DISTRIB} = "Debian"* ]]; then
# debian
@ergoz
ergoz / touchid_sudo.sh
Created June 18, 2025 15:24 — forked from RichardBronosky/touchid_sudo.sh
Use TouchID for sudo on modern MacBook Pro machines
#!/bin/bash
# curl -sL https://gist.githubusercontent.com/RichardBronosky/31660eb4b0f0ba5e673b9bc3c9148a70/raw/touchid_sudo.sh | bash
# This script is ready to copy-paste in whole, or just the line above (without the leading #)
# Use TouchID for sudo on modern MacBook Pro machines
# This script adds a single line to the top of the PAM configuration for sudo
# See: https://apple.stackexchange.com/q/259093/41827 for more info.
touchid_sudo(){
@ergoz
ergoz / Creating an AUR Package.md
Created June 11, 2025 15:28 — forked from keilmillerjr/Creating an AUR Package.md
How to create and manage an AUR package. #AUR #ARCH #makepkg #PKGBUILD
@ergoz
ergoz / compose.yml
Created June 9, 2025 00:06 — forked from benuski/compose.yml
changedetection.io and browserless v2 docker compose
version: '3.2'
services:
changedetection:
image: ghcr.io/dgtlmoon/changedetection.io:latest
container_name: changedetection
hostname: changedetection
volumes:
- changedetection-data:/datastore
environment:
@ergoz
ergoz / 16.10-and-older.rb
Last active June 22, 2025 14:33 — forked from lpsm-dev/main.rb
[GitLab] - Create Admin user in Rails Console
u = User.new(username: 'test_user', email: '[email protected]', name: 'Test User', password: 'password', password_confirmation: 'password')
# u.assign_personal_namespace
u.skip_confirmation! # Use only if you want the user to be automatically confirmed. If you do not use this, the user receives a confirmation email.
u.save!
@ergoz
ergoz / gitlab-backup-to-minio.md
Created May 23, 2025 15:27 — forked from ansemjo/gitlab-backup-to-minio.md
upload gitlab omnibus backups to minio

setup Minio somewhere

Minio is an object storage server compatible with the S3 protocol. Head to https://minio.io/ to learn more.

Hint: You might want to use MINIO_WORM=on to pretect against accidental or malicious deletion of your backups.

seperate users with iam policies

Since RELEASE.2018-10-18T00-28-58Z minio supports seperate users with attached IAM policies. Instead of (or additionally to) using MINIO_WORM=on you could create a new user and attach a writeonly policy:

@ergoz
ergoz / angie.md
Created May 6, 2025 14:38 — forked from llcawc/angie.md
Сервер Angie для Ubuntu

Настройка сервера Angie

сперва настраиваем Ubuntu или Debian: подключение к серверу через терминал с SSH c логином от root

ssh root@ip_server

Обновляет систему

@ergoz
ergoz / ssh.bash
Created May 5, 2025 18:25 — forked from hyunbinseo/ssh.bash
Setup SSH (macOS, YubiKey FIDO)
# Moved to https://github.com/hyunbinseo/blog/blob/master/posts/setup-ssh.md
### Preparation ###############################################################
# macOS bundled OpenSSH does not support FIDO.
# https://developer.apple.com/forums/thread/698683
# https://github.com/apple-oss-distributions/OpenSSH/pull/1
brew install openssh
@ergoz
ergoz / GnomeNested.sh
Created May 3, 2025 16:40 — forked from lucsoft/GnomeNested.sh
Run plasma from within gamescope
#!/bin/sh
# Remove the performance overlay, it meddles with some tasks
unset LD_PRELOAD
# Fetch Resolution
RES=$(xdpyinfo | awk '/dimensions/{print $2}')
# Apply Resolution in env and start a new nested gnome with a new dbus
env MUTTER_DEBUG_DUMMY_MODE_SPECS=$RES dbus-run-session -- gnome-shell --wayland --nested