meta data for this page
  •  

Különbségek

A kiválasztott változat és az aktuális verzió közötti különbségek a következők.

Összehasonlító nézet linkje

Előző változat mindkét oldalonElőző változat
Következő változat
Előző változat
linux:network [2020/10/03 20:17] adminlinux:network [2024/03/21 16:49] (aktuális) admin
Sor 1: Sor 1:
 ====== Hálózati okosságok ====== ====== Hálózati okosságok ======
 +
 +==== File letöltő BASH-sel ====
 +
 +<file>
 +#!/bin/bash
 +# Usage: ./download_file 'https://www.baeldung.com/java-weekly-495' 'java_weekly_495.html'
 +raw_download() {
 +    wPROTO="${1%://*}"
 +    af="${1#*://}"
 +    wBASE="${af%%/*}"
 +    wSUB="${af#*/}"
 +
 +    HTTP_REQUEST="$({
 +        echo -en 'GET /'"${wSUB}"' HTTP/1.1\r\n'
 +        echo -en 'Host: '"${wBASE}"'\r\n'
 +        echo -en 'Connection: close\r\n\r\n'
 +    })"
 +
 +    if [[ "${wPROTO,,}" = 'https' ]] ; then
 +        echo "${HTTP_REQUEST}" | openssl s_client -quiet -connect ${wBASE}:443
 +    else
 +        exec {NFD}<>"/dev/tcp/${wBASE}/80"
 +        echo "${HTTP_REQUEST}" >&"${NFD}"
 +        while read -u "${NFD}" lz; do
 +            echo "${lz}"
 +        done
 +        exec {wFD}>&-
 +    fi
 +}
 +
 +main() {
 +    raw="$(raw_download "${1}" 2>errorlog.txt)"
 +    echo "${raw#*$'\r\n\r\n'}" > "${2}"
 +}
 +
 +main "${@}"
 +</file>
 +
 +==== Rsync ====
 +
 +To create a new directory at the destination and back up your files there, add a trailing slash (/) at the end of the destination path. If you add the trailing slash to the source, then the source directory will not be created at the destination. Rsync only transfers its content in that case.
 +Kulcs használat:
 +
 +  rsync e "ssh -i $HOME/.ssh/somekey"
  
 ==== Firewalld ==== ==== Firewalld ====
Sor 17: Sor 61:
   ^C pressed here   ^C pressed here
  
 +Szkriptbe:
 +
 +  (echo > /dev/tcp/localhost/1500) >/dev/null 2>&1 && echo "It's up" || echo "It's down"
 +  timeout 1s bash -c "true <>/dev/tcp/localhost/443" >/dev/null 2>&1 && echo "It's up" || echo "It's down"
 +  while [[ -n $((echo > /dev/tcp/$TCPS/$TCPP) 2>&1 > /dev/null) ]]; do echo varunk; sleep 10; done
 +
 +nc-vel:
 +
 +  nc -zv hoszt port
 +
 +Windows PowerShell:
 +
 +  Test-NetConnection -ComputerName myserver.com -Port 443
 ==== NFS okosságok ==== ==== NFS okosságok ====