zoukankan      html  css  js  c++  java
  • centOS命令

    centos8网络设置命令: nmcli

    网路配置  https://www.cnblogs.com/yuanfang0903/p/11072122.html

    1、yum命令

      能够从指定的服务器自动下载rpm包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,常用命令:

        yum list,列出所有可更新的安装包

        yum list installed,列出所有已安装的包

        yum install xxx,安装xxx软件包和依赖,yum -y install,安装过程中自动同意

        yum -y remove x1 x2 x3,删除已安装的软件包x1,x2,x3

        yum search xxx,查找软件包

        yum install net-tools,安装所有包

      安装依赖软件包

    yum install -y yum-utils device-mapper-persistent-data lvm2

      设置yum源

    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

    2、curl 命令

      curl url -d param,访问一个链接,为HTTP请求,如curl "http://localhost:8080/" -d "param"

    如下用Java写的

    public class CurlUtil {
    
        public static String curlPost(String url,String param){
            String result="";
            CloseableHttpClient client=HttpClients.createDefault();
            HttpPost post=new HttpPost(url);
    
            try {
                //设置参数
                post.setEntity(new StringEntity(param));
                //获取响应
                CloseableHttpResponse response=client.execute(post);
                //解析response
                HttpEntity entity=response.getEntity();
                result=EntityUtils.toString(entity);
                //释放流,关闭连接
                EntityUtils.consume(entity);
                response.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return result;
        }
    
        public static void main(String[] args) {
            curlPost("http://www.baidu.com","");
        }
    }
  • 相关阅读:
    ThinkPHP5.1 行为与钩子
    PHP 商品秒杀抢购业务流程
    MySQL 读写分离
    Redis 管道
    Redis 事务
    Redis 锁机制
    ThinkPHP 实现队列
    MySQL 存储引擎
    分布式唯一ID分配问题
    Lightscape
  • 原文地址:https://www.cnblogs.com/yjh1995/p/12130418.html
Copyright © 2011-2022 走看看