Jump to content
XPEnology Community

How to use proxy in tinycore-redpill (TCRP)


Recommended Posts

This is for the user who must use proxy to access internet/github/google
setPROXY.sh

1. Create the setPROXY.sh script

touch setPROXY.sh

 

2.Prepare script content
You need to change the value of myproxy with your proxy setting.
It accect 2 way: http and socks5. like this

Quote

myproxy="http://[user]:[pwd]@[IP]:[port]"
eg:myproxy="http://myusername:mypwd@192.168.1.1:8080"
eg:myproxy="http://192.168.1.1:8080"

myproxy="socks5://[user]:[pwd]@[IP]:[port]"
eg:myproxy="socks5://myusername:mypwd@192.168.1.1:8080"
eg:myproxy="socks5://192.168.1.1:8080"

This is a template of setPROXY.sh

#!/bin/bash

myproxy="http://192.168.1.1:8080"

echo -e "curl and git's proxy will set to \033[1m$myproxy\033[0m"

#set proxy for current user's curl
echo "proxy=\"$myproxy\"" > $HOME/.curlrc
#set proxy for root's curl
echo "proxy=\"$myproxy\"" > /root/.curlrc

set proxy for git
git config --global http.proxy \"$myproxy\"
git config --global https.proxy \"$myproxy\"

this template script expected output will be: "curl and git's proxy will set to http://192.168.1.1:8080"

 

4.Using vi to change setPROXY.sh

vi setPROXY.sh

This is another correct sample of setPROXY.sh

#!/bin/bash

myproxy="socks5://192.168.1.1:8080"

echo "proxy=\"$myproxy\"" > $HOME/.curlrc
echo "proxy=\"$myproxy\"" > /root/.curlrc

git config --global http.proxy \"$myproxy\"

this script expected output will be nothing

After finishing editing, press "ESC" key, then enter ":wq" to save the file and exit

 

5. Run setPROXY.sh

bash setPROXY.sh

If there is no output from the shell, the proxy settings are in effect

 

Sorry about my English level, I hope it can help someone

 

------------------------------------------------------------

Spoiler

 

这适用于必须通过代理访问 internet/github/google 的情况
setPROXY.sh

1.创建setPROXY.sh脚本




touch setPROXY.sh

2. 准备脚本内容
你需要根据你的代理设置修改变量`myproxy`

它支持2种协议: http and socks5
参考写法如下

Quote

myproxy="http://[user]:[pwd]@[IP]:[port]"
eg:myproxy="http://myusername:mypwd@192.168.1.1:8080"
eg:myproxy="http://192.168.1.1:8080"

myproxy="socks5://[user]:[pwd]@[IP]:[port]"
eg:myproxy="socks5://myusername:mypwd@192.168.1.1:8080"
eg:myproxy="socks5://192.168.1.1:8080"

这是一个 `setPROXY.sh` 的模版




#!/bin/bash

myproxy="http://192.168.1.1:8080"

echo -e "curl and git's proxy will set to \033[1m$myproxy\033[0m"

#set proxy for current user's curl
echo "proxy=\"$myproxy\"" > $HOME/.curlrc
#set proxy for root's curl
echo "proxy=\"$myproxy\"" > /root/.curlrc

set proxy for git
git config --global http.proxy \"$myproxy\"
git config --global https.proxy \"$myproxy\"

这个模板脚本预期的输出是: "curl and git's proxy will set to http://192.168.1.1:8080"

 

4. 使用 vi 编辑 `setPROXY.sh`




vi setPROXY.sh

这是另一个的 `setPROXY.sh` 脚本,需要根据你的需要修改myproxy变量




#!/bin/bash

myproxy="socks5://192.168.1.1:8080"

echo "proxy=\"$myproxy\"" > $HOME/.curlrc
echo "proxy=\"$myproxy\"" > /root/.curlrc

git config --global http.proxy \"$myproxy\"

这个脚本预期的输出为(也就是没有输出)

完成编辑后按“ESC”键,再输入“:wq”保存文件退出

 

5. 运行`setPROXY.sh`




bash setPROXY.sh

如果shell没有输出,那说明代理设置成功了。

 

 

setPROXY.sh

  • Like 1
Link to comment
Share on other sites

  • flyride changed the title to How to use proxy in tinycore-redpill (TCRP)
  • 1 month later...
Posted (edited)

You don`t necessarily need code, not everyone knows the programming language, the proxy can also be configured in the system settings. The big plus here is that no additional software is needed. But there`s a minus in this method - this way allows you to connect anonymously only through one intermediary server. As far as I understood your way is better if you want to use proxy-pool. I personally don't like to bother with it, that`s why I`ve already set up my own https://soax.com/price-monitoring. It`s easier because you install it once, and if any problems arise, you can contact technical support, not always you can solve everything yourself.

Edited by morgenstern
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...