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
$ sudo maas-region dbshell | |
maasdb=# SELECT r.gateway_ip, metric, source.cidr source, dest.cidr destination | |
FROM maasserver_staticroute r | |
JOIN maasserver_subnet source ON source.id = r.source_id | |
JOIN maasserver_subnet dest on dest.id = r.destination_id; |
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
ubuntu@maas:~$ curl tftp://localhost/pxelinux.cfg/01-52-54-00-74-1e-ce | |
DEFAULT execute | |
LABEL execute | |
SAY Booting under MAAS direction... | |
SAY nomodeset iscsi_target_name=iqn.2004-05.com.ubuntu:maas:ephemeral-ubuntu-amd64-hwe-x-xenial-daily iscsi_target_ip=127.0.0.1 iscsi_target_port=3260 iscsi_initiator=pxe1 ip=::::pxe1:BOOTIF ip6=off ro root=/dev/disk/by-path/ip-127.0.0.1:3260-iscsi-iqn.2004-05.com.ubuntu:maas:ephemeral-ubuntu-amd64-hwe-x-xenial-daily-lun-1 overlayroot=tmpfs cc:{'datasource_list': ['MAAS']}end_cc cloud-config-url=http://172.16.99.2:5240/MAAS/metadata/latest/by-id/nce47f/?op=get_preseed log_host=172.16.99.2 log_port=514 | |
KERNEL ubuntu/amd64/hwe-x/xenial/daily/boot-kernel | |
INITRD ubuntu/amd64/hwe-x/xenial/daily/boot-initrd | |
APPEND nomodeset iscsi_target_name=iqn.2004-05.com.ubuntu:maas:ephemeral-ubuntu-amd64-hwe-x-xenial-daily iscsi_target_ip=127.0.0.1 iscsi_target_port=3260 iscsi_initiator=pxe1 ip=::::pxe1:BOOTIF ip6=off ro root=/dev/disk/by-path/ip-127.0.0.1:3260-iscsi-iqn.2004-05.com |
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
# This is an example of how to do an OAuth1 request manually, such as when a deploying MAAS node hits the metadata server. | |
# Grab the TFTP config for the deploying/commissioning machine. | |
# curl tftp://localhost/pxelinux.cfg/01-52-54-00-0a-25-ac | |
APPEND nomodeset ... cloud-config-url=http://172.16.99.2:5240/MAAS/metadata/latest/by-id/nrwbgy/?op=get_preseed ... | |
# Grab the cloud-config for the machine. | |
# curl http://172.16.99.2:5240/MAAS/metadata/latest/by-id/nrwbgy/?op=get_preseed | |
... |
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 python | |
import socket | |
import time | |
servers = [ | |
["Local Network - Survival Peaceful", 25565], | |
["Local Network - Survival Normal", 25566], | |
["Local Network - Survival Hard with Diamonds", 25567], | |
] |
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 python | |
import socket | |
import time | |
import sys | |
from scapy.all import * | |
conf.verb = 0 | |
servers = [ |
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 python | |
import re | |
import sys | |
import select | |
import socket | |
import struct | |
import time | |
port = 4445 |
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
find "$1" -type l | xargs ls -ln | awk '{ print $9, $10, $11 }' | sort -k2 |
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 | |
# Note: excluding ramdisks, floppy drives, and loopback devices. | |
lsblk --exclude 1,2,7 -d -P | |
echo "" | |
for dev in $(lsblk -n --exclude 1,2,7 --output KNAME); do | |
echo "$dev:" | |
udevadm info -q all -n $dev | |
echo "" | |
echo " size64: $(sudo -n blockdev --getsize64 /dev/$dev 2> /dev/null || echo unknown)" |
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 | |
function normal { | |
tput sgr0 | |
} | |
normal="$(normal)" | |
function example { | |
printf "%s" "${normal}" |
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 | |
""" | |
This file contains example code from the PySNMP project, which has been | |
heavily modified to only walk specified MIBs. | |
Examples in the comments include information on how to connect to a device | |
using SNMPv3, with or without privacy (and an authentication digest). | |
""" | |
import sys | |
from functools import partial |