我需要将大量图像组合到一个目录中。其中许多图像具有相同的文件名。
mv如果目标文件名已经存在,是否有一些安全版本会自动重命名文件,以便pic1.jpeg变成类似的东西pic1_2.jpeg?
我可以编写自己的 python 脚本,但必须有这样的东西,所以我可以这样做:
find . -type f -name *.jpg -exec mvsafe '{}' /targetpath/ \;
Run Code Online (Sandbox Code Playgroud) Nginx 在后端重新启动时返回 502。如何让 Nginx 代理重试 N 次延迟 M 秒?有没有插件或其他东西?
我正在尝试在全新干净的服务器上设置 gitlab (6.5.1)。似乎一切正常,但 git 无法推送到任何项目。按照来自新创建的项目页面的命令并通过 ssh 推送到远程给出:
$ git push -u origin master
fatal: Could not read from remote repository.
Please make sure you have the correct access
rights and the repository exists.
Run Code Online (Sandbox Code Playgroud)
这似乎是一个相当普遍的问题。不幸的是,它似乎有许多潜在的原因,但似乎没有一个是匹配的。从 旧版本的问题 3424和其他各种在线资源中,我看到并检查了以下建议:
剩余的 ssh 密钥
这是一个干净的设置,没有剩菜。我的密钥已正确添加到授权密钥文件中,并且是唯一列出的密钥。
使用调试日志运行 ssh 会显示与 Ruby 环境变量相关的错误。
我的很干净。SSH 调试显示连接成功。认证握手一切正常,那么输出到此结束:
debug1: Sending command: git-receive-pack 'username/reponame.git'
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: …Run Code Online (Sandbox Code Playgroud)在我的 Ubuntu Server 10.04 中,我正在运行一个示例 node.js 应用程序:
var http = require("http");
function onRequest(request, response) {
console.log("Request received.");
response.writeHead(200, {"Content-Type": "text/html"});
response.write("Hello World");
response.end();
}
http.createServer(onRequest).listen(3000);
Run Code Online (Sandbox Code Playgroud)
它只是侦听端口 3000 上的请求,登录控制台此请求并向客户端发送 HTTP “Hello World”
目标是使这个应用程序与 Apache2 共存。因此,经过一番研究后,我以这种方式编辑了默认文件(/etc/apache2/sites-available/default):
<VirtualHost *:80>
ServerAdmin haj@myserver.com
ServerName dev.myserver.com
<Location /node>
ProxyPassReverse http://127.0.0.1:3000/
ProxyPass http://127.0.0.1:3000/
</Location>
<Proxy>
Allow from all
</Proxy>
DocumentRoot /home/haj/www/http_home
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/haj/www/http_home/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /home/haj/www/log/error.log
# …Run Code Online (Sandbox Code Playgroud) 我一直使用 PuTTY (win32) 来通过 SSH 访问我的服务器。昨天我将服务器上的 OpenSSH 从 4.3 升级到 5.8,现在看来 PuTTY 不起作用了。它要求输入密码,然后确认密码正确,然后给出致命错误Server refused to start a shell/command。
当我尝试使用 cygwin 的 OpenSSH 登录时,没有任何问题。
我正在测试连接在同一路由器上的两台电脑之间的吞吐量,一台使用 100mbps lan,另一台使用 54mbps wifi。
这是有趣的部分:
nc,从 A 发送到 B 时我得到2.63MB/s(用 测量pv -r|nc ipB)iperf,我得到23MB/s,这非常好。有什么问题nc?
两者的操作系统都是 ubuntu 11.04。
我有一个没有启用压缩的 Jetty 服务器(我在这里测试过)。如何启用压缩?
我有一个安装了 DRBD 的分区的 Debian Xen DomU。我需要将此分区的大小从 46G 调整为 50G。我做了以下事情:
/etc/init.d/drbd stop lvresize -L 50G /lvm/device/etc/init.d/drbd start/etc/init.d/drbd stoplvresize -L 50G /lvm/device /etc/init.d/drbd
startdrbdadm resize drbd-device resize2fs /dev/drbd0我得到这个回应:
$ resize2fs 1.40-WIP (14-Nov-2006)
The filesystem is already 12058624 blocks long. Nothing to do!
Run Code Online (Sandbox Code Playgroud)
使用 fdisk,drbd0 和 sda 设备 drbd 都使用报告设备的大小为 49392123904。这与 resize2fs 所说的一致。(12058624x4096 [块大小])。
我的问题是df没有报告磁盘大小的变化。
$ df -B …Run Code Online (Sandbox Code Playgroud) 我一直在运行 MTR 往返于我的一台服务器,并注意到一些对我来说看起来很奇怪的东西。因为我不是很喜欢这个,所以我会给你三个输出:
这是从服务器到我家的位置:
My traceroute [v0.75]
prag341.server4you.de (0.0.0.0) Sat Apr 16 12:31:36 2011
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. v9-609a.s4y14.fra.routeserver.net 0.0% 143 6.6 2.9 0.7 15.6 2.4
2. 217.118.16.161 0.0% 143 0.7 5.7 0.4 67.3 13.2
3. 217.118.16.25 0.0% 143 3.3 5.3 3.3 63.5 8.6
4. 194.25.211.53 0.0% 143 3.4 5.5 3.2 61.1 9.1
5. vie-sb2-i.VIE.AT.NET.DTAG.DE 0.7% 143 17.8 21.7 17.6 131.1 14.8
vie-sb2-i.VIE.AT.NET.DTAG.DE …Run Code Online (Sandbox Code Playgroud) compression ×2
linux ×2
proxy ×2
apache-2.2 ×1
arch-linux ×1
bandwidth ×1
debian ×1
diagnostic ×1
drbd ×1
git ×1
gitlab ×1
gzip ×1
jetty ×1
mtr ×1
mv ×1
networking ×1
nginx ×1
node.js ×1
packetloss ×1
putty ×1
server-setup ×1
ssh ×1
symlink ×1
xen ×1