Skip to content

Instantly share code, notes, and snippets.

@eqhmcow
eqhmcow / hfsc-shape.sh
Last active October 22, 2024 13:55
HFSC - linux traffic shaping's best kept secret
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.
@bradoaks
bradoaks / hfsc-shape.sh
Created April 25, 2011 14:51 — forked from eqhmcow/hfsc-shape.sh
HFSC - linux traffic shaping's best kept secret
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.
@plepe
plepe / gist:52ecc9f18efb32c68d18
Last active November 3, 2024 00:27
MDADM and LVM cheat sheet

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
@tuxfight3r
tuxfight3r / tcp_flags.txt
Last active October 31, 2024 00:32
tcpdump - reading tcp flags
##TCP FLAGS##
Unskilled Attackers Pester Real Security Folks
==============================================
TCPDUMP FLAGS
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere)
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere)
Pester = PSH = [P] (Push Data)
Real = RST = [R] (Reset Connection)
Security = SYN = [S] (Start Connection)
@TheStrix
TheStrix / armani-Implement-kexec-hardboot.patch
Created September 4, 2015 14:34
Kexec-hardboot patch for Xiaomi Redmi 1S (armani)
From 0dbaf602ac5f11356a192eb2bd388d0e29802848 Mon Sep 17 00:00:00 2001
From: TheStrix <[email protected]>
Date: Mon, 30 Mar 2015 11:35:33 -0400
Subject: [PATCH] Implement kexec-hardboot
"Allows hard booting (i.e., with a full hardware reboot) to a kernel
previously loaded in memory by kexec. This works around the problem of
soft-booted kernel hangs due to improper device shutdown and/or
reinitialization."
More info in /arch/arm/Kconfig.
@nathwill
nathwill / systemd-nspawn containers on centos
Last active April 12, 2022 03:43
super lightweight containers with systemd-nspawn
assumes centos 7 host, typical configuration
- disable selinux: SELINUX=permissive in /etc/sysconfig/selinux
- disable auditd: systemctl disable auditd.service
- enable journald persistence: `Storage=persistent` in /etc/systemd/journald.conf
- mkdir /var/lib/container
- yum -y --nogpg --releasever=7 --installroot=/var/lib/container/centos install systemd passwd yum vim-minimal openssh-server
- systemd-nspawn -D /var/lib/container/centos
- set root passwd, set ssh port (e.g. 2222)
- set up systemd-nspawn service:
@taaem
taaem / HowTo.md
Last active May 4, 2017 14:26
How-To Promote from devel: to testing: for onyx

Promote

This describes how to promote all packages from devel: repo to testing: repo on build.merproject.org.

Get all package names and make a shell script for use with OSC

curl -O https://gist.githubusercontent.com/taaem/c80d094d31545f10f6d58f2ba4dcb675/raw/88846751b1be9df489ad56afa0376014a9331acb/promote.py
python promote.py > promote.sh

Copy all packages

@PatrickTerlisten
PatrickTerlisten / GetTemperatureSensorData.py
Last active July 13, 2024 12:21
Monitoring hardware status with Python and vSphere API calls
from pyVim.connect import SmartConnect, Disconnect
import ssl
s = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
s.verify_mode = ssl.CERT_NONE
try:
c = SmartConnect(host='vcenter.lab.local', user='root', pwd='Passw0rd')
print('Valid certificate\n')
except:
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active November 23, 2024 09:52
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@dcode
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active October 12, 2024 11:16
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)