| 参数 | 描述 |
|---|---|
| -I/–head | 只显示传输文档,经常用于测试连接本身 |
| -o/–output | 把输出写到该文件中,必须输入保存文件名 |
| -O/–remote-name | 把输出写到该文件中,保留远程文件的文件名 |
| -F/–form | 模拟表单提交 |
| -s/–silent | 静默模式,不输出任何东西 |
| -S/–show-error | 显示错误,在选项 -s 中,当 curl 出现错误时将显示 |
| -L/–location | 跟踪重定向 |
| -f/–fail | 不输出错误 |
| -n/–netrc | 从netrc文件中读取用户名和密码 |
| –netrc-optional | 使用 .netrc 或者 URL来覆盖-n |
| –ntlm | 使用 HTTP NTLM 身份验证 |
| -N/–no-buffer | 禁用缓冲输出 |
| -p/–proxytunnel | 使用HTTP代理 |
| –proxy-anyauth | 选择任一代理身份验证方法 |
| –proxy-basic | 在代理上使用基本身份验证 |
| –proxy-digest | 在代理上使用数字身份验证 |
| –proxy-ntlm | 在代理上使用ntlm身份验证 |
| -P/–ftp-port | 使用端口地址,而不是使用PASV |
| -M/–manual | 显示全手动 |
| -Q/–quote | 文件传输前,发送命令到服务器 |
| -r/–range | 检索来自HTTP/1.1或FTP服务器字节范围 |
| –range-file | 读取(SSL)的随机文件 |
| -R/–remote-time | 在本地生成文件时,保留远程文件时间 |
| –retry | 传输出现问题时,重试的次数 |
| –retry-delay | 传输出现问题时,设置重试间隔时间 |
| –retry-max-time | 传输出现问题时,设置最大重试时间 |
| –socks4 | 用socks4代理给定主机和端口 |
| –socks5 | 用socks5代理给定主机和端口 |
| -t/–telnet-option | Telnet选项设置 |
| –trace | 对指定文件进行debug |
| –trace-ascii Like | 跟踪但没有hex输出 |
| –trace-time 跟踪/ | 详细输出时,添加时间戳 |
| -T/–upload-file | 上传文件 |
| -u/–user | 设置服务器的用户和密码 |
| -U/–proxy-user | 设置代理用户名和密码 |
| -V/–version | 显示版本信息 |
| -w/–write-out [format] | 什么输出完成后 |
| -x/–proxy | 在给定的端口上使用HTTP代理 |
| -X/–request | 指定什么命令 |
| -y/–speed-time | 放弃限速所要的时间。默认为30 |
| -Y/–speed-limit | 停止传输速度的限制,速度时间’秒 |
| -z/–time-cond | 传送时间设置 |
| -0/–http1.0 | 使用HTTP 1.0 |
| -1/–tlsv1 | 使用TLSv1(SSL) |
| -2/–sslv2 | 使用SSLv2的(SSL) |
| -3/–sslv3 | 使用的SSLv3(SSL) |
| –3p-quote | like -Q for the source URL for 3rd party transfer |
| –3p-url | 使用url,进行第三方传送 |
| –3p-user | 使用用户名和密码,进行第三方传送 |
| -4/–ipv4 | 使用IP4 |
| -6/–ipv6 | 使用IP6 |
| -#/–progress-bar | 用进度条显示当前的传送状态 |
Month: September 2019
linux 启动项
(1)编辑文件 /etc/rc.local
/etc/init.d/memcached start #memcache开机启动
#在文件末尾(exit 0之前)加上你开机需要启动的程序或执行的命令即可(执行的程序需要写绝对路径,添加到系统环境变量的除外)如:/usr/local/thttpd/sbin/thttpd -C /usr/local/thttpd/etc/thttpd.conf
(2)chkconfig
第1步:把上面的脚本放在/etc/init.d/文件夹下。
vim 启动文件,文件前面务必添加如下三行代码,否侧会提示chkconfig不支持
#!/bin/sh 告诉系统使用的shell,所以的shell脚本都是这样
#chkconfig: 35 20 80 分别代表运行级别,启动优先权,关闭优先权,此行代码必须
#description: http server(自己随便发挥)//两行都注释掉!!!,此行代码必须
ln -s ./supervisord /etc/init.d/supervisord
第2步:将启动脚本权限改为可执行。
chmod a+x /etc/init.d/supervisord
第3步:添加启动项。
chkconfig --add supervisord
chkconfig supervisord on
第4步:检查是否设置成功。
chkconfig --list | grep supervisord
supervisord 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
Source Map in Webpack
https://www.jianshu.com/p/dace0845bf36
ios safari ,app webview 在chrome devtool 里调试
https://github.com/google/ios-webkit-debug-proxy
可以跳过上面链接 直接用这个https://github.com/RemoteDebug/remotedebug-ios-webkit-adapter
安装完成后 启动
remotedebug_ios_webkit_adapter --port=9000
前面加 DEBUG=remotedebug 可以显示日志
打开 chrome://inspect 在discover network target 添加 localhost:9000
brew
基本操作
操作 命令
更新 Homebrew brew update
更新所有安装过的软件包 brew upgrade
更新指定的软件包 brew upgrade wget
查找软件包 brew search wget
安装软件包 brew install wget
卸载软件包 brew remove wget
列出已安装的软件包 brew list
查看软件包信息 brew info wget
列出软件包的依赖关系 brew deps wget
列出可以更新的软件包 brew outdated
临时使用代理
brew支持全局socks代理,使用前打开终端,加上这一句:
export ALL_PROXY=socks5://127.0.0.1:portnumber
前提是你要有socks代理。。。
或者 ALL_PROXY=socks5://127.0.0.1:1081 brew upgrade
固定代理
brew用curl下载,所以给curl挂上socks5的代理即可。
在~/.curlrc文件中输入代理地址即可。
socks5 = "127.0.0.1:1080"
刷新 dns 缓存
/etc/init.d/nscd restart
如果是systemd管理服务:
systemctl restart nscd
Mac:
sudo killall -HUP mDNSResponder
Windows:
ipconfig /flushdns
react-admin UI
1. SimpleForm 设置默认值 defaultValue={}
[cc lang=”js”]const customInput = ({record}) => (input type=”text” />)[/cc]
2 组件隐藏或显示
[cc lang=”js”]
import React from ‘react’;
import { EmailField } from ‘react-admin’;
const ConditionalEmailField = ({ record, …rest }) =>
record && record.hasEmail
?
: null;
export default ConditionalEmailField;[/cc]
——————————————————————
[cc lang=”js”]
3 post 一条记录里有个标签数组, 根据 tag_id 查询标签
http://myapi.com/tags?id=[1,23,4] 使用GET_MANY
[cc lang=”js”]
根据post id 查询 这个post 下的 comments ,使用GET_MANY_REFERENCE
comments?post_Id= 12 // 默认会把id 赋给 post_id
————————————–
4 在提交之前更改表单值
https://marmelab.com/react-admin/Actions.html#query-and-mutation-components
https://marmelab.com/react-admin/Actions.html#altering-the-form-values-before-submitting
——————————————————————
5 警告错误 : Warning: React does not recognize the `basePath` prop on a DOM element.
If you intentionally want it to appear in the DOM as a custom
attribute, spell it as lowercase `basepath` instead. If you
accidentally passed it from a parent component, remove it from the DOM
element.
In order to get rid of the basePath error, just sanitize the props passed to the Material UI Grid Component:
[cc lang=”js”]const SanitizedGrid = ({basePath, …props}) => {
return (
);
};[/cc]
————————————————–
6 数据查询与提交
dataProvider 可以用第四个参数处理 side effect 如 notification
[cc lang=”js”]// in src/comments/ApproveButton.js
import {
– showNotification,
UPDATE,
withDataProvider,
} from ‘react-admin’;
-import { push } from ‘react-router-redux’;
class ApproveButton extends Component {
handleClick = () => {
const { dataProvider, dispatch, record } = this.props;
const updatedRecord = { …record, is_approved: true };
– dataProvider(UPDATE, ‘comments’, { id: record.id, data: updatedRecord })
– .then(() => {
– dispatch(showNotification(‘Comment approved’));
– dispatch(push(‘/comments’));
– })
– .catch((e) => {
– dispatch(showNotification(‘Error: comment not approved’, ‘warning’))
– });
– }
+ dataProvider(UPDATE, ‘comments’, { id: record.id, data: updatedRecord }, {
+ onSuccess: {
+ notification: { body: ‘Comment approved’, level: ‘info’ },
+ redirectTo: ‘/comments’,
+ },
+ onFailure: {
+ notification: { body: ‘Error: comment not approved’, level: ‘warning’ }
+ }
+ })
render() {
return
}
}
ApproveButton.propTypes = {
dataProvider: PropTypes.func.isRequired,
– dispatch: PropTypes.func.isRequired,
record: PropTypes.object,
};
export default withDataProvider(ApproveButton);[/cc]
————————————————
7 根据权限显示哪些按钮
[cc lang=”js”]const UserCreateToolbar = ({ permissions, …props }) =>
{permissions === ‘admin’ &&
export const UserCreate = ({ permissions, …props }) =>
defaultValue={{ role: ‘user’ }}
>
{permissions === ‘admin’ &&