Skip to content

Instantly share code, notes, and snippets.

View C-Duv's full-sized avatar

Duvergier Claude C-Duv

View GitHub Profile
@asheroto
asheroto / 1-Windows-Setup-TPM-Bypass-Internet-Bypass.md
Last active May 8, 2024 19:07
Windows setup answer file working on Windows 11. Skips OOBE (EULA, networking) and pretty much everything else during normal setup.

Windows 10/11 Setup Answer File + TPM Bypass + CPU requirement + storage requirement + Internet requirement bypass + disable BitLocker automatic encryption

This is a Windows setup answer file working on Windows 10 and 11.

What it does:

  • Skips OOBE (EULA, networking) and pretty much everything else during normal setup
  • Sets Keyboard + Language to English (US)
  • Set timezone to Central Standard Time
  • Creates user "User" with password of "password"
@QuietNoise
QuietNoise / G910 Keyboard Fix.ahk
Last active March 7, 2024 11:34
G910 Keyboard Fix for double typing problem
;What does this script do?
;It's a workaround for broken G910 Logitech keyboards (possibly other keyboards too) whereby some keys occasionally register multiple keystrokes for one kkkkkeypress.
;The key bug appears because keyboard registers multiple keystrokes in a very short timespan even though you pressed the key only once.
;This script makes it so the subsequent keystrokes registered in a very short timespan are ignored thus outputing the key only for the first stroke.
;List all your broken keys between quotes below. I.e. if your broken keys are g and f then the line below shoud be
;brokenKeys := "gf"
brokenKeys := "gf"
@f-steff
f-steff / excel formulas.md
Last active April 23, 2024 08:21
Excel formulas to calculate IP values such as Netmask, IP range start, IP range end, Broadcast IP, Number of hosts.

Excel formulas to calculate IP values - Works in Excel and Google Sheet.

Updated 2023-12-11: Hosts calculation updated to support CIDR or 31 and 32.

Prerequisites:

  • A1 contains an IP address, such as 10.0.0.2
  • B1 contains the number of bits in the netmask (CIDR) such as 24

The below formulas then go into C1, D1 etc. to perform the various calculations. Some calculations depends on other calculations.

@maxried
maxried / $README.md
Last active January 12, 2024 10:43
Automatically Sign Kernels After Installation

This script goes into /etc/kernel/postinst.d. You have to make it executable by root, e.g. chown root:root /etc/kernel/postinst.d/00-signing ; chmod u+rx /etc/kernel/postinst.d/00-signing. It assists you with automatically signing freshly installed kernel images using the machine owner key in a way similar to what dkms does. This is mainly useful if you want to use mainline kernels on Ubuntu on Secure Boot enabled systems. This needs shim-signed to be set up. If you have questions this one might help you: While I made this for Ubuntu 20.04, it should work on current Debian based distributions. YMMV.

@daladim
daladim / run-as-cron.sh
Last active November 6, 2023 09:42
Run a command or a script as cron would
#!/bin/bash
# Run as if it was called from cron, that is to say:
# * with a modified environment
# * with a specific shell, which may or may not be bash
# * without an attached input terminal
# * in a non-interactive shell
# This scripts supports cron jobs run by any user, just run it as the target user (e.g. using sudo -u <username>)
# An up-to-date version of this script may be available at https://github.com/daladim/run-as-cron
@zealot128
zealot128 / README.md
Last active October 5, 2022 15:39
Papercut simple replacement = IMAP to print

Papercut replacement

  • imap to print
  • use case: on a Raspi oder Office server that hangs in the same LAN like the printer and can print via cups/system using "lp"
  • just uses lp under the hood
  • uses the awesome mail_room Gem under the hood to handle imap connection, which does most of the lifting

Send Mail as a authorized return-path (via regex matching) to your mailbox, it will print all pdf Attachments.

USAGE

@holmberd
holmberd / php-pools.md
Last active April 19, 2024 07:24
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@mpneuried
mpneuried / Makefile
Last active May 4, 2024 13:46
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@thomasdarimont
thomasdarimont / readme.md
Last active March 15, 2024 08:56
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Setup

Add this to your .profile, .bashrc, .zshrc...

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
  fi
 echo "$result" | tr '_-' '/+' | openssl enc -d -base64
@yunghoy
yunghoy / gist:a425f91824d26461bb2e3653bc56ebbf
Last active June 2, 2022 00:34
AMQP library (RabbitMQ) - async/await
alias babel-node='babel-node --presets stage-0'
------ RECV ------
// babel-node recv2.js "#"
// babel-node recv2.js "kern.*"
const amqp = require('amqplib');
const args = process.argv.slice(2);
if (args.length == 0) {