两个java文件里的两个类之间怎么引用?

1、定义两个java类

public class A{//定义一个A类,保存为A.java文件
   public void sA(){//定义一个A类中的方法sA
   }
}
public class B{//定义一个B类,保存为B.java文件
   public void sB(){//定义一个A类中的方法sB
   }
}

2、在A类中sA方法中使用B类

public void sA(){//
   B b = new B();//申明一个B对象
   b.sB();//调用B中的方法sB
}
发表在 日常 | 留下评论

卸载阿里云盾监控 & 屏蔽云盾 IP

为什么要卸载

默认购买的阿里云VPS都自带一个aliyundun和一个aliyun-service,名字叫阿里云盾(安骑士)
实质上是用来监控VPS是否安全,自动扫描进程、查杀病毒用的,会识别SS(R)进程
云盾IP来自阿里云的漏洞扫描机,它会定期探测VPS是否存在已知漏洞
(比如你装了一个WORDPRESS,过一阵子它会提醒你有漏洞,得花钱一键修复酱紫)

卸载阿里云盾监控

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

删除残留

pkill aliyun-service && rm -fr /etc/init.d/agentwatch /usr/sbin/aliyun-service && rm -rf /usr/local/aegis*

屏蔽云盾 IP

iptables -I INPUT -s 140.205.201.0/28 -j DROP
iptables -I INPUT -s 140.205.201.16/29 -j DROP
iptables -I INPUT -s 140.205.201.32/28 -j DROP
iptables -I INPUT -s 140.205.225.192/29 -j DROP
iptables -I INPUT -s 140.205.225.200/30 -j DROP
iptables -I INPUT -s 140.205.225.184/29 -j DROP
iptables -I INPUT -s 140.205.225.183/32 -j DROP
iptables -I INPUT -s 140.205.225.206/32 -j DROP
iptables -I INPUT -s 140.205.225.205/32 -j DROP
iptables -I INPUT -s 140.205.225.195/32 -j DROP
iptables -I INPUT -s 140.205.225.204/32 -j DROP
发表在 日常 | 留下评论

lnmp oneinstack安装

yum -y install wget screen curl python #for CentOS/Redhat
 # apt-get -y install wget screen curl python #for Debian/Ubuntu
 wget http://aliyun-oss.linuxeye.com/oneinstack-full.tar.gz #阿里云经典网络下载
 wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz #包含源码,国内外均可下载
 wget http://mirrors.linuxeye.com/oneinstack.tar.gz #不包含源码,建议仅国外主机下载
 tar xzf oneinstack-full.tar.gz
 cd oneinstack #如果需要修改目录(安装、数据存储、Nginx日志),请修改options.conf文件
 screen -S oneinstack #如果网路出现中断,可以执行命令`screen -R oneinstack`重新连接安装窗口
 ./install.sh #注:请勿sh install.sh或者bash install.sh这样执行

如何添加附加组件?

 

《安装》

如何添加附加组件?

./addons.sh

《安装》

如何添加虚拟主机?

./vhost.sh

《安装》

如何删除虚拟主机?

./vhost.sh del

《安装》

如何管理FTP账号?

./pureftpd_vhost.sh

《安装》

如何备份?

./backup_setup.sh # Set backup options 

《安装》

 ./backup.sh # Start backup, You can add cron jobs
   # crontab -l # Examples 
     0 1 * * * cd ~/oneinstack;./backup.sh  > /dev/null 2>&1 &

如何管理服务?

Nginx/Tengine/OpenResty:

service nginx {start|stop|status|restart|reload|configtest}

MySQL/MariaDB/Percona:

service mysqld {start|stop|restart|reload|status}

PHP:

service php-fpm {start|stop|restart|reload|status}

HHVM:

service supervisord {start|stop|status|restart|reload}

:hhvm进程交给supervisord管理,了解更多请访问《Supervisor管理hhvm进程
Apache:

service httpd {start|restart|stop}

Tomcat:

service tomcat {start|stop|status|restart}

Pure-Ftpd:

service pureftpd {start|stop|restart|status}

Redis:

service redis-server {start|stop|status|restart|reload}

Memcached:

service memcached {start|stop|status|restart|reload}

如何更新版本?

./upgrade.sh

《安装》

如何卸载?

./uninstall.sh

《安装》

发表在 日常 | 留下评论

vps 宽带测速

wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py && chmod +x speedtest.py && python speedtest.py
发表在 日常 | 留下评论

v2ray安装运行

V2Ray 的核心组件是一个命令行程序,它可以运行在多个平台上,并使用同样格式的参数和配置文件。预编译的核心程序可以在 Release 中下载到,解压即可运行。

如果你需要图形化界面的软件,请使用第三方客户端

V2Ray 的部分功能依赖于系统时间,请确保使用 V2Ray 的系统 UTC 时间误差在两分钟之内,时区无关。

验证安装包

V2Ray 提供两种验证方式:

  1. 安装包 zip 文件的 SHA1 摘要,在下载页面的 metadata.txt 文件中可以找到。
  2. 可运行程序(v2ray 或 v2ray.exe)的 gpg 签名,文件位于安装包中的 v2ray.sig 或 v2ray.exe.sig。签名公钥可以在代码库中找到。

命令行参数

V2Ray 的程序文件的命令行参数如下:

v2ray [-version] [-test] [-config=config.json] [-format=json]

其中:

  • -version: 只输出当前版本然后退出,不运行 V2Ray 主程序。
  • -test: 测试配置文件有效性,如果有问题则输出错误信息,不运行 V2Ray 主程序。
  • -config:
    • 默认格式为配置文件的路径,默认值是 config.json;
    • 当值为stdin:时,将从标准输入读取配置文件内容,调用者必须在输入完毕后关闭标准输入流。
  • -format: 配置文件格式,可选的值有:
    • json: JSON 格式;
    • pb 或 protobuf: Protobuf 格式;

Linux 安装脚本

V2Ray 提供了一个在 Linux 中的自动化安装脚本。这个脚本会自动检测有没有安装过 V2Ray,如果没有,则进行完整的安装和配置;如果之前安装过 V2Ray,则只更新 V2Ray 二进制程序而不更新配置。

以下指令假设已在 su 环境下,如果不是,请先运行 sudo su。

运行下面的指令下载并安装 V2Ray。当 yum 或 apt-get 可用的情况下,此脚本会自动安装 unzip 和 daemon。这两个组件是安装 V2Ray 的必要组件。如果你使用的系统不支持 yum 或 apt-get,请自行安装 unzip 和 daemon

bash <(curl -L -s https://install.direct/go.sh)

此脚本会自动安装以下文件:

  • /usr/bin/v2ray/v2ray:V2Ray 程序;
  • /etc/v2ray/config.json:配置文件;

此脚本会配置自动运行脚本。自动运行脚本会在系统重启之后,自动运行 V2Ray。目前自动运行脚本只支持带有 Systemd 的系统,以及 Debian / Ubuntu 全系列。

运行脚本位于系统的以下位置:

  • /lib/systemd/system/v2ray.service: Systemd
  • /etc/init.d/v2ray: SysV

脚本运行完成后,你需要:

  1. 编辑 /etc/v2ray/config.json 文件来配置你需要的代理方式;
  2. 运行 service v2ray start 来启动 V2Ray 进程;
  3. 之后可以使用 service v2ray start|stop|status|reload|restart|force-reload 控制 V2Ray 的运行。

go.sh 参数

go.sh 支持如下参数,可在手动安装时根据实际情况调整:

  • -p 或 --proxy: 使用代理服务器来下载 V2Ray 的文件,格式与 curl 接受的参数一致,比如 "socks5://127.0.0.1:1080" 或 "http://127.0.0.1:3128"
  • -f 或 --force: 强制安装。在默认情况下,如果当前系统中已有最新版本的 V2Ray,go.sh 会在检测之后就退出。如果需要强制重装一遍,则需要指定该参数。
  • --version: 指定需要安装的版本,比如 "v1.13"。默认值为最新版本。
  • --local: 使用一个本地文件进行安装。如果你已经下载了某个版本的 V2Ray,则可通过这个参数指定一个文件路径来进行安装。

用例

  • 使用地址为 127.0.0.1:1080 的 SOCKS 代理下载并安装最新版本:./go.sh -p socks5://127.0.0.1:1080
  • 安装本地的 v1.13 版本:./go.sh --version v1.13 --local /path/to/v2ray.zip

Docker

V2Ray 提供了两个预编译的 Docker image:

  • v2ray/official : 包含最新发布的版本,每周跟随新版本更新;
  • v2ray/dev : 包含由最新的代码编译而成的程序文件,随代码库更新;

两个 image 的文件结构相同:

  • /etc/v2ray/config.json: 配置文件
  • /usr/bin/v2ray/v2ray: V2Ray 主程序
发表在 日常 | 留下评论

Linux TCP加速工具 —— LotServer(锐速母公司) 一键安装脚本

安装LotServer

wget --no-check-certificate -qO /tmp/appex.sh "https://raw.githubusercontent.com/xctcc/serverSpeeder_Install/master/appex.sh" && bash /tmp/appex.sh 'install'

安装一开始的时候,会提示:

  1. Press Enter to Continue
  2. # 这个是提示你按回车键继续

如果安装过程中没问题的话,最后会提示:

  1. Accelerate VPN (PPTP,L2TP,etc.)? [n]:
  2. # 是否加速VPN
  3.  
  4. Auto load ServerSpeeder on linux start--up? [y]:
  5. # 是否开机启动
  6.  
  7. Run ServerSpeeder now? [y]:
  8. # 是否现在启动锐速
  9.  
  10. # 全部默认回车即可。

最后出现这样的提示就说明安装并启动成功:

  1. [Running Status]
  2. ServerSpeeder is running!
  3. version 3.11.20.4
  4.  
  5. [License Information]
  6. License 6001ADDF578B6C0E (valid on current device)
  7. MaxSession unlimited
  8. MaxTcpAccSession unlimited
  9. MaxBandwidth(kbps) 1024000
  10. ExpireDate 2035--12--31
  11. ….
  12. # 以下省略….

卸载LotServer

  1. wget --no--check--certificate --qO /tmp/appex.sh “https://raw.githubusercontent.com/0oVicero0/serverSpeeder_Install/master/appex.sh” && bash /tmp/appex.sh ‘uninstall’

使用说明

  1. /appex/bin/serverSpeeder.sh start
  2. # 启动 LotServer
  3.  
  4. /appex/bin/serverSpeeder.sh stop
  5. # 停止 LotServer
  6.  
  7. /appex/bin/serverSpeeder.sh restart
  8. # 重启 LotServer
  9.  
  10. /appex/bin/serverSpeeder.sh status
  11. # 状态查询
  12.  
  13. /appex/bin/serverSpeeder.sh renewLic
  14. # 更新许可
发表在 日常 | 留下评论

长期保存google voice号码

https://www.google.com/googlevoice/program-policies.html
如果你有 Google 语音号码但在 9 个月内未使用其接打电话或收发短信,那么 Google 可能会收回相应号码。Google 不会收回已移入 Google 语音服务中或申请了永久使用权的号码

官方有号码回收政策,如果长期不登录使用号码会被回收 。
https://support.Google.com/voice/answer/2404002?hl=zh-Hans 【官网解释链接】
You’ll get a warning that your Google Voice number will be removed from your account.
You’ll also see the “reclaim date,” which is the date that the number will be removed.The
number was reclaimed because you haven’t used your Google Voice number for a long time.
如果您不想丢失号码,请在收回日期之前执行以下操作之一:
使用您的Google语音号码拨打或拨打电话
使用您的Google语音号码发送或获取短信
在Android或iPhone上打开Google语音应用

所以我们可以采用发短信接收某些网站的广告方式来长期保存GV

8.19.2017 更新:国人力量真猛。。现在staples换了方式了。

555444 先发 SIGNUP 然后要回复Y 6条

或者你用下面这个办法

 

发送任意美国邮编到888777,你就可以接收到当地实时的警报信息,同样免费
1
2
3

另外一个办法就是 TEXT CODE或者SAVE TO 25666

https://www.bloomingdales.com/shop/popup?perfectProxy=true&popupID=546251

一样的套路,有兴趣的可以弄个双保险

发表在 日常 | 留下评论

Chrome浏览器关闭 QUIC,避免部分地区运营商UDP QOS对速度的影响

如何关闭QUIC?

首先打开你基于Chromium内核的浏览器,地址栏输入:chrome://flags/#enable-quic

然后就会看到如下图(分别是英文和中文两种语言),在下拉框中可以选择 默认/已启用/已禁用 (Default/Enabled/Disabled) 三个选项,我们只需要把选项改为 已禁用(Disabled) 即可。

修改后,需要重启浏览器生效。

发表在 日常 | 留下评论

Go语言轻量化 HTTP Tunnel 代理工具 —— GoFlyway 一键安装管理脚本

goflyway_linux_amd64.tar

安装步骤

执行下面的代码下载并运行脚本。

  1. wget --N --no--check--certificate https://softs.fun/Bash/goflyway.sh && chmod +x goflyway.sh && bash goflyway.sh
  2.  
  3. # 如果上面这个脚本无法下载,尝试使用备用下载:
  4. wget --N --no--check--certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/goflyway.sh && chmod +x goflyway.sh && bash goflyway.sh

运行脚本后会出现脚本操作菜单,选择并输入 1 就会开始安装。

screen -dmS “gof_screen” /root/gof/goflyway -k=”123″ -up=”192.210.171.24:11115″ -l=”:31115″

其他操作

启动:service goflyway start

停止:service goflyway stop

重启:service goflyway restart

查看状态:service goflyway status

安装目录:/usr/local/goflyway

配置文件:/usr/local/goflyway/goflyway.conf

日志文件:/usr/local/goflyway/goflyway.log

发表在 日常 | 留下评论

一个优秀的跨平台 Socks5代理软件 —— Brook 一键安装管理脚本

文件下载 brook

安装步骤

执行下面的代码下载并运行脚本。

  1. wget --N --no--check--certificate https://softs.fun/Bash/brook.sh && chmod +x brook.sh && bash brook.sh
  2.  
  3. # 如果上面这个脚本无法下载,尝试使用备用下载:
  4. wget --N --no--check--certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/brook.sh && chmod +x brook.sh && bash brook.sh

运行脚本后会出现脚本操作菜单,选择并输入 1 就会开始安装。

使用说明

进入下载脚本的目录并运行脚本:

  1. ./brook.sh

然后选择你要执行的选项即可。

  1.  Brook 一键管理脚本 [vx.x.x]
  2. --- Toyo | doub.io/brook--jc3 ---
  3.  
  4. 0. 升级脚本
  5. ————————————
  6. 1. 安装 Brook
  7. 2. 升级 Brook
  8. 3. 卸载 Brook
  9. ————————————
  10. 4. 启动 Brook
  11. 5. 停止 Brook
  12. 6. 重启 Brook
  13. ————————————
  14. 7. 设置 Brook 账号
  15. 8. 查看 Brook 账号
  16. 9. 查看 Brook 日志
  17. ————————————
  18.  
  19. 当前状态: 已安装 已启动
  20.  
  21. 请输入数字 [0--9]:

其他操作

启动:service brook start

停止:service brook stop

重启:service brook restart

查看状态:service brook status

安装目录:/usr/local/brook

配置文件:/usr/local/brook/brook.conf

日志文件:/usr/local/brook/brook.log(注意正常情况下,日志是不会记录使用信息的,只会记录报错)

 

发表在 日常 | 留下评论