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
| __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") |
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
| #!/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 |
| # Install and configure snmpd | |
| --- | |
| - hosts: centos5:centos6 | |
| gather_facts: yes | |
| vars: | |
| tasks: | |
| - name: Install snmpd package |