我有两台机器,速度和质量.speed具有快速的Internet连接,并且正在运行将大量文件下载到磁盘的爬虫.质量有很多磁盘空间.我想在下载完成后将文件从速度移动到质量.理想情况下,我只是运行:
$ rsync --remove-source-files speed:/var/crawldir .
Run Code Online (Sandbox Code Playgroud)
但我担心rsync会取消尚未完成下载的源文件的链接.(我查看了源代码,但我没有看到任何可以防止这种情况的内容.)有什么建议吗?
当我尝试解密旧文件时,gpg2给了我这个错误:
gpg: public key decryption failed: Invalid public key algorithm
gpg: decryption failed: No secret key
Run Code Online (Sandbox Code Playgroud)
gpg1给了我这个错误:
gpg: Ohhhh jeeee: no decrypt() for 17
secmem usage: 1664/2432 bytes in 5/8 blocks of pool 2432/32768
Abort trap: 6
Run Code Online (Sandbox Code Playgroud) 我有以下简单的golang程序来下载Google的隐私政策.不幸的是,unexpected EOF在读取6861字节后,它总是会因错误而崩溃,即使文档更长.为什么?
package main
import "net"
import "fmt"
import "io"
import "os"
func die(msg string, s os.Error) {
fmt.Printf("%s crashed: %v\n", msg, s)
os.Exit(1)
}
func main() {
fd, err := net.Dial("tcp", "google.com:80")
if err != nil { die("dial", err) }
req := []byte("GET /intl/en/privacy/ HTTP/1.0\r\nHost: www.google.com\r\n\r\n")
_, err = fd.Write(req)
if err != nil { die("dial write", err) }
buf := make([]byte, 1024)
nr := 1
for nr > 0 {
nr, err = io.ReadFull(fd, buf)
if …Run Code Online (Sandbox Code Playgroud) 我今天回来了一个用于通过SSL登录Gmail的旧脚本.我上次运行它(几个月前)脚本工作正常,但现在它立即死亡:
<urlopen error The read operation timed out>
Run Code Online (Sandbox Code Playgroud)
如果我设置超时(无论多长时间),它会立即死亡:
<urlopen error The connect operation timed out>
Run Code Online (Sandbox Code Playgroud)
后者可以重现:
import socket
socket.setdefaulttimeout(30000)
sock = socket.socket()
sock.connect(('www.google.com', 443))
ssl = socket.ssl(sock)
Run Code Online (Sandbox Code Playgroud)
返回:
socket.sslerror: The connect operation timed out
Run Code Online (Sandbox Code Playgroud)
但我似乎无法重现前者,并且在通过代码进行大量踩踏之后,我不知道是什么导致了这一点.
当我使用apt-get安装或升级我的Ubuntu hardy系统时,我经常收到这样的消息:
$ sudo apt-get install foo
Reading package lists... Done
Segmentation faulty tree... 50%
$ sudo apt-get install foo
Reading package lists... Done
Building dependency tree
Reading state information... Done
Segmentation fault
$ sudo apt-get install foo
Reading package lists... Done
Building dependency tree
Reading state information... Done
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct NULL not valid
Aborted
cc -Os -g -Wall -DLOCAL_ROOT=\"/usr/share/polipo/www/\" -DDISK_CACHE_ROOT=\"/var/cache/polipo/\" -DCHUNK_SIZE=16384 -c -o http_parse.o http_parse.c
http_parse.c:1564: internal compiler error: Segmentation fault …Run Code Online (Sandbox Code Playgroud)