Here are several different ways to test a TCP port without telnet.
BASH (man page)
$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C
$ cat < /dev/tcp/127.0.0.1/23
<NotepadPlus> | |
<UserLang name="Dockerfile" ext="Dockerfile" udlVersion="2.1"> | |
<Settings> | |
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" /> | |
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments">03 04 00# 01 02</Keywords> | |
<Keywords name="Numbers, prefix1"></Keywords> | |
<Keywords name="Numbers, prefix2"></Keywords> |
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
function genStringPatterns() { | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
Here are several different ways to test a TCP port without telnet.
$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C
$ cat < /dev/tcp/127.0.0.1/23
sudo apt-get update | |
sudo apt-get install -y python-pip | |
sudo pip install awscli | |
aws configure # enter credentials for a user with full s3,ec2 access / admin access | |
export KUBERNETES_PROVIDER=aws | |
export KUBE_AWS_ZONE=us-west-2a | |
export KUBE_AWS_INSTANCE_PREFIX=k8s | |
export KUBE_MINION_IMAGE=ami-9abea4fb # Ubuntu server 14.04 |
#!/usr/bin/env python | |
""" | |
Recipe for creating and updating security groups programmatically. | |
""" | |
import collections | |
import boto |
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Scalable Wordpress instance", | |
"Parameters": { | |
"InstanceType": { | |
"Type": "String", | |
"Description": "Instance type", | |
"Default": "t2.medium", | |
"AllowedValues": [ "t2.medium", "t2.large" ] |
from botocore.credentials import RefreshableCredentials | |
from botocore.session import get_session | |
from boto3 import Session | |
def assumed_session(role_arn, session_name, session=None): | |
"""STS Role assume a boto3.Session | |
With automatic credential renewal. |