不管实在开发还是在日常使用中,梯子是必不可少的工具,但是在linux系统中,有时候操作起来不是那么方便,于是在此做个笔记。

0x01 环境变量设置


  1. # 设置代理;
  2. echo 'export https_proxy="http://127.0.0.1:7890"' >> ~/.bashrc
  3. echo 'export http_proxy=$https_proxy' >> ~/.bashrc
  4. echo 'export ftp_proxy=$https_proxy' >> ~/.bashrc
  5. echo 'export proxy=$https_proxy' >> ~/.bashrc
  6. echo 'export HTTPS_PROXY=$https_proxy' >> ~/.bashrc
  7. echo 'export HTTP_PROXY=$https_proxy' >> ~/.bashrc
  8. echo 'export FTP_PROXY=$https_proxy' >> ~/.bashrc
  9. echo 'export PROXY=$https_proxy' >> ~/.bashrc
  10. # 取消代理;
  11. vim ~/.bashrc # 编辑.bashrc文件删除或注释代理设置;

0x02 apt 代理设置


  1. # 设置代理;
  2. echo 'Acquire::http::proxy "http://127.0.0.1:7890";' | tee -a /etc/apt/apt.conf
  3. echo 'Acquire::https::proxy "https://127.0.0.1:7890";' | tee -a /etc/apt/apt.conf
  4. # 取消代理;
  5. vim /etc/apt/apt.conf # 编辑apt.conf文件删除或注释代理设置;

0x03 wget 代理设置


  1. # 设置代理;
  2. echo 'https_proxy=http://127.0.0.1:7890' | tee -a /etc/wgetrc
  3. echo 'http_proxy=http://127.0.0.1:7890' | tee -a /etc/wgetrc
  4. echo 'ftp_proxy=http://127.0.0.1:7890' | tee -a /etc/wgetrc
  5. echo '#check_certificate = off' >> ~/.wgetrc
  6. # 取消代理;
  7. vim /etc/wgetrc # 编辑wgerrc文件删除或注释代理设置;

0x04 curl 代理设置


  1. # 设置代理;
  2. echo 'proxy = "http://127.0.0.1:7890"' >> ~/.curlrc
  3. echo '#insecure' >> ~/.curlrc
  4. # 取消代理;
  5. vim ~/.curlrc # 编辑curlrc文件删除或注释代理设置;

0x05 git 代理设置


  1. # 设置代理;
  2. git config --global https.proxy http://127.0.0.1:7890
  3. git config --global http.proxy http://127.0.0.1:7890
  4. # 取消代理;
  5. git config --global --unset http.proxy
  6. git config --global --unset https.proxy
  7. # 取消代理;
  8. git config --global -l # 查看git设置;
  9. git config --global -e # 编辑git设置,删除设置;

0x06 pip 代理设置


  1. # pip 代理命令语法;
  2. pip [command] --proxy http://[address]:[port] [arg]
  3. # 代理安装pyperclip示例;
  4. pip install --proxy http://127.0.0.1:7890 pyperclip

0x07 docker 代理设置


  1. # 设置代理;
  2. mkdir /etc/systemd/system/docker.service.d
  3. echo '[Service]' | tee -a /etc/systemd/system/docker.service.d/http-proxy.conf
  4. echo 'Environment="HTTP_PROXY=http://127.0.0.1:7890"' | tee -a /etc/systemd/system/docker.service.d/http-proxy.conf
  5. systemctl daemon-reload
  6. systemctl restart docker
  7. # 取消代理;
  8. vim /etc/systemd/system/docker.service.d # 编辑docker.service.d文件删除或注释代理设置;

Linux(debian)常用代理设置相关推荐

  1. MongoDB在Linux下常用优化设置

    MongoDB在Linux下常用优化设置 以下是一些MongoDB推荐的常用优化设置.在生产环境下选取合适的参数值,例如预读值和默认文件描述符数目等,会对系统性能有很大的影响. 1.关闭数据库文件的 ...

  2. Linux下 curl 代理设置注意事项--curl proxy

    参考:linux - performing HTTP requests with cURL (using PROXY) - Stack Overflow 如果你在bash中设置了代理,如 http_p ...

  3. Linux Debian常用下载工具Transmission和qbittorrent

    1.Transmission Transmission是Linux Debian系统下的系统自带的一种BitTorrent客户端下载工具,下载速度比较快.在Linux系统可以替代windows上的迅雷 ...

  4. linux下Git代理设置

    1.设置路由器 2.linux设置 git http proxy note:ip为二级代理机的ip. $ git config --global http.proxy http://192.168.0 ...

  5. linux服务端代理设置与linux下载工具

    sock5代理服务端 https://www.cnblogs.com/marklove/p/9669025.html 有时候ss5启动不起来,查看当前状态,提示 #service ss5 status ...

  6. Linux的常用命令有哪些?

    Linux的常用命令 设置变量生效: $ source /etc/profile 编辑全局变量: $ vim /etc/profile 删除文件:$ rm -f 文件名 解压文件:$ tar -zxv ...

  7. linux中vim如何显示行数,vim 在linux下中如何设置显示行数

    在.vimrc(或/etc/vimrc)文件中输入如下文本: set tabstop=4 set softtabstop=4 set shiftwidth=4 set noexpandtab set ...

  8. vim 在linux下中如何设置显示行数

    在.vimrc(或/etc/vimrc)文件中输入如下文本: set tabstop=4 set softtabstop=4 set shiftwidth=4 set noexpandtab set ...

  9. Linux命令行及各常用工具代理设置

    Linux命令行及各常用工具代理设置 命令行代理设置 1 通过命令行指定 直接为当前命令行设置代理 对当前终端的全部工具(apt.curl.wget.git 等全都有效) 以下仅以 http 代理为例 ...

最新文章

  1. LeetCode实战:两数相加
  2. wxWidgets:wxHelpController类用法
  3. 第二阶段 站立会议 02
  4. 用魔法打开科学,孩子惊叫连连,想不爱科学都难!
  5. 我对CSS vertical-align的一些理解与认识(二)
  6. [转载] JAVA 构造函数及其重载
  7. Qt工作笔记-把QTableWidget数据存为XML,启动时加载XML
  8. struts框架的原理和应用_分布式开源调度框架TBSchedule原理与应用
  9. 《嵌入式系统Linux内核开发实战指南(ARM平台)》书评
  10. BIDS 怪异现象(转载)
  11. python登陆pc微信_GitHub - ccboby/WechatPCAPI: 微信PC版的API接口,可通过Python调用微信获取好友、群、公众号列表,并收发消息等功能。...
  12. lokohelp康复机器人_Lokohelp康复机器人在脑卒中偏瘫患者下肢运动功能恢复中的应用...
  13. 关于MacOS降系统版本的处理方法
  14. 主流自媒体推广平台有哪些 如何用自媒体引流
  15. python是个啥-CPython是个什么鬼?
  16. 枚举类型的理解和应用
  17. 【web3.0设计】区块链如何解决真实交易的信用问题?
  18. 这才是数字孪生污水处理厂该有的样子 | 智慧水务
  19. 微软首席执行官鲍尔默简历
  20. vba 窗体计时器 出现类型错误

热门文章

  1. 【Jetson TX2】下载并安装JetPack
  2. asp.net core 对接拼多多(多多进宝)
  3. 陌生交友发布动态圈子单聊打招呼群聊app开发
  4. 让英文操作系统正确显示中文
  5. AnyView网络警V4破解版(26用户正式版)
  6. Panasonic推出P2Cast方案
  7. POJ 3133 Manhattan Wiring 笔记
  8. 四川计算机网络学校,成都计算机网络应用专业如何
  9. vue使用DPlayer播放摄像头
  10. 招聘 IT 类职位,哪些招聘渠道会比较有效?