Skip to content

Instantly share code, notes, and snippets.

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"
@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.
@JamesOBenson
JamesOBenson / json misc
Created September 6, 2017 15:20
Random json examples.
## Python 2.7
>>> import json
>>> import sys
>>>
>>> #load the data into an element
... data={"test1" : "1", "test2" : "2", "test3" : "3"}
>>>
>>> #dumps the json object into an element
... json_str = json.dumps(data)
Source: http://hints.macworld.com/article.php?story=20100113142633883
To have tab to complete from .ssh/config file in MacOS (Verified on MacOS 10.12.4),
vi ~/.bash_profile (New file)
# Copy and paste this line
complete -o default -o nospace -W "$(/usr/bin/env ruby -ne 'puts $_.split(/[,\s]+/)[1..-1].reject{|host| host.match(/\*|\?/)} if $_.match(/^\s*Host\s+/);' < $HOME/.ssh/config)" scp sftp ssh
source ~/.bash_profile
Step 1: Create Volume in OpenStack (Can be completed in GUI)
CLI:
cinder create SIZE_IN_GB --display-name NAME
cinder create 10 --display-name mystorage
cinder list
Step 2: Attach volume to Openstack instance (Can be completed in GUI)
CLI:
nova volume-attach INSTANCE_ID VOLUME_ID auto
nova volume-attach myhost f14e47ab-18f6-4f85-bd17-a3f63a38d609 auto
@JamesOBenson
JamesOBenson / README.md
Created November 30, 2016 22:04 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAEAQDGYSdETkHMGxfRcAjUA+sjKUkYfPi5E40J2U9597T9gTiaJiFjWK4EhARupMgvW37+tPveybZ9BXMwyzeqqo8A+TQlsLoU1wUALFmx1gwZBv5JwAlrRLRVjrgJiu+BIcGV4gdhVnhewSSkaw8hHUWB8xyp6TDTDmk3U+YxVARH75ZpCD6nBrpN4QdAOeyiQefR5E5IjNDVkfOdJBjT+0gIT9uwQTLP9sORNhp8KP8ZkdcX5hFaW0X/P0mgyjEQW9WMa/rIfLx6z/1rPtcfDj9GF7keXaN7KYBVipEOcUUTWkxizH31Zp+TEbA7R/4s01b6WTW+kmiQ2xNHalF/EQl7ArSFLDeLeqCxbCy01O7EVLK5eanP996IVwxLD3bS9CB6P0EBGGNe0po5ZNCuvk7qhazSP8Bkf/X06HYSL0jMWH5AIhXrcNmplc+C3oU6DMrPVHScO8Y7jGwHEBZendWJ4oDsMgW/9wtR6glX4UTE5fYFvpL1oB7xbzTnyLWY/XAOr9oZcM0brfhSN0t7zw6ffzkIXAn1rT1sRoZg2oQHwS6sp3DEYRuSS4VTZedziTRdtmXb4jCyD2gDmcpzFO0HO8dofQG+LNrAcDhCiERN3iGcDT1LtKIQMHL+rN0OTct34swOmVKJaCxCBWHi+pgGM0pKo0dzZfOYUkU8ul7OdnpUI54gUkkgGBpviA5jtzNzKcs6KKjX2ma4iklaQMc2DDJ//yjpO53Tm9WyEgUdyWJD37I+khLf3PP+u9VpG2b755tk25sd5z4kohifLN6IO3ANcJwVJ+tOUunVPn4B3qjqcGvcMhU9xOZShdwP5aO0oq4qS3dHsHe1eKVgyZSN/UZsaH17EZRULqe1dC6/0mg4KdJS/oof8czYG8U44hO+38+rzseej5h3TV+HkYPXmCQ7J75boiNCqccGrpAMX+B/8aGjDOJD4l8bX92dZu5nTnvLhwAk1PcVsBHgRqVjg3d6
ping range of IP's
for x in {100..125}; do ping -c 1 -W 100 10.3.100.$x | grep 'time='; done
@JamesOBenson
JamesOBenson / Generating a secure SSH Key and commands
Last active October 16, 2023 06:45
SSH Generation and commands.
ssh-keygen
-t ed25519 - for greatest security (bits are a fixed size and -b flag will be ignored)
-t rsa - for greatest portability (key needs to be greater than 4096 bits)
-t ecdsa - faster than RSA or DSA (bits can only be 256, 284, or 521)
-t dsa - DEEMED INSECURE - DSA limted to 1024 bit key as specified by FIPS 186-2, No longer allowed by default in OpenSSH 7.0+
-t rsa1 - DEEMED INSECURE - has weaknesses and shouldn't be used (used in protocol 1)
-b 4096 bit size
-a 500 rounds (should be no smaller than 64, result in slower passphrase verification and increased resistance to brute-force password cracking)
-C "[email protected]" comment..
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBIHx2g+BAfUJDgV7pToJWN0rLytiaKUA3hq9pLIJm1k [email protected]