Skip to content

Instantly share code, notes, and snippets.

View unixfox's full-sized avatar

Émilien (perso) unixfox

View GitHub Profile
@superbrothers
superbrothers / kubectl-delete_all
Last active May 22, 2024 19:07
Kubernetes: Delete all objects in the namespace
kubectl delete "$(kubectl api-resources --namespaced=true --verbs=delete -o name | tr "\n" "," | sed -e 's/,$//')" --all
@quyenlv
quyenlv / remote-capture-packet-simple.rst
Last active April 24, 2024 09:24
Remote capturing packet with tcpdump and wireshark.

Topology

+------------------+                    +----------------------+
|   Local host     |  tcpdump over ssh  |    Remote Host       |
|                  |--------------------|                      |\ eth0
| +--------------+ |--------------------|                      |/
| |   Wireshark  | |                    |  tcpdump -i eth0...  |
@ServerlessBot
ServerlessBot / IAMCredentials.json
Last active December 20, 2023 16:50
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
@gregorycollins
gregorycollins / 00-hacking-tilix-smaller-chrome.md
Last active November 16, 2023 12:55
How to hack your tilix to make tab/window chrome smaller

How to hack your Tilix to make tab/window chrome smaller

I really like the Tilix terminal emulator, but I hate how much space the default chrome takes up:

before

Those tabs are enormous! But did you know that this is user-configurable? GTK3 widgets are styled using CSS, and you can override the rules in ~/.config/gtk-3.0/gtk.css. Add the following rules to this file:

@nicman23
nicman23 / upgrade
Created April 21, 2018 06:34
Openwrt upgrade script
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
start_service() {
if [ -e /root/.upgrade ]
then exit
else touch /root/.upgrade
fi
@fox-srt
fox-srt / mitm6.rules
Created January 26, 2018 17:06
MITM6 IDS Signatures
# Snort & Suricata signatures for:
# https://blog.fox-it.com/2018/01/11/mitm6-compromising-ipv4-networks-via-ipv6
alert udp fe80::/12 [546,547] -> fe80::/12 [546,547] (msg:"FOX-SRT - Policy - DHCPv6 advertise"; content:"|02|"; offset:48; depth:1; reference:url,blog.fox-it.com/2018/01/11/mitm6-compromising-ipv4-networks-via-ipv6/; threshold:type limit, track by_src, count 1, seconds 3600; classtype:policy-violation; sid:21002327; rev:2;)
alert udp ::/0 53 -> any any (msg:"FOX-SRT - Suspicious - WPAD DNS reponse over IPv6"; byte_test:1,&,0x7F,2; byte_test:2,>,0,6; content:"|00 04|wpad"; nocase; fast_pattern; threshold: type limit, track by_src, count 1, seconds 1800; reference:url,blog.fox-it.com/2018/01/11/mitm6-compromising-ipv4-networks-via-ipv6/; classtype:attempted-admin; priority:1; sid:21002330; rev:1;)
@Atinux
Atinux / async-foreach.js
Last active October 10, 2023 03:04
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@0x63lv
0x63lv / hex_to_str.py
Last active August 14, 2019 16:48 — forked from vigneshwaranr/migrator.sh
Script to convert Grafana SQLite dumps into PostgreSQL compatible dumps, and import it into PostgreSQL
#!/bin/env python
import fileinput
import re
import binascii
for line in fileinput.input(inplace = 1):
if re.search('X\'([a-fA-F0-9]+)\'', line) is not None:
unhexed_string = binascii.unhexlify(re.search('X\'([a-fA-F0-9]+)\'', line).group(1))
unhexed_string = unhexed_string.replace("'", "''")
@brianclemens
brianclemens / sudoers.lecture
Created July 8, 2017 04:04
hardcore sudo lecture
 "Bee" careful __
with sudo! // \
\\_/ //
''-.._.-''-.._.. -(||)(')
'''
@denisu
denisu / fastly.txt
Created June 18, 2017 21:08
Fastly IPv6 Hosts
2a04:4e42::1 5742636757417984-fe1.pantheonsite.io
2a04:4e42::2 5724160613416960-fe2.pantheonsite.io
2a04:4e42::3 5746821397741568-fe3.pantheonsite.io
2a04:4e42::4 5714315743068160-fe4.pantheonsite.io
2a04:4e42::72 *.avvosites.com
2a04:4e42::74 www.aclu.org
2a04:4e42::78 *.twimg.com
2a04:4e42::79 *.wixstatic.com
2a04:4e42::80 admin.wes.bibbed.org
2a04:4e42::81 www.bbc.com