Skip to content

Instantly share code, notes, and snippets.

@mdPlusPlus
mdPlusPlus / compile_newest_stable_kernel_with_acso_patch.sh
Last active March 22, 2023 12:19
Download, patch, compile and install the newest stable Linux kernel with the ACS override patch (Ubuntu / Debian)
#!/bin/bash
function install_dependencies() {
echo "Installing dependencies..."
sudo apt -qq update
sudo apt -qq install -y curl git wget
# sudo apt -qq install -y bison flex kernel-package libelf-dev libssl-dev
sudo apt -qq install -y bison flex libelf-dev libssl-dev
}
# create keytab for radius user
ipa-getkeytab -p 'radius/HOSTNAME' -k /etc/raddb/radius.keytab
chown root:radiusd /etc/raddb/radius.keytab
chmod 640 /etc/raddb/radius.keytab
# make radius use the keytab for SASL GSSAPI
mkdir -p /etc/systemd/system/radiusd.service.d
cat > /etc/systemd/system/radiusd.service.d/krb5_keytab.conf << EOF
[Service]
Environment=KRB5_CLIENT_KTNAME=/etc/raddb/radius.keytab
@pjf
pjf / Mainline.md
Created September 24, 2016 14:24
Build your own working Ubuntu 4.7.x kernel

Booting with a mainline kernel on Ubuntu with 4.7.5 or above.

Some machines die with "cannot find root" unless CONFIG_UEVENT_HELPER is set. This is the case with Ubuntu kernels 4.6.x and earlier, but not in 4.7.5. I have no idea why.

Here's how I built my own.

  • git clone --branch v4.7.5 --depth 1 git://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack
  • Apply all the patches from mainline with -p1 ( http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.7.5/ )
  • Copy your config from your already installed mainline kernel /boot/whatever to .config
@markjlorenz
markjlorenz / simple-exec-with-docker-remote-api.sh
Created July 23, 2016 16:05
Using the exec command with the docker API, and capturing output
#! /usr/bin/env bash
# Create the container with a long running process. If PID1 exists before
# we send the exec commands, they will fail because the container is not running
#
CONTAINER_NAME="TEST-`uuidgen`"
curl --silent --unix-socket /var/run/docker.sock "http:/containers/create?name=${CONTAINER_NAME}" -XPOST \
-H "Content-Type: application/json" \
-d '{
"Image": "ruby:latest",
@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.