zoukankan      html  css  js  c++  java
  • 设置全局代理

    设置代理

    ####
    # /usr/bin/proxy
    start(){
        # 开启浏览器代理
        gsettings set org.gnome.system.proxy.http host '1xx.1xx.1x.1xx'
        gsettings set org.gnome.system.proxy.http port 1xx
        gsettings set org.gnome.system.proxy mode 'manual'
    
        # 开启终端代理
        sed -i 's/export http_proxy=""/export http_proxy=http://1xx.1xx.1.1xx:1xx/' ~/.bashrc
        sed -i 's/export https_proxy=""/export https_proxy=http://1xx.1xx.1.1xx:1xx/' ~/.bashrc
        source ~/.bashrc
        
        # 说明: 开启成功之后,git也是走代理的
    }
    stop(){
        # 关闭浏览器代理
        gsettings set org.gnome.system.proxy mode 'none'
    
        # 关掉终端代理
        sed -i 's/export http_proxy=http://1xx.1xx.1.1xx:1xx/export http_proxy=""/' ~/.bashrc
        sed -i 's/export https_proxy=http://1xx.1xx.1.1xx:1xx/export http_proxy=""/' ~/.bashrc
        source ~/.bashrc
    }
    restart(){
        stop
        start
    }
    
    case "$1" in
        "start")
            start
            ;;
        "stop")
            stop
            ;;
        "restart")
            restart
            ;;
        *)
            echo "$0 start|stop|restart"
    esac
    
    

    查看本机ip

    curl ipinfo.io
    
  • 相关阅读:
    [机器人仿真软件(一)]V-REP与MATLAB进行通讯的方法
    TCP接收非法数据0xFFF4FFFD06的问题
    std::numeric_limits::epsilon
    linux 设置默认网关
    更换pip源
    实时屏幕传输
    安装node
    window 添加服务
    数据集格式
    jupyter 设置密码
  • 原文地址:https://www.cnblogs.com/liyugeng/p/12465924.html
Copyright © 2011-2022 走看看