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
| /* ~/Library/KeyBindings/DefaultKeyBinding.Dict | |
| This file remaps the key bindings of a single user on Mac OS X 10.5 to more | |
| closely match default behavior on Windows systems. This makes the Command key | |
| behave like Windows Control key. To use Control instead of Command, either swap | |
| Control and Command in Apple->System Preferences->Keyboard->Modifier Keys... | |
| or replace @ with ^ in this file. | |
| Here is a rough cheatsheet for syntax. | |
| Key Modifiers |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>method</key> | |
| <string>app-store</string> | |
| <key>teamID</key> | |
| <string>XXXXXXXXXX</string> | |
| <key>uploadBitcode</key> | |
| <true/> |
| // Related to https://issues.jenkins-ci.org/browse/JENKINS-26481 | |
| abcs = ['a', 'b', 'c'] | |
| node('master') { | |
| stage('Test 1: loop of echo statements') { | |
| echo_all(abcs) | |
| } | |
| stage('Test 2: loop of sh commands') { |
| gem install --http-proxy http://user:[email protected]:8080 bundler |
| #!/bin/bash | |
| ## Get the list of all the projects from Bitbucket account across all the pages | |
| get_total_project_list () { | |
| start=0 | |
| total_project_list=() | |
| is_last_page=false | |
| while ! $is_last_page | |
| do | |
| response=$(curl -k -u $u -X GET -H "Content-type: application/json" $bitbucket_url/rest/api/1.0/projects?start=$start) 2>&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
| # Sample from @citizen428 https://dev.to/citizen428/comment/6cmh | |
| FROM golang:alpine as build | |
| RUN apk add --no-cache ca-certificates | |
| WORKDIR /build | |
| ADD . . | |
| RUN CGO_ENABLED=0 GOOS=linux \ | |
| go build -ldflags '-extldflags "-static"' -o app | |
| FROM scratch | |
| COPY --from=build /etc/ssl/certs/ca-certificates.crt \ |
| #!/bin/bash | |
| export AnException=100 | |
| export AnotherException=101 | |
| # start with a try | |
| try | |
| ( # open a subshell !!! | |
| echo "do something" | |
| [ someErrorCondition ] && throw $AnException |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"