Skip to content

Instantly share code, notes, and snippets.

View crainte's full-sized avatar
🏠
Working from home

crainte

🏠
Working from home
View GitHub Profile
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@wookietreiber
wookietreiber / time.rules
Created May 26, 2020 08:12
Prometheus/Alertmanager rules for business hour based inhibition (Germany/Saxony)
---
groups:
- name: datetime
interval: 60s
rules:
- record: daylight_saving_time
expr: |
CREATING syn flood and web work load:
%hping3 -I p1p1 -p 8701 -S -V --flood 192.168.50.1
%wrk -t8 -c1000 -d10s http://192.168.50.1:8701
DRIVER VERSION
%route add default gw a.b.31.254 em1
%ethtool -i p1p1
CPU
Set the cpupower to the approriate governor profile.
@OnlyInAmerica
OnlyInAmerica / make-mega-adblock-hostsfile.sh
Last active September 24, 2024 14:40
Create Mega Adblock Hostsfile for use with Dnsmasq (Modified from Pi-hole)
#!/bin/bash
# Modified Pi-hole script to generate a generic hosts file
# for use with dnsmasq's addn-hosts configuration
# original : https://github.com/jacobsalmela/pi-hole/blob/master/gravity-adv.sh
# The Pi-hole now blocks over 120,000 ad domains
# Address to send ads to (the RPi)
piholeIP="192.168.1.1"
outlist='./final_blocklist.txt'
@EntropyWorks
EntropyWorks / aptly-mirror.sh
Last active September 17, 2021 17:46
This is my script for mirroring a bunch of apt repos. This only touches the very basics of what (aptly)[http://www.aptly.info/] can do.
#!/bin/bash
#
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
# Authored by Yazz D. Atlas <yazz.atlas@hp.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active October 12, 2025 16:23
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup