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
# Resize the disk in Vmware potato | |
# Confirm that the OS sees the new size | |
root@docker01:~# echo 1 > /sys/class/block/sda/device/rescan | |
root@docker01:~# lsblk | |
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT | |
loop0 7:0 0 64M 1 loop /snap/core20/2318 | |
loop1 7:1 0 91.9M 1 loop /snap/lxd/29619 | |
loop3 7:3 0 91.9M 1 loop /snap/lxd/24061 |
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
from fastapi import FastAPI, Request, BackgroundTasks, Depends | |
from fastapi.responses import JSONResponse | |
from fastapi.staticfiles import StaticFiles | |
from fastapi.templating import Jinja2Templates | |
import re | |
from bs4 import BeautifulSoup | |
import requests | |
templates = Jinja2Templates(directory="./templates") |
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
from scapy.layers.inet import IP, TCP, Ether, UDP | |
from scapy.layers.dhcp import BOOTP, DHCP | |
from scapy.all import send, sendp, RandMAC | |
#discover = Ether(dst='ff:ff:ff:ff:ff:ff', src='DE:EA:DE:C0:FF:EE', type=0x0800)/IP(src='0.0.0.0', dst='255.255.255.255' )/UDP(dport=67,sport=68)/BOOTP(op=1,chaddr='DE:EA:DE:C0:FF:EE')/DHCP(options=[('message-type','discover'), ('end')]) | |
#send(discover,iface="wlp3s0") | |
src_mac = str(RandMAC()) | |
ethernet = Ether(dst='ff:ff:ff:ff:ff:ff', src=src_mac, type=0x800) |
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
############################################################################### | |
# The MIT License | |
# | |
# Copyright 2012-2014 Jakub Jirutka <[email protected]>. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
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
2019-03-10 20:32:00.961 4967 INFO os_vif [-] Loaded VIF plugins: ovs, linux_bridge, noop | |
2019-03-10 20:49:35.697 15208 DEBUG os_vif [-] Loaded VIF plugin class '<class 'vif_plug_ovs.ovs.OvsPlugin'>' with name 'ovs' initialize /usr/lib/python2.7/site-packages/os_vif/__init__.py:46 | |
2019-03-10 20:49:35.698 15208 DEBUG os_vif [-] Loaded VIF plugin class '<class 'vif_plug_linux_bridge.linux_bridge.LinuxBridgePlugin'>' with name 'linux_bridge' initialize /usr/lib/python2.7/site-packages/os_vif/__init__.py:46 | |
2019-03-10 20:49:35.698 15208 DEBUG os_vif [-] Loaded VIF plugin class '<class 'vif_plug_noop.noop.NoOpPlugin'>' with name 'noop' initialize /usr/lib/python2.7/site-packages/os_vif/__init__.py:46 | |
2019-03-10 20:49:35.698 15208 INFO os_vif [-] Loaded VIF plugins: ovs, linux_bridge, noop |
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
#Install Ansible | |
#!/bin/bash | |
sudo apt-get install dirmngr | |
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/ansible.list | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 | |
sudo apt-get update | |
sudo apt-get install ansible -y |
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
#Install docker | |
#!/bin/bash | |
sudo apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg2 \ | |
software-properties-common -y |
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
--- | |
- hosts: all | |
gather_facts: false | |
pre_tasks: | |
- name: ensure ipmi tools are installed | |
yum: | |
name: ipmitool | |
- name: retrieve ipmitool address | |
shell: > | |
ipmitool lan print | grep '^IP Addr' | grep -v Source | cut -d':' -f2 | xargs |