curl

教你如何自己动手用Docker搭建一个etcd集群(附etcdctl命令说明)

廉价感情. 提交于 2021-02-01 09:22:58
阅读目录: 主机安装 集群搭建 API 操作 API 说明和 etcdctl 命令说明 etcd是 CoreOS 团队发起的一个开源项目(Go 语言,其实很多这类项目都是 Go 语言实现的,只能说很强大),实现了 分布式键值存储 和 服务发现 ,etcd 和 ZooKeeper/Consul 非常相似,都提供了类似的功能,以及 REST API 的访问操作,具有以下特点: 简单:安装和使用简单,提供了 REST API 进行操作交互 安全:支持 HTTPS SSL 证书 快速:支持并发 10 k/s 的读写操作 可靠:采用 raft 算法,实现分布式系统数据的可用性和一致性 etcd 可以单个实例使用,也可以进行集群配置,因为很多项目都是以 etcd 作为服务发现,比如 CoreOS 和 Kubernetes,所以,下面我们使用 Docker 简单搭建一下 etcd 集群。 1. 主机安装 如果不使用 Docker 的话,etcd 在主机上安装,也非常简单。 Linux 安装命令: $ curl -L https://github.com/coreos/etcd/releases/download/v3.3.0-rc.0/etcd-v3.3.0-rc.0-linux-amd64.tar.gz -o etcd-v3.3.0-rc.0-linux-amd64.tar.gz &&

zabbix监控nginx

混江龙づ霸主 提交于 2021-01-31 08:38:41
zabbix监控nginx 在zabbix的客户端wangb02机器上安装nginx并启动起来 在aminglinux02上安装Nginx 编辑yum仓库: [root@wangzb02 ~]# vi /etc/yum.repos.d/nginx.repo 粘贴: [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/7/$basearch/ gpgcheck=0 enabled=1 安装: [root@wangzb02 ~]# yum install -y nginx 配置Nginx状态信息 [root@wangzb02 ~]# vi /etc/nginx/conf.d/default.conf #增加 location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; } 测试 [root@wangzb02 ~]# curl 127.0.0.1/nginx_status Active connections: 1 server accepts handled requests 7 7 7 Reading: 0 Writing: 1 Waiting: 0 说明: Active Connections

记一次 Linux 被入侵,服务器变“矿机”全过程

余生颓废 提交于 2021-01-30 09:34:14
周一早上刚到办公室,就听到同事说有一台服务器登陆不上了,我也没放在心上,继续边吃早点,边看币价是不是又跌了。 不一会运维的同事也到了,气喘吁吁的说:我们有台服务器被阿里云冻结了,理由:对外恶意发包。 我放下酸菜馅的包子,SSH 连了一下,被拒绝了,问了下默认的 22 端口被封了。 让运维的同事把端口改了一下,立马连上去,顺便看了一下登录名 :root,还有不足 8 位的小白密码,心里一凉:被黑了! 查找线索 服务器系统 CentOS 6.X,部署了 Nginx,Tomcat,Redis 等应用,上来先把数据库全备份到本地,然后 Top 命令看了一下,有 2 个 99% 的同名进程还在运行,叫 gpg-agentd。 Google 了一下 GPG,结果是: GPG 提供的 gpg-agent 提供了对 SSH 协议的支持,这个功能可以大大简化密钥的管理工作。 看起来像是一个很正经的程序嘛,但仔细再看看服务器上的进程后面还跟着一个字母 d,伪装的很好,让人想起来 Windows 上各种看起来像 svchost.exe 的病毒。 继续排查: ps eho command -p 23374netstat -pan | grep 23374 查看 pid:23374 进程启动路径和网络状况,也就是来到了图 1 的目录,到此已经找到了黑客留下的二进制可执行文件。 接下来还有 2 个问题在等着我

记一次 Linux 被入侵,服务器变“矿机”全过程

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-30 09:33:34
程序员的成长之路 互联网/程序员/成长/职场 关注 阅读本文大概需要 4.2 分钟。 周一早上刚到办公室,就听到同事说有一台服务器登陆不上了,我也没放在心上,继续边吃早点,边看币价是不是又跌了。 不一会运维的同事也到了,气喘吁吁的说:我们有台服务器被阿里云冻结了,理由:对外恶意发包。 我放下酸菜馅的包子,SSH 连了一下,被拒绝了,问了下默认的 22 端口被封了。 让运维的同事把端口改了一下,立马连上去,顺便看了一下登录名 :root,还有不足 8 位的小白密码,心里一凉:被黑了! 查找线索 服务器系统 CentOS 6.X,部署了 Nginx,Tomcat,Redis 等应用,上来先把数据库全备份到本地,然后 Top 命令看了一下,有 2 个 99% 的同名进程还在运行,叫 gpg-agentd。 Google 了一下 GPG,结果是: GPG 提供的 gpg-agent 提供了对 SSH 协议的支持,这个功能可以大大简化密钥的管理工作。 看起来像是一个很正经的程序嘛,但仔细再看看服务器上的进程后面还跟着一个字母 d,伪装的很好,让人想起来 Windows 上各种看起来像 svchost.exe 的病毒。 继续排查: ps eho command -p 23374netstat -pan | grep 23374 查看 pid:23374 进程启动路径和网络状况,也就是来到了图

Curl quotes and variable trouble [duplicate]

杀马特。学长 韩版系。学妹 提交于 2021-01-29 19:33:29
问题 This question already has answers here : Difference between single and double quotes in Bash (6 answers) Closed 1 year ago . I need to run a curl command from a shell script that reads a file of host names. Here is the script that does not work: #!/bin/sh HOST="HOSTNAME" curl https://SOME_URL -H 'Content-Type: application/json' -H 'API-Key: SOME_KEY' --data-binary '{"query":"{\n actor {\n entitySearch(query: \"name LIKE \u0027$HOST\u0027\") {\n results {\n entities {\n guid\n }\n }\n }\n }\n}

How to write the following script in Powershell

你说的曾经没有我的故事 提交于 2021-01-29 18:55:22
问题 This question is related to: bash: C:/Program: No such file or directory What is the equivalent syntax to write the following in Powershell so that I can run this on Windows 10 without any problems? export DEBEZIUM_VERSION=1.1 docker-compose -f docker-compose-sqlserver.yaml up cat debezium-sqlserver-init/inventory.sql | docker exec -i tutorial_sqlserver_1 bash -c '/opt/mssql-tools/bin/sqlcmd -U sa -P $SA_PASSWORD' curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json"

send file to another website without file upload script on receiving website with curl and php

倾然丶 夕夏残阳落幕 提交于 2021-01-29 16:51:00
问题 I already know how to upload files via post data with php. But is it possible to upload a file to a different website with curl NB: there is no script on the receiving website to handle file uploads Just send a file to the website from another website straight up. How is that possible with php and curl ? 来源: https://stackoverflow.com/questions/17923008/send-file-to-another-website-without-file-upload-script-on-receiving-website-wit

curl_setopt returning false with CURLOPT_COOKIESESSION, CURLOPT_COOKIEJAR, CURLOPT_COOKIEFILE

跟風遠走 提交于 2021-01-29 15:05:31
问题 PHP version 5.4.19 under FreeBSD $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //returns true curl_setopt($ch, CURLOPT_HEADER, true); //returns true curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6'); //returns true curl_setopt($ch, CURLOPT_TIMEOUT, 100); //returns true curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //returns true curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //returns true var

How to I make a cURL command call from .Net Core 3.1 Code

爱⌒轻易说出口 提交于 2021-01-29 14:44:07
问题 I have this complicated cURL command that is working perfectly : curl -L --negotiate -u : -b ~/cookiejar.txt "https://idp.domain.net/oauth2/authorize? scope=openid&response_type=code&redirect_uri=https://localhost:5001&client_id=client_id_here" However it is not really feasible to replicate in C# using HttpClient. But I need to call the cURL command from .Net Core code and get the response back. Is there a way to make a normal cURL command call in .Net Core (v3.1)? (In case you are interested

how to use CURL formadd upload file with submit fields in c++?

喜欢而已 提交于 2021-01-29 14:25:05
问题 i want to upload file with some fields such as file ID identifier to server with CURL libary. after some experiments, i failed to send even the file ID to server. following is the code. any help or clue is appreciated :) the following code is based on the CURL library exmples Testlib554 unit, you can download the source code from here. and the detailed questions are followed. first, whether the files i want to upload is in right formadd format? actually , icant understand it well, how to add