Skip to content

Instantly share code, notes, and snippets.

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

Sergey Morozov ergoz

😈
let's rock
View GitHub Profile
@davidedmundson
davidedmundson / PlasmaNested.sh
Last active July 8, 2026 08:59
Run plasma from within gamescope
#!/bin/sh
# Remove the performance overlay, it meddles with some tasks
unset LD_PRELOAD
## Shadow kwin_wayland_wrapper so that we can pass args to kwin wrapper
## whilst being launched by plasma-session
mkdir $XDG_RUNTIME_DIR/nested_plasma -p
cat <<EOF > $XDG_RUNTIME_DIR/nested_plasma/kwin_wayland_wrapper
#!/bin/sh
@amunchet
amunchet / noVNCCopyPasteProxmox.user.js
Last active September 6, 2026 08:41
Copy/Paste for noVNC Proxmox
// ==UserScript==
// @name noVNC Paste for Proxmox
// @namespace http://tampermonkey.net/
// @version 0.2a
// @description Pastes text into a noVNC window (for use with Proxmox specifically)
// @author Chester Enright
// @match https://*
// @include /^.*novnc.*/
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @grant none
@lpsm-dev
lpsm-dev / main.rb
Created October 6, 2022 20:02
[GitLab] - Create Admin user in Rails Console
user = User.new(username: 'user', email: 'user@user.com.br', name: 'user', password: 'user', password_confirmation: 'user')
# Use it only if you wish user to be automatically confirmed. If skipped, user receives confirmation e-mail
user.skip_confirmation!
user.admin = true
user.save!
@MartinEesmaa
MartinEesmaa / youtube_formats.md
Last active September 28, 2026 04:24 — forked from AgentOak/youtube_formats.md
Youtube Format IDs

Note: This is all almost full YouTube ID informations. Original owner goes to AgentOak, modified version by Martin Eesmaa.

See the credits and also special thanks in below.

Before this gist has been forked, AgentOak made original gist back in November 13th 2019 and it was last updated on May 5th 2021.

From now on, this forked gist is maintained by Martin Eesmaa since 17th September 2022. I joined to yt-dlp Discord server on 3rd April 2026 with my Discord username: martineesmaa.

Last updated: 26 September 2026

@smashnet
smashnet / gitlab-artifacts-cleanup.py
Last active April 15, 2025 16:02 — forked from Pingu501/gitlab-artifacts-cleanup.py
GitLab Artifacts Clean-Up
"""
This is a small python script to clear up old gitlab build artifacts.
There are 3 variables you should modify:
* base_url: path to your gitlab
* access_token: your personal access token to make gitlab api calls
* delete_everything_older_than: configure the timedelta as you wish
!!IMPORTANT!!
By default this script does only make dry-runs and does not actually delete any files!
@fedej
fedej / Dockerfile
Created April 24, 2022 21:17
gRPC-web with nginx proxy
FROM node:16.14.2-alpine3.15 as client-builder
RUN apk update
RUN apk add git protoc
RUN mkdir /grpc
WORKDIR /grpc
RUN git clone -b 1.3.1 https://github.com/grpc/grpc-web
WORKDIR /grpc/grpc-web/net/grpc/gateway/examples/helloworld
RUN npm install
RUN wget -O /usr/local/bin/protoc-gen-grpc-web https://github.com/grpc/grpc-web/releases/download/1.3.1/protoc-gen-grpc-web-1.3.1-linux-x86_64
@nabokihms
nabokihms / kube_transport.go
Last active July 30, 2026 08:24
Middleware to periodically read Kubernetes token from the disk
// Update token periodically because BoundServiceAccountToken feature is enabled for Kubernetes >=1.21
// https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#bound-service-account-token-volume
// The behavior is the same as what Kubernetes clien-go does.
const (
renewTokenPeriod = 30 * time.Second
tokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token"
)
type kubeTransport struct {
@fideloper
fideloper / certbot.sh
Last active July 4, 2026 00:37
Certbot on Ubuntu, wildcard subdomains via CloudFlare DNS challenge
# Used on Ubuntu 18.04 and 20.04
# Find instructions for other OSes here: https://certbot.eff.org/instructions
# Install Certbot via Snaps
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
# Install DNS CloudFlare plugin
sudo snap set certbot trust-plugin-with-root=ok
@mattmc3
mattmc3 / optparsing_demo.zsh
Last active July 13, 2026 23:45
Zsh option parsing example
# Manual opt parsing example
#
# Features:
# - supports short and long flags (ie: -v|--verbose)
# - supports short and long key/value options (ie: -f <file> | --filename <file>)
# - supports short and long key/value options with equals assignment (ie: -f=<file> | --filename=<file>)
# - does NOT support short option chaining (ie: -vh)
# - everything after -- is positional even if it looks like an option (ie: -f)
# - once we hit an arg that isn't an option flag, everything after that is considered positional
function optparsing_demo() {
@Pingu501
Pingu501 / gitlab-artifacts-cleanup.py
Created December 9, 2021 11:22
GitLab Artifacts Clean-Up
"""
This is a small python script to clear up old gitlab build artifacts.
There are 3 variables you should modify:
* base_url: path to your gitlab
* access_token: your personal access token to make gitlab api calls
* delete_everything_older_than: configure the timedelta as you wish
!!IMPORTANT!!
By default this script does only make dry-runs and does not actually delete any files!