Skip to content

Instantly share code, notes, and snippets.

View felegy's full-sized avatar
🎯
Focusing

Gabor FELEGYHAZI felegy

🎯
Focusing
View GitHub Profile
@felegy
felegy / 85-u2f-screen-lock.rules
Created January 29, 2025 09:05 — forked from seanlinmt/85-u2f-screen-lock.rules
lock linux desktop via removal of U2F USB key or any USB device
# /etc/udev/rules.d/85-u2f-screen-lock.rules
# 2 REMOVE event rules for 2 different U2F devices
# to view the various properties you could use to create your rule use => udevadm monitor --property
# You may get multiple matches if your rule is too wide. No rule to unlock because it's not called 2FA for nothing.
# If you want to do that then you would need to add the matching rule for ADD events
ACTION=="remove", ENV{DEVTYPE}=="usb_device", ENV{SUBSYSTEM}=="usb", ENV{PRODUCT}=="1050/120/*", RUN+="/home/sean/bin/u2f-screen-lock.sh"
ACTION=="remove", ENV{ID_BUS}=="usb", ENV{ID_VENDOR_ID}=="096e", ENV{ID_MODEL_ID}=="0853", RUN+="/home/sean/bin/u2f-screen-lock.sh"
@felegy
felegy / compile_gnupg.sh
Last active December 23, 2024 13:20 — forked from roelds/compile_gnupg.sh
Compile gnupg 2.4.x from Source for Debian Testing
# assumes new Debian Testing VM, for purpose of compiling, running below as root
# uses most libs already available from apt, only compiles lib ntbtls
gnupg_version=${GNUPG:-2.4.6}
ntbtls_version=${NTBTLS:-0.3.1}
DESTDIR=${DESTDIR:-'/'}
lsb_release -a
uname -a
# Heroku stack version
# https://devcenter.heroku.com/articles/heroku-22-stack#using-heroku-22
ARG STACK_VERSION=22
ARG STACK=heroku-${STACK_VERSION}
FROM heroku/heroku:${STACK_VERSION} AS base
# local profile.d
RUN tee -a /etc/profile <<'EOF'
if [ -d $HOME/.profile.d ]; then
@felegy
felegy / rancher-over-cloudflare-tunnel.md
Last active June 20, 2023 10:40
Proxying Rancher UI over Cloudflare via CF tunnel with Rancher`s built-in Kubernetes api proxy
#!/usr/bin/env bash
SWAP_SIZE=${SWAP_SIZE-"4G"}
SWAP_FILE=${SWAP_FILE-"/swap"}
fallocate -l "$SWAP_SIZE" "$SWAP_FILE"
chmod 600 "$SWAP_FILE"
mkswap "$SWAP_FILE"
swapon "$SWAP_FILE"
echo "$SWAP_FILE swap swap defaults 0 0" >>/etc/fstab
swapon --show
@felegy
felegy / error.html
Last active November 8, 2021 15:18
Nginx custom error page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Your Business</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--# if expr="$status = 502" -->
<meta http-equiv="refresh" content="2">
<!--# endif -->
</head>
@felegy
felegy / http-get.sh
Last active September 22, 2022 13:25
Poor man's `CURL` or `WGET`
#!/usr/bin/env sh
#
# Usage: http-get.sh [PATH PORT HOST]
#
# Environment variables
# REQUEST_PATH - path of the request, default value `/`
# REQUEST_PORT - http port, default value `80`
# REQUEST_HOST - host of the request, default value `localhost`
REQUEST_PATH=${1:-${REQUEST_PATH-/}}

Cake Build FakeProcessRunner

The main purpose of this to dump the process command and arguments in string format for later execution or use it (for example use to run inside Docker). I would like to run the system related tests in a build process based on cake generated test commands in separated environments (like Docker swarm service in compose/swarm stack).

Cake dotnet Test command:

DotNetCoreTest(SolutionFile, new DotNetCoreTestSettings
{
    Configuration = configuration,
# use docker_provider: "ee", "ce", "master" or ""
$docker_provider = "master"
$docker_version = "19.03.8"
if (Test-Path env:docker_provider) {
$docker_provider = $env:docker_provider
}
if (Test-Path env:docker_version) {
$docker_version = $env:docker_version
}
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDynuma5eJ1JvkpyAUUt8uQI+IvMBJ3fKBo9SJQr3Po/ho1aLFSEv5tUC20j2UAjNVmB2iFV1VVIOC0uigMDtV1T5PvLKjjjXHGYmicH/vfuiuf7dFYmMYPD225dNfnpYHisjxuItAezd8Rdbtsi4TP0HldNQJuAlla1hl5WACN2IBngnwmSatNa116yAbsgzK7MLsXY2w7rgiSyBqtrktiW5wrP00an2ImUDMBIsh7HyaGFLi/eOzEZu8GUd4yaBvGqn5qpOs5VSX+U/qSTfD+nyNEYKN5BIEH+ctBaNQP3vwHvf73CuNuIqmV88dJ/Gun1o+GlxtaL+/BmY8haz4n6AGr9pO1KVgDH5YNUcybpAsH+DzDvSc//wU/3f1qhsbezLw6oFCqcL8xmRu2eiFRHh/3UqDb3jrhYiQ5r6/3+Yv78S8PgU0fwBCK1t0sU9IfsLmLt6Jrmknxxg8UD6GjNc+KG6EvfMOqB2YKR2dI/k44OKNwwEcS6M1rulQS2U9eaAs97GyhU2umNG2RvF+eiCUwI/Uisz9F0yEoU2veop6JAFTd4GSNM758m0OswEhW8++/TFpuA5WEnvi+5ccuhJT6rKJuS194p4DpB3QzKOLxzWNQVRpcXSc7lO5RjtELj5mPP4zc5D6x5jtntNNyd5wjYxCg2D3uCOMPSb/+Yw== cardno:000612033806