Skip to content

Instantly share code, notes, and snippets.

View JingwenTian's full-sized avatar
🎯
Focusing

JingwenTian JingwenTian

🎯
Focusing
View GitHub Profile
@JingwenTian
JingwenTian / linux-wget.md
Last active March 21, 2023 19:30
linux - wget命令

Linux系统中的wget是一个下载文件的工具,它用在命令行下。对于Linux用户是必不可少的工具,我们经常要下载一些软件或从远程服务器恢复备份到本地服务器。wget支持HTTP,HTTPS和FTP协议,可以使用HTTP代理。所谓的自动下载是指,wget可以在用户退出系统的之后在后台执行。这意味这你可以登录系统,启动一个wget下载任务,然后退出系统,wget将在后台执行直到任务完成,相对于其它大部分浏览器在下载大量数据时需要用户一直的参与,这省去了极大的麻烦。

wget 可以跟踪HTML页面上的链接依次下载来创建远程服务器的本地版本,完全重建原始站点的目录结构。这又常被称作”递归下载”。在递归下载的时候,wget 遵循Robot Exclusion标准(/robots.txt). wget可以在下载的同时,将链接转换成指向本地文件,以方便离线浏览。

wget 非常稳定,它在带宽很窄的情况下和不稳定网络中有很强的适应性.如果是由于网络的原因下载失败,wget会不断的尝试,直到整个文件下载完毕。如果是服务器打断下载过程,它会再次联到服务器上从停止的地方继续下载。这对从那些限定了链接时间的服务器上下载大文件非常有用。

##1.命令格式:

wget [参数] [URL地址]
@JingwenTian
JingwenTian / GetGraphQLIntrospectionQuery.gql
Created April 14, 2022 15:25
Produce the GraphQL query recommended for a full schema introspection.
query IntrospectionQuery {
__schema {
queryType {
name
}
mutationType {
name
}
subscriptionType {
name
@JingwenTian
JingwenTian / composer.json.md
Created October 4, 2014 12:28
Composer Cheat Sheet for developers ( http://composer.json.jolicode.com/ )

###Composer Cheat Sheet for developers

Composer is the dependency manager for PHP and you are on a one-page-only documentation for this tool. Official documentation is on the official website, this page just brings you the essential.

One line installer

curl -sS https://getcomposer.org/installer | php

composer.phar command line

@JingwenTian
JingwenTian / gist:8591073
Last active February 22, 2021 09:24
使用ab对nginx进行压力测试, 结果中指标说明
Requests per second: 6065.46 [#/sec] (mean)
Time per request: 164.868 [ms] (mean)
Time per request: 0.165 [ms] (mean, across all concurrent requests)
Requests per second
#表示当前测试的服务器每秒可以处理6065.46个静态html的请求事务,后面的mean表示平均。这个数值表示当前机器的整体性能,值越大越好。
Time per request
#单个并发的延迟时间,后面的mean表示平均。
#隔离开当前并发,单独完成一个请求需要的平均时间。
{"lastUpload":"2020-06-16T02:02:33.817Z","extensionVersion":"v3.4.3"}
@JingwenTian
JingwenTian / twitter-proxy.md
Created October 4, 2014 10:01
nginx反代twitter完整镜像 (原文:http://jude.me/2014/10/04/twitter-mirror-2.html

示例

需要注意的几点

  • content-security-policy这个header要去掉,或者重写进你自己的域名,不然有些浏览器不会加载外部的元素
  • 使用proxy_cookie_domain替换cookies的作用域。twitter返回的cookies作用域是.twitter.com,也就是twitter.com的所有二级域名都可以调用,为使用者的安全考虑建议替换成反代所使用的二级域名比如tt.jude.me
@JingwenTian
JingwenTian / curl-example.md
Created October 21, 2014 16:21
linux curl 命令详解,以及常用curl实例 ( http://blog.51yip.com/linux/1049.html
  1. 抓取页面内容到一个文件中

curl -o home.html http://jingwentian.com

2.用-O(大写的),后面的url要具体到某个文件,不然抓不下来。我们还可以用正则来抓取东西

curl -O http://jingwentian.com/logo.png 
curl -O http://jingwentian.com/uploads/2010/[0-9][0-9]/demo.jpg  
@JingwenTian
JingwenTian / exceptions-tree.php
Created September 26, 2018 20:22 — forked from mlocati/exceptions-tree.php
Throwable and Exceptions tree
<?php
if (!function_exists('interface_exists')) {
die('PHP version too old');
}
$throwables = listThrowableClasses();
$throwablesPerParent = splitInParents($throwables);
printTree($throwablesPerParent);
if (count($throwablesPerParent) !== 0) {
die('ERROR!!!');
@JingwenTian
JingwenTian / README.md
Created June 10, 2019 03:49 — forked from magnetikonline/README.md
Setting Nginx FastCGI response buffer sizes.