Tag: systemd

2 Posts

阿里云ECS轻量服务器监控一键卸载
用过阿里云服务器(ECS、轻量应用服务器)的人应该都知道,阿里云提供的系统镜像里预装了它的各种监控服务。如:阿里云盾(安骑士)、云监控(Cloudmonitor)这些监控服务的存在使得人们可以直接在控制台看到当前系统的状态,某种程度上来说确实方便了服务器的管理。但是对于我们这种“爱折腾党”,基本没有用到这些服务的时候,而且天天被这些监控盯着还总有种被偷窥的感觉。卸载云盾(安骑士)在 官方文档 页面只介绍了怎么在控制台去卸载,手动卸载的操作步骤需要提交工单获取,不是很方便。在这里介绍一种用脚本手动卸载的方法(其实用的也是官方提供的两个脚本),执行以下命令即可。wget http://update.aegis.aliyun.com/download/uninstall.sh && chmod +x uninstall.sh &&./uninstall.sh wget http://update.aegis.aliyun.com/download/quartz_uninstall.sh && chmod +x quartz_uninstall.sh && ./quartz_uninstall.sh测试发现上面的脚本运行完之后可能还会有一些服务/文件/文件夹残留,所以我们手动清理一下,顺便把刚刚下下来的两个脚本文件也删了(如果提示文件不存在就不用管了)。sudo rm -r /usr/local/aegis sudo systemctl disable aliyun.service sudo rm /usr/sbin/aliyun-service sudo rm /usr/sbin/aliyun-service.backup sudo rm /usr/sbin/aliyun_installer sudo rm /etc/systemd/system/aliyun.service sudo rm /lib/systemd/system/aliyun.service rm uninstall.sh quartz_uninstall.sh卸载云监控(Cloudmonitor)云监控有 Java 版本和 Go 语言版本两种(Java 版本已经不再提供升级了,现在新开的服务器应该都是 Go 语言版本的),可以根据其安装目录 /usr/local/cloudmonitor/ 下的文件名判断你的服务器上装的具体是哪一种。下面分别介绍两个版本的卸载方法。卸载云监控 Go 语言版云监控 Go 语言版的可执行文件名为 CmsGoAgent.linux-${ARCH} ,其中的 ARCH 根据 Linux 架构的不同,分为 amd64 和 386 ,可以在其安装目录 /usr/local/cloudmonitor/ 下找到具体的文件名。为了方便表述,下面的命令中也使用 ${ARCH} 替代文件名中的系统架构部分。要能够直接复制下面的命令行去执行的话,可以先设置一下临时环境变量(相当于后面输入命令中的 ${ARCH} 会被自动替换成我们在这里设置的值)# 64 位系统 export ARCH=amd64 # 32 位系统 export ARCH=386或者的话你也可以在找到具体的文件名后自行替换。下面是卸载相关的一些命令:# 从系统服务中移除 /usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} uninstall # 停止 /usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} stop # 卸载 /usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} stop && \ /usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} uninstall && \ rm -rf /usr/local/cloudmonitor附上官方文档页面链接:https://help.aliyun.com/document_detail/97929.html卸载云监控 Java 版# 停止 /usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh stop # 卸载 /usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh remove && \ rm -rf /usr/local/cloudmonitor附上官方文档页面链接:https://help.aliyun.com/knowledge_detail/38859.html
MTG 一款Telegram专用代理工具
前言Telegram的几种内置代理,SOCKS5就不用说了,明文传输一用就被封MTProxy原来也还好,可惜现在被识别了,博主自己使用的情况,不管是官方版还是go语言版,基本没有坚持挺过24小时,就被阻断端口,虽然可以换端口,虽然有65535个端口可以更换,但还是非常麻烦。介绍MTG是基于 MTProxy的一个分支,基于代理的重放攻击的预防,在理论上是不会被干掉的MTG代理遵循 ShadowSocks的方式,并且 MTG非常的轻量,无论安装还是卸载都非常简单。一键安装bash <(wget -qO- https://git.io/mtg.sh)安装过程root@ubuntu:~# systemctl stop mtg && systemctl disable mtg Failed to stop mtg.service: Unit mtg.service not loaded. root@ubuntu:~# rm -f /usr/local/bin/mtg /lib/systemd/system/mtg.service /etc/mtg.conf root@ubuntu:~# bash <(wget -qO- https://git.io/mtg.sh) Verifying archive integrity... 100% All good. Uncompressing Bullshit-free MTPROTO proxy Bin package [build 2019-12-26] 100% ================================================== >Random port generated, input another if wish to change, press Enter to continue 65535 # 这里输入你要设定的端口,记得后台放行端口 Input a domain for FakeTLS mode, "bing.com" will be used if left empty # 这里输入TLS使用的域名,默认使用bing.com,建议直接回车使用默认域名 # 设置完这两项就OK,然后等待安装完成,在最后会给出你的TG代理连接 ================================================== > Using: PORT: 65535, FakeTLS DOMAIN : bing.com ================================================== > Downloading mtg binary ... 2020-01-22 13:13:15 URL:https://github-production-release-asset-2e65be.s3.amazonaws.com/135544649/cca8c080-0af8-11ea-9a56-32a4f2f0d345?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200122%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200122T051312Z&X-Amz-Expires=300&X-Amz-Signature=17d481bc81f881400c01e5d27b6de83f2eda890ef89aff01b0f7861d9b418aff&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dmtg-linux-amd64&response-content-type=application%2Foctet-stream [10481664/10481664] -> "/usr/local/bin/mtg" [1] FINISHED --2020-01-22 13:13:15-- Total wall clock time: 4.9s Downloaded: 1 files, 10.0M in 1.9s (5.34 MB/s) ================================================== v1.0.1 (go version go1.13.4 linux/amd64) [Tue, 19 Nov 2019 15:15:49 +0000] Created symlink from /etc/systemd/system/multi-user.target.wants/mtg.service to /lib/systemd/system/mtg.service. ================================================== >Installation Done. Waiting for service to load ... > Generated Secret: eed8229777e783af51b95da521ca008fb662696e672e636f6d > Mtg listening at port: 9024 > ... > Setup mtproxy in telegram with following URL: Jan 22 13:13:16 ubuntu mtg[5764]: "tme_url": "https://t.me/proxy?port=65535&secret=eed8229777e783af51b95da521ca008fb662696e672e636f6d&server=XX.XX.XX.XX", Jan…