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
. |
echo '<14>_sourcehost_ messagetext' | nc -v -u -w 2 _desthost_ 514 | |
Example: | |
echo '<14>192.168.0.5 messagetext' | nc -v -u -w 2 192.168.0.105 514 |
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
apt-get install -y libaio1 alien | |
# Change version based on https://www.oracle.com/de/database/technologies/instant-client/linux-x86-64-downloads.html | |
# Example alternative: http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.5-basiclite-19.5.0.0.0-1.x86_64.rpm | |
wget http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm | |
sudo alien -i --scripts oracle-instantclient*.rpm | |
rm -f oracle-instantclient*.rpm | |
# Optionally install SQLPlus | |
wget http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.6-sqlplus-19.6.0.0.0-1.x86_64.rpm | |
sudo alien -i --scripts oracle-instantclient*.rpm |
gem install --http-proxy http://user:[email protected]:8080 bundler |
These are for cases where you know that the directory contains only regular files and that you want to process all non-hidden files. If that is not the case, use the approaches in 2. | |
All sed solutions in this answer assume GNU sed. If using FreeBSD or macOS, replace -i with -i ''. Also note that the use of the -i switch with any version of sed has certain filesystem security implications and is inadvisable in any script which you plan to distribute in any way. | |
Non recursive, files in this directory only: | |
sed -i -- 's/foo/bar/g' * | |
perl -i -pe 's/foo/bar/g' ./* | |
(the perl one will fail for file names ending in | or space)). |
# Just some notes on enabling smart http with nginx as well as authentication on push for repos | |
# install git, cgit and apache2-utils (for authentication) | |
apt install git cgit apache2-utils fcgiwrap | |
# create a git user | |
adduser git | |
su git | |
cd | |
mkdir .ssh && chmod 700 .ssh | |
touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys |
# Run this commands from user root | |
mkdir zabbix-agent && cd zabbix-agent | |
wget https://github.com/CHERTS/zabbix_44x_next/releases/download/v4.4.11/zabbix_agent-4.4.11-solaris-11.4-amd64-openssl.tar.gz | |
tar -vzxf zabbix_agent-4.4.11-solaris-11.4-amd64-openssl.tar.gz | |
cp bin/zabbix_* /usr/bin/ | |
cp sbin/zabbix* /usr/sbin/ | |
mkdir /etc/zabbix/ | |
cp conf/zabbix_agentd.conf /etc/zabbix/ | |
chmod -R 755 /etc/zabbix/ |