curl

How do i fix bash error - /dev/tty No such device or address

邮差的信 提交于 2020-08-10 20:09:34
问题 As the question specifics ,i am getting this error while executing my bash script In exact terms i get following error bash: line 26: /dev/tty: No such device or address bash: line 29: /dev/tty: No such device or address Here are the concerned Line 26 and 29 in script respectively which causes the issue read -e -p "Paste the links : " links </dev/tty read -e -p "Enter your input : " sub </dev/tty If someone wonders, i cannot simply remove writing to </dev/tty from line 26 and 29 , it causes

How do i fix bash error - /dev/tty No such device or address

陌路散爱 提交于 2020-08-10 20:08:46
问题 As the question specifics ,i am getting this error while executing my bash script In exact terms i get following error bash: line 26: /dev/tty: No such device or address bash: line 29: /dev/tty: No such device or address Here are the concerned Line 26 and 29 in script respectively which causes the issue read -e -p "Paste the links : " links </dev/tty read -e -p "Enter your input : " sub </dev/tty If someone wonders, i cannot simply remove writing to </dev/tty from line 26 and 29 , it causes

How to urlencode url params with a curl POST but not urlencode the body data?

你离开我真会死。 提交于 2020-08-10 19:42:32
问题 When making a curl POST call with something like ... | curl -XPOST --data @- https://example.com/ can I also url-encode some url params on the command line (using curl itself, not bash funcs) without having to encode them myself and put them in the url argument to curl? So I want the POST Body to not be urlencoded, but the url params to be url encoded within the same curl command. So for example: echo '{"username":"a","password": [1,2]}' | curl --header "Content-Type: application/json" -

Elasticsearch系列---生产集群的索引管理

烂漫一生 提交于 2020-08-10 19:32:17
概要 索引是我们使用Elasticsearch里最频繁的部分日常的操作都与索引有关,本篇从运维人员的视角,来玩一玩Elasticsearch的索引操作。 基本操作 在运维童鞋的视角里,索引的日常操作除了CRUD,还是打开关闭、压缩、alias重置,我们来了解一下。 创建索引 [esuser@elasticsearch02 ~]$curl -XPUT 'http://elasticsearch02:9200/music?pretty' -H 'Content-Type: application/json' -d ' { "settings" : { "index" : { "number_of_shards" : 3, "number_of_replicas" : 2 } }, "mappings" : { "type1" : { "properties" : { "name" : { "type" : "text" } } } } }' { "acknowledged": true, "shards_acknowledged": true } 默认情况下,索引创建命令会在每个primary shard的replica shard 开始进行复制后,或者是请求超时之后,返回响应消息,如上。 acknowledged表示这个索引是否创建成功, shards_acknowledged

weaviate error code 400 parsing body from … failed invalid character 'G' looking for beginning of object

柔情痞子 提交于 2020-08-10 19:19:39
问题 I am trying to follow the steps at https://www.semi.technology/documentation/weaviate/current/client-libs/python.html and end up with the same problem as in: parsing body body from \"\" failed, because invalid character 'G' looking for beginning of object key string Since the other question never got an answer i am trying to ask with more detail in the weaviate context. I tried the following python-unit test: ''' Created on 24.07.2020 @author: wf ''' import unittest import weaviate class

weaviate error code 400 parsing body from … failed invalid character 'G' looking for beginning of object

血红的双手。 提交于 2020-08-10 19:19:25
问题 I am trying to follow the steps at https://www.semi.technology/documentation/weaviate/current/client-libs/python.html and end up with the same problem as in: parsing body body from \"\" failed, because invalid character 'G' looking for beginning of object key string Since the other question never got an answer i am trying to ask with more detail in the weaviate context. I tried the following python-unit test: ''' Created on 24.07.2020 @author: wf ''' import unittest import weaviate class

Get HTML from URL using curl in PHP

吃可爱长大的小学妹 提交于 2020-08-10 18:59:27
问题 I am trying to get HTML source from URL using curl. The below code works perfectly in localhost but it does not return anything when moved to server: function get_html_from_url($url) { $options = array( CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false, CURLOPT_FOLLOWLOCATION => false, CURLOPT_ENCODING => "", CURLOPT_USERAGENT => "User-agent: Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3", CURLOPT_AUTOREFERER =

Vagrant 更新win10后无法请求虚拟机

左心房为你撑大大i 提交于 2020-08-10 18:18:12
问题:更新win10后,虚拟机突然无法被主机请求, 1.可以正常启动,ssh也能连上 2.能够ping通, 3.在虚拟机内部可以通过curl请求,如curl 192.168.10.10:9503 解决: 最后把虚拟机的这些网络连接禁用掉,挂起vagrant halt,再重启vagrant up,会自动生成一个新的网络连接,然后就可以正常访问了 至于是什么具体原因,还没有深入去研究,不过按照猜测可能是生成了多个虚拟机桥接造成了网络冲突 来源: oschina 链接: https://my.oschina.net/u/2007165/blog/4340002

yum安装node.js

浪子不回头ぞ 提交于 2020-08-10 14:30:00
删除旧的 nodejs 版本: yum remove nodejs 第1步 - 添加Node.js Yum存储库 首先,您需要在Node.js官方网站提供的系统中启用node.js yum存储库。您还需要开发工具来构建要在系统上安装的本机加载项。 稳定发布: $ yum clean all && yum makecache fast $ yum install -y gcc-c++ make $ curl -sL https: //rpm .nodesource.com /setup_10 .x | sudo -E bash - 第2步 - 在CentOS上安装Node.js. 在系统中添加yum存储库后,让我们安装Node.js包。NPM也将与node.js一起安装。此命令还将在您的系统上安装许多其他依赖包。 $ sudo yum install nodejs 第3步 - 检查Node.js和NPM版本 安装node.js后验证并检查已安装的版本 node -v 另外,检查npm的版本 $ npm - v 安装wiki http://www.amdoing.com/docsify-is-the-simplest-blog/ 来源: oschina 链接: https://my.oschina.net/wangyunlong/blog/4282726

Linux150个基础命令

不问归期 提交于 2020-08-10 10:34:33
1.mkdir 创建目录 * 主要选项:-p 递归创建目录 主要案列:mkdir /jingfeng mkdir -p /jingfeng/jf mkdir -p /jingfeng/jf{1,2} #创建多个目录 2.cd 切换路径 * 主要案例:cd 或 cd ~ #切换至家目录 cd - #在上一个目录和当前目录来回切换 cd ~jingfeng #切换至某用户的家目录 cd .. #切换至上一级目录 3.ls 查看目录或文件信息 * 主要选项:-l 列出目录或者文件的详细信息。比如权限、修改时间等等 -a 列出当前目录下所有文件,包括隐藏文件(已点开头的都是隐藏文件) -A 列出除.和..之外的所有文件 -h 已人类能查看的方式,列出文件的大小 -d 只列出目录的详细信息 -F 给不同文件结尾加不同标识 -p 给目录结尾加斜线 -t 按修改时间排序 -r 反转排序 -i 查看 inode 节点 --time-style=long-iso 格式化属性时间 -R 递归 主要案例:1、ls -l #列出目录或者文件的详细信息 -rw-r--r-- 1 root root 1 Aug 5 21:24 jingfeng.txt 2、ls -la #列出当前目录下所有文件,包括隐藏文件 -rw------- 1 root root 18029 Aug 11 22:05 .bash