使用cURL POST上传文件
发布时间:August 8, 2013 // 分类:网络工具 // No Comments
cURL以application/x-www-url-encoded方式POST表单,实现类似于浏览器表单登录:
curl -c ck.txt -d "name=user&pw=password" "https://www.haiyun.me/login.php" 以multipart/form-data二进制数据上传文件,-F为提交的表单参数:
curl -i -b qi.txt -F "file=@test.tar.gz;filename=c.tar.gz" \
-F "autoDir=flase" \
-F "parentPath=/Share/2013/08/08" \
-F "desc=tes.tar.gz" \
"https://www.haiyun.me/view?module=upload&action=uploadSave”对于大文件上传cURL会自动添加Expect: 100-continue首部,有的服务器不支持此功能会返回HTTP/1.1 417 Expectation failed,添加HEAD解决:
-H "Expect:"有的不能正常发送MIME需手工指定:
file=@test.tar.gz;filename=c.tar.gz;type=application/x-rar        cURL超时设置和重试
发布时间:August 7, 2013 // 分类:网络工具 // No Comments
使用cURL采集数据或测试服务器时防止一直连接要用到超时和重连设置,连接超时参数:
--connect-timeout 
#连接超时秒
-m
#总连接超时秒,包含连接超时连接超时后重连参数:
--retry 
#重连次数
--retry-delay
#等待多少秒重连示例:
curl.exe -I -m 5 --retry-delay 2 --retry 2 127.0.0.1PHP CURL超时设置:
#连接超时
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,3);
#curl最大执行时间
curl_setopt($ch, CURLOPT_TIMEOUT,5);
#1秒内传输1字节数据终止
curl_setopt($ch, CURLOPT_LOW_SPEED_TIME, '1');
curl_setopt($ch, CURLOPT_LOW_SPEED_LIMIT, '1');        BT5安装初始化设置国内软件源及网络IP
发布时间:October 8, 2012 // 分类:网络工具 // No Comments
BT5连接官方源较慢,更改为科大提供的源:
cd /etc/apt/
cp sources.list sources.list.bakcat sources.list
#https://www.haiyun.me
deb http://mirrors.ustc.edu.cn/backtrack/source revolution main microverse non-free testing
deb http://mirrors.ustc.edu.cn/backtrack/all revolution main microverse non-free testing
deb http://mirrors.ustc.edu.cn/backtrack/32 revolution main microverse non-free testing设置固定IP,默认为DHCP:
cat /etc/network/interfaces 
auto eth0
iface eth0 inet static
address 192.168.1.31
netmask 255.255.255.0
gateway 192.168.1.1重启网络生效:
/etc/init.d/networking restart        分类
- Apache (13)
 - Nginx (45)
 - PHP (86)
 - IIS (8)
 - Mail (17)
 - DNS (16)
 - Cacti (14)
 - Squid (5)
 - Nagios (4)
 - Puppet (7)
 - CentOS (13)
 - Iptables (23)
 - RADIUS (3)
 - OpenWrt (41)
 - DD-WRT (1)
 - VMware (9)
 - 网站程序 (2)
 - 备份存储 (11)
 - 常用软件 (20)
 - 日记分析 (10)
 - Linux基础 (18)
 - 欧诺代理 (0)
 - Linux服务 (18)
 - 系统监控 (4)
 - 流量监控 (7)
 - 虚拟化 (28)
 - 伪静态 (2)
 - LVM (3)
 - Shell (18)
 - 高可用 (2)
 - 数据库 (16)
 - FreeBSD (3)
 - 网络安全 (25)
 - Windows (35)
 - 网络工具 (22)
 - 控制面板 (3)
 - 系统调优 (10)
 - Cisco (3)
 - VPN (6)
 - ROS (20)
 - Vim (14)
 - KMS (4)
 - PXE (2)
 - Mac (1)
 - Git (1)
 - PE (1)
 - LNS (2)
 - Xshell (7)
 - Firefox (13)
 - Cygwin (4)
 - OpenSSL (9)
 - Sandboxie (3)
 - StrokesPlus (1)
 - AutoHotKey (4)
 - Total Commander (3)
 - WordPress (3)
 - iMacros (6)
 - Typecho (2)
 - Ollydbg (1)
 - Photoshop (1)
 - 正则 (3)
 - Debian (3)
 - Python (8)
 - NoSQL (6)
 - 消息队列 (4)
 - JS (7)
 - Tmux (3)
 - GO (7)
 - HHVM (2)
 - 算法 (1)
 - Docker (2)
 - PT (15)
 - N1 (16)
 - K2P (6)
 - LUKS (4)
 
最新文章
- sandboxie plus运行firefox 140播放视频全屏不能覆盖任务栏
 - TEWA-1100G光猫使用
 - 烽火光猫HG5382A3使用
 - 记联通更换移动XG-040G-MD光猫
 - smokeping slave同步错误illegal attempt to update using time解决
 - 使用valgrind定位解决smartdns内存泄露
 - 此内容被密码保护
 - debian12下initramfs-tools配置ip子网掩码255.255.255.255/32失败解决
 - iPhone查看屏幕供应商
 - 光猫拨号ImmortalWrt/OpenWRT路由获取ipv6遇到的问题