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
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
| #!/usr/bin/env bash | |
| set -e | |
| # The MIT License (MIT) | |
| # Copyright (c) 2018 RaviTezu | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights |
Picking the right architecture = Picking the right battles + Managing trade-offs
| location / { | |
| ## check for goget AND /namespace/project | |
| if ($args ~* "^go-get=1") { | |
| set $condition goget; | |
| } | |
| if ($uri ~ ^/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$) { | |
| set $condition "${condition}path"; | |
| } | |
| if ($condition = gogetpath) { | |
| return 200 "<!DOCTYPE html><html><head><meta content='git.axon$uri git ssh://[email protected]:2200$uri.git' name='go-import'></head></html>"; |
| type T struct { | |
| A int | |
| B string | |
| } | |
| t := T{23, "skidoo"} | |
| s := reflect.ValueOf(&t).Elem() | |
| typeOfT := s.Type() | |
| for i := 0; i < s.NumField(); i++ { |
| package main | |
| import ( | |
| "net" | |
| "os/exec" | |
| "github.com/k0kubun/pp" | |
| ) | |
| func Hosts(cidr string) ([]string, error) { |
| sudo su - | |
| # stuff we need to build from source | |
| apt-get install libpcre3-dev build-essential libssl-dev | |
| # get the nginx source | |
| cd /opt/ | |
| wget http://nginx.org/download/nginx-0.8.54.tar.gz | |
| tar -zxvf nginx* | |
| # we'll put the source for nginx modules in here |
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "os" | |
| "path/filepath" | |
| "strings" | |
| ) |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| def archive_to_bytes(archive): | |
| def to_seconds(s): | |
| SECONDS_IN_A = { | |
| 's': 1, | |
| 'm': 1 * 60, | |
| 'h': 1 * 60 * 60, |