This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -xe | |
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT | |
testrun=$(date -Isecond) | |
mkdir -p ~/test-mirror/${testrun} | |
cd ~/test-mirror/${testrun} | |
# ~400M -rw-r--r-- 421,586,560 2024/01/09 17:36:50 linux-source-6.2.0_6.2.0-41.42_all.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bpftrace | |
// Probe br_dev_newlink and see if IFLA_MTU was passed in at creation | |
docker run -ti -v /usr/src:/usr/src:ro \ | |
-v /lib/modules/:/lib/modules:ro \ | |
-v /root:/root:ro \ | |
-v /sys/kernel/debug/:/sys/kernel/debug:rw \ | |
--net=host --pid=host --privileged \ | |
quay.io/iovisor/bpftrace:latest \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@mtutest:~# cat bridge_flags.py | |
#!/usr/local/bin/drgn -k | |
# Usage: ./bridge_flags.py bridge_interface_name | |
# | |
# Returns the internal bridge flags, was written in order to inspect whether | |
# BROPT_MTU_SET_BY_USER was set for a given bridge. | |
import sys | |
from drgn import NULL, Object, cast, container_of, execscript, offsetof, reinterpret, sizeof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ssl | |
import pymongo | |
import yaml | |
import glob | |
import sys | |
import os | |
import urllib | |
# Find juju machine agent | |
agents = glob.glob('/var/lib/juju/agents/machine-*') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import re | |
import pprint | |
import sys | |
import yaml | |
if len(sys.argv) <= 1: | |
print("Usage: juju-split FILE_NAME") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pp' | |
require 'json' | |
require 'date' | |
input_fn = ARGV[0] | |
input_file = open(input_fn) | |
j = JSON.parse(input_file.read) | |
ops = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## OnApp template creator Makefile for Ubuntu 14.04 | |
## Creates an OnApp compatible template from the Ubuntu cloud base image | |
## You can run this script continiously to update the image | |
## You will want to customise the timezone and mirror | |
## | |
## Version 0.1 2014-05-07 | |
## Trent Lloyd <trentl@webinabox.net.au> | |
## (1) Create a new directory, e.g. 'template-builder' | |
## (2) Download this file and name it Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
network_internal: | |
ipaddress: "%{::ipaddress_eth1}" | |
ipaddress6: "%{::ipaddress6_eth1}" | |
network: "%{::network_eth1}" | |
netmask: "%{::netmask_eth1}" | |
prefixlen: "%{::prefixlen_eth1}" | |
netcidr: "%{::netcidr_eth1}" | |
netcidr6: "%{::netcidr6_eth1}" | |
ipcidr: "%{::ipcidr_eth1}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ipaddr' | |
require 'puppet/util/ipcidr' | |
interfaces = Facter.value('interfaces') | |
# If we do not have any interfaces, then there are no requested attributes | |
unless interfaces == :undefined | |
interfaces = interfaces.split(',') | |
interfaces.each do |iface| |