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
| # Install and configure snmpd | |
| --- | |
| - hosts: centos5:centos6 | |
| gather_facts: yes | |
| vars: | |
| tasks: | |
| - name: Install snmpd package |
| #!/bin/bash -e | |
| # /usr/local/sbin/raspi-monitor | |
| # Script to enable and disable the HDMI signal of the Raspberry PI | |
| # Inspiration: http://www.raspberrypi.org/forums/viewtopic.php?t=16472&p=176258 | |
| CMD="$1" | |
| function on { | |
| /opt/vc/bin/tvservice --preferred |
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
| __author__ = 'mbrzustowicz' | |
| # metadata.json has single quotes like this | |
| # {'asin': 'B00M0AEPXG', 'imUrl': 'http://ecx.images-amazon.com/images/I/51hcXTUeHLL._BO2,204,203,200_ ..... } | |
| # so the strategy is to read each line as a string, and dump into a REAL json file | |
| import json | |
| import ast | |
| fr=open("/Users/mbrzustowicz/Downloads/metadata.json") |
requires
jqCLI
oc get namespaces -o json | jq '[.items[] | select((.metadata.name | startswith("openshift") | not) and (.metadata.name | startswith("kube-") | not) and .metadata.name != "default" and (true)) | .metadata.name ]'
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| docker run \ | |
| --name {{printf "%q" .Name}} \ | |
| {{- with .HostConfig}} | |
| {{- if .Privileged}} | |
| --privileged \ | |
| {{- end}} | |
| {{- if .AutoRemove}} | |
| --rm \ | |
| {{- end}} | |
| {{- if .Runtime}} |
| Server 2 sockets,6 cores each, 2.4ghz | |
| # Set ixgbe options | |
| # Limit RSS queues to the number of physical cores per cpu | |
| # Disable offload | |
| # When you change this, you need to run the command and reboot for it to take. | |
| echo "options ixgbe LRO=0,0 MQ=1,1 RSS=6,6 VMDQ=0,0 vxlan_rx=0,0" > /etc/modprobe.d/ixgbe.conf | |
| # Shut down HT cores | |
| for i in $(seq 1 2 23); do |
| #!/bin/sh | |
| ## | |
| # This script contains helper for sha256 validating your downloads | |
| # | |
| # Source: https://gist.github.com/onnimonni/b49779ebc96216771a6be3de46449fa1 | |
| # Author: Onni Hakala | |
| # License: MIT | |
| ## | |
| # Stop program and give error message |