curl

linux 查看内网IP和外网IP

北慕城南 提交于 2021-01-08 08:38:16
centos7 查看内网的ip,使用ifconfig 或在后面加上参数,都可以查看内网的ip,下面的10.105.33.17 即是内网的ip [root@VM_33_17_centos ~]#ifconfig -a eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.105.33.17 netmask 255.255.192.0 broadcast 10.105.63.255 ether 52:54:00:75:e5:57 txqueuelen 1000 (Ethernet) RX packets 155966 bytes 15667311 (14.9 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 44086 bytes 8285980 (7.9 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 loop txqueuelen 0 (Local Loopback) RX packets 0 bytes 0 (0.0

微信网页扫码登录的实现

荒凉一梦 提交于 2021-01-08 00:35:01
文档1: 为了让用户登录网站的门槛更低,微信扫一扫登录变得越来越广泛,所以最近加紧赶制的项目中有用到这个功能,此篇文字的出发点基于微信开放平台已经配置好域名(80端口)并且认证成功获得app_id和secret并有权限调用微信的接口。好了,就先谈一谈微信扫码登录的整个流程吧。   第一步,我们必须得把二维码放在页面上显示。首先普及一下二维码是有失效时间以及失效状态的,一旦你扫过一次二维码或者在某段时间内没有扫描页面上的二维码,该二维码就失效了。OK,微信官网给我们提供两种方式来显示二维码:1.后台发请求返回一个新的页面;2.前端js实例化二维码内嵌在自己的页面上,显然第一种比较适合懒的人(因为微信直接返回一个打包好的页面啊有木有,都不用各种css调样式了),不过在项目中两种都在用,所以就都说明一下。   1.后台发请求获取微信返回的扫码页面 $redirect_uri ="http://你的微信开放平台绑定域名下处理扫码事件的方法" ; $redirect_uri = urlencode ( $redirect_uri ); // 该回调需要url编码 $appID ="你的appid" ; $scope ="snsapi_login"; // 写死,微信暂时只支持这个值 //准备向微信发请求 $url = "https://open.weixin.qq.com/connect

cURL not sending file to API CALL

不羁的心 提交于 2021-01-07 05:39:45
问题 I am building a mobile site that runs from an API and have an API CALL handler class which does all the calls which I run from a primary functions file. The issue here is my files are not being sent through to the API and it's not recognising what is a file and is returning a file not present error. NOTE: ISSUE SOLVED AND WORKING CODE BELOW Code Below: FORM <form id="uploadPhoto" action="<?php uploadStreamPhoto(); ?>" method="post" enctype="multipart/form-data"> <input type="file" name=

cURL not sending file to API CALL

試著忘記壹切 提交于 2021-01-07 05:39:28
问题 I am building a mobile site that runs from an API and have an API CALL handler class which does all the calls which I run from a primary functions file. The issue here is my files are not being sent through to the API and it's not recognising what is a file and is returning a file not present error. NOTE: ISSUE SOLVED AND WORKING CODE BELOW Code Below: FORM <form id="uploadPhoto" action="<?php uploadStreamPhoto(); ?>" method="post" enctype="multipart/form-data"> <input type="file" name=

Python CURL output different from original html

谁说胖子不能爱 提交于 2021-01-07 01:44:18
问题 I am trying to get HTML body from Spotify web. But after I output it to the file the result is for some reason different from the original HTML (it's a completely different site). curl https://open.spotify.com/artist/4npEfmQ6YuiwW1GpUmaq3F > test.html Eventually, I will do in python so if anyone knows how to get around this page redirect, please help. 回答1: Spotify recognize that you use unsupported "browser", Curl is not a browser so don't think it will behave like one you will need to "fake"

Python CURL output different from original html

我怕爱的太早我们不能终老 提交于 2021-01-07 01:42:31
问题 I am trying to get HTML body from Spotify web. But after I output it to the file the result is for some reason different from the original HTML (it's a completely different site). curl https://open.spotify.com/artist/4npEfmQ6YuiwW1GpUmaq3F > test.html Eventually, I will do in python so if anyone knows how to get around this page redirect, please help. 回答1: Spotify recognize that you use unsupported "browser", Curl is not a browser so don't think it will behave like one you will need to "fake"

tail命令学习实例

萝らか妹 提交于 2021-01-07 00:50:42
tail 命令 将每个文件的最后10行打印到标准输出。对于多个文件,在每个文件前面加上一个给出文件名的头。如果没有文件,或者文件为 - ,则读取标准输入。 如何使用tail 命令 使用 tail 命令查看yum.log日志文件,显示最后10行内容,tail默认显示问价你的最后10行内容: [root@localhost ~]# tail /var/log/yum.log May 26 15:22:08 Installed: pytalloc-2.1.16-1.el7.x86_64 May 26 15:22:08 Updated: libwbclient-4.10.4-11.el7_8.x86_64 May 26 15:22:08 Installed: samba-libs-4.10.4-11.el7_8.x86_64 May 26 15:22:08 Updated: samba-common-libs-4.10.4-11.el7_8.x86_64 May 26 15:22:08 Updated: samba-client-libs-4.10.4-11.el7_8.x86_64 May 26 15:22:08 Updated: libsmbclient-4.10.4-11.el7_8.x86_64 May 26 15:22:08 Installed: libarchive-3.1.2

[Postman]生成代码段(17)

徘徊边缘 提交于 2021-01-06 17:31:04
在Postman中完成并保存您的请求后,您可能希望从您自己的应用程序发出相同的请求。 Postman允许您生成各种语言和框架的代码片段,以帮助您实现此目的。 您需要单击蓝色 发送 按钮 下的**代码**链接 以打开 GENERATE CODE SNIPPETS 模式。 选择一种语言 使用下拉菜单选择语言 - 某些语言有多种选择。 这使您可以选择不同的框架来发出请求。 支持的语言/框架 Postman目前支持以下选项: Language Framework HTTP None (Raw HTTP request) C LibCurl cURL None (Raw cURL command) C# RestSharp Go Built-in http package Java OkHttp Java Unirest JavaScript jQuery AJAX JavaScript Built-in XHR NodeJS Built-in http module NodeJS Request NodeJS Unirest Objective-C Built-in NSURLSession OCaml Cohttp PHP HttpRequest PHP pecl_http PHP Built-in curl Python Built-in http.client (Python 3)

docker 磁盘清理 相关

寵の児 提交于 2021-01-06 12:09:43
用户在使用 Docker 部署业务一段时间后,可能会发现宿主节点的磁盘容量持续增长,甚至将磁盘空间耗尽进而引发宿主机异常,进而对业务造成影响。 本文先对 Docker 的空间分析与清理进行说明,然后对容器的磁盘容量限制与使用建议做简要说明。 典型问题场景 用户发现 Docker 宿主机的磁盘空间使用率非常高。通过 du 逐层分析,发现是 Volume 或 overlay2 等目录占用了过高空间。示例如下: # 根据使用的存储驱动的不同,相应目录会有所不同: [root@node3 docker] # du -h --max-depth=1 |sort 104K ./network 13M ./image 20K ./plugins 24G ./overlay2 # 这个目录占用了非常高的磁盘磁盘空间 25G . 283M ./volumes 4.0K ./swarm 4.0K ./tmp 4.0K ./trust 518M ./containers 空间使用分析 遇到此类问题,可以参阅如下步骤进行空间分析,定位占用过高空间的业务来源。 分析 Docker 空间分布 Docker 的内置 CLI 指令 docker system df ,可用于查询镜像(Images)、容器(Containers)和本地卷(Local Volumes)等空间使用大户的空间占用情况。 示例输出如下:

[nginx] nginx源码分析--proxy模式下nginx的自动重定向auto_redirect

一笑奈何 提交于 2021-01-06 04:54:57
描述 我们配置了一个proxy模式下的nginx, upstream backend- test { server 127.0 . 0.1 : 80 ; } server { listen 8080 ; location = /nginx/hwwc/ { proxy_pass http: // backend-test; proxy_redirect off; } location / { return 500 ; } } 访问 http://t103:8080/nginx/hwwc/ 可以正常访问80端口的服务. 访问curl http://t103:8080/nginx/hwwc 的时候, 会返回301重定向. 他们的区别是结尾是否有一个"/" ┬─[tong@T7:~/Src/thirdparty/nginx.git]─[ 07 : 13 : 29 PM] ╰─ >$ curl http: // t103:8080/nginx/hwwc <html> <head><title> 301 Moved Permanently</title></head> <body bgcolor= " white " > <center><h1> 301 Moved Permanently</h1></center> <hr><center>nginx/ 1.12 . 2 </center>