Skip to content

Instantly share code, notes, and snippets.

@JamesOBenson
JamesOBenson / README
Created September 14, 2017 04:18 — forked from xbb/README
IDRAC6 Virtual Console Launcher
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface.
You can use the user and password that you use for the web interface.
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS.
You don't need to install it, just extract it or copy the files in "jre" folder.
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor.
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture.
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs.
https://help.ubuntu.com/community/Router#Enable_IP_forwarding_and_Masquerading
4.5. Enable IP forwarding and Masquerading
Doing the above might not be enough to make the Ubuntu machine a real router which does NAT (Network Address Translation) and IP Forwarding. The following script configures the Kernel IPTable and IP forwarding. You will have to configure at least the script's 2 variables; the 1st is the external network interface; the 2nd is the internal network interface.
EXTIF="eth0"
INTIF="eth1"
The script was originally from a Ubuntu router guide forum article which has 2 internal network interfaces. What's showing below uses only 1 internal network interface. You will have to modify the script manually or use the script in the Ubuntu router guide forum article if you need to configure 2 internal network interfaces.
echo -e "\n\nLoading simple rc.firewall-iptables version $FWVER..\n"
#!/bin/sh
# USE ON MASTER NODE as UBUNTU/root:
export MASTER1="r2-710-01"
export MASTER2="r2-710-03"
export MASTER3="r2-710-05"
export CLIENT_NODES="r2-710-07 r2-710-09 r2-710-11 r2-710-13"
export ALL_NODES="r2-710-01 r2-710-03 r2-710-05 r2-710-07 r2-710-09 r2-710-11 r2-710-13"
# To deploy in Openstack ubuntu server LTS instance:
sudo apt-add-repository ppa:ubuntu-lxc/stable -y
# Using the backports will be supported after the end of 2017, snap is still being developed. As of Nov 28, 2017, backports and regular install are the same.
sudo apt update && sudo apt install -y -t xenial-backports lxd lxd-client
#sudo apt update && sudo apt install -y lxd lxd-client
lxd init --auto
# MTU of 1450 is needed for openstack VM.
lxc network create lxdbr0 ipv4.address=auto ipv4.nat=true ipv6.address=none ipv6.nat=false bridge.mtu=1450
@JamesOBenson
JamesOBenson / backup.sh
Created December 1, 2017 21:38
This will look at openstack active instances, report a list and ask you if you want to download. After 10 seconds, it continues the download.
#!/bin/bash
source openrc
timeout=10
# pip install python-openstackclient
# pip install python-novaclient
# pip install python-glanceclient
# This script will create and download all available images in an openstack cluster under a specific username.
# This script has been tested against shellcheck and verified to the best of my abilities to work under any version of shell.
@JamesOBenson
JamesOBenson / create_openstack_user.sh
Last active March 25, 2021 12:26
Create openstack project/user/networking & update security rules (python-openstackclient & openssl are the only requirement ); Verified all commands work properly & as intended.
#!/bin/bash
# This script creates all necessary components to start booting VM's in openstack. This includes
# - Project
# - User
# - Networking, subnets, router,
# Security group allows
# - 22 (SSH)
# - IMPI (Ping test)
# - 8443 & 8883 (Greengrass rules)
Input math equation and round to 3 decimals:
printf %.3f $(echo "$exp" | bc -l)
Comparing 3 numbers to find equals/differences:
read x
read y
read z
if [[ "$x" -eq "$y" ]] && [[ "$x" -eq "$z" ]] ; then echo EQUILATERAL
elif [[ "$x" -eq "$y" ]] || [[ "$x" -eq "$z" ]] || [[ "$y" -eq "$z" ]] ; then echo ISOSCELES
else echo SCALENE
@JamesOBenson
JamesOBenson / greengrass_group_create.py
Created June 29, 2018 21:09 — forked from dzimine/greengrass_group_create.py
Create AWS Greengrass group and core.
import json
import yaml
import boto3
gg = boto3.client('greengrass')
iot = boto3.client('iot')
group = gg.create_group(Name="my_group")
keys_cert = iot.create_keys_and_certificate(setAsActive=True)
# Python's list comprehensions are awesome.
vals = [expression
for value in collection
if condition]
# This is equivalent to:
vals = []
for value in collection:
__author__ = 'Cody Giles'
__license__ = "Creative Commons Attribution-ShareAlike 3.0 Unported License"
__version__ = "1.0"
__maintainer__ = "Cody Giles"
__status__ = "Production"
import subprocess
import smtplib
from email.mime.text import MIMEText
import datetime