e.g. Get http://mirror01.idc.hinet.net/CentOS/ first 7.x dir name
RE=">(7[0-9\.]+)"
[[ `curl -s http://mirror01.idc.hinet.net/CentOS/` =~ $RE ]]
echo ${BASH_REMATCH[1]}
Output:
7.0.1406
e.g. Get http://mirror01.idc.hinet.net/CentOS/ first 7.x dir name
RE=">(7[0-9\.]+)"
[[ `curl -s http://mirror01.idc.hinet.net/CentOS/` =~ $RE ]]
echo ${BASH_REMATCH[1]}
Output:
7.0.1406
Useful when connection drop
screen -Dr
Reattach a session. If necessary detach and logout remotely first.
screen -DR
Attach here and now. In detail this means: If a session is running, then reattach.
If necessary detach and logout remotely first.
If it was not running create it and notify the user. This is the author's favorite.
Sender
curl -T file http://host/upload.php
Receiver upload.php code
if ($_SERVER["REQUEST_METHOD"]=="PUT") file_put_contents(date("YmdHis") ,file_get_contents("php://input"));
// date("YmdHis") is output filename
yum -y install tftp-server
Edit /etc/xinetd.d/tftp, add -c if need create (put file in)
server_args = -cs /var/lib/tftpboot
systemctl enable tftp.socket
systemctl start tftp.socket
PS. xinetd is not necessary
set D=%date:/=%
set YMD=%D:~0,8%
echo %YMD%
Example: record desktop for 1 hour
ffmpeg -f gdigrab -framerate 10 -i desktop -t 01:00:00 file.mp4
Recent Comments