在阅读了gzip压缩如何工作后,它让我思考.如果Origin和Proxy服务器(CDN)都支持gzip是否需要添加Vary: Accept-Encoding头?
在浏览时,我有时会看到EOFD:
ftp -vn <$hostname> <<EOFD
Run Code Online (Sandbox Code Playgroud)
是的,我没有运气就试过谷歌,万一你想知道.
假设我有四个网络服务器,我需要在文件中添加一行HTML.如您所见,我需要在cluster =之后出现整数
for i in 01 02 03 04; do ssh web.${i}.domain.com 'echo "<img src=beacon.gif?cluster=${i}>" >> /var/www/index.html'; done
Run Code Online (Sandbox Code Playgroud)
如何实现这一目标?提前致谢.
我在创建一个html表以显示文本文件中的统计信息时遇到问题.我相信有100种方法可以做得更好,但现在它是:
(以下脚本中的注释显示输出)
#!/bin/bash
function getapistats () {
curl -s http://api.example.com/stats > api-stats.txt
awk {'print $1'} api-stats.txt > api-stats-int.txt
awk {'print $2'} api-stats.txt > api-stats-fqdm.txt
}
# api-stats.txt example
# 992 cdn.example.com
# 227 static.foo.com
# 225 imgcdn.bar.com
# end api-stats.txt example
function get_int () {
for i in `cat api-stats-int.txt`;
do echo -e "<tr><td>${i}</td>";
done
}
function get_fqdn () {
for f in `cat api-stats-fqdn.txt`;
do echo -e "<td>${f}</td></tr>";
done
}
function build_table () {
echo "<table>";
echo -e "`get_int`" …Run Code Online (Sandbox Code Playgroud) bash ×3
acronym ×1
awk ×1
compression ×1
definition ×1
echo ×1
encoding ×1
for-loop ×1
function ×1
gzip ×1
html ×1
html-table ×1
proxy ×1
webserver ×1