分类归档:服务器相关

利用宝塔搭建一个反代telegraph的图床

1.下载 pic

2.解压部署到你的网站

3.修改API.php

#17行替换pic.coolaj.cn为你的网址
#30行替换pic.coolaj.cn为你的网址

4.添加nginx反向代理

    location /upload {
                add_header Access-Control-Allow-Origin *;
                add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
                add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
                if ($request_method = 'OPTIONS') {
                	return 204;}
                proxy_pass https://telegra.ph/upload;
    }
    location /file {
                proxy_pass https://telegra.ph/file;
    }
    client_max_body_size 5m;

 

5.Enjoy it!

Oracle甲骨文重装系统出现Error, Not found interfaces config.解决办法

#先切换到root权限
sudo -i
运行:
#Debian/Ubuntu:
apt-get update
#RedHat/CentOS:
yum update
#确保安装了所需软件:
#Debian/Ubuntu:
apt-get install -y xz-utils openssl gawk file
#RedHat/CentOS:
yum install -y xz openssl gawk file

DD发现错误,出现 Error, Not found interfaces config

#ssh运行下面 两个命令就可以dd了
#命令1
mkdir /etc/network/interfaces.d
#命令2
echo "# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens3
iface ens3 inet dhcp

" > /etc/network/interfaces

 

附DD脚本:

# DD Windows7 sp1 64位 企业精简版 [账户Administrator密码nat.ee]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Oracle_Win7_sp1_64_Administrator_nat.ee.gz'

# DD Windows8.1 64位 企业精简版 [账户Administrator密码nat.ee]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Oracle_Win8.1_64_Administrator_nat.ee.gz'

# DD Windows10 2016LTSB 64位 企业深度精简版 [账户Administrator密码nat.ee]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Oracle_Win10_2016LTSB_64_Administrator_nat.ee.gz'

# DD Windows Server 2008 R2 64位 精简版 [账户Administrator密码nat.ee]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Oracle_Win_Server2008R2_sp1_64_Administrator_nat.ee.gz'

# DD Windows Server 2012 R2 64位 精简版 [账户Administrator密码nat.ee]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Oracle_Win_Server2012R2_64_Administrator_nat.ee.gz'

 

Debian10给VPS添加IPV6访问可解锁Netflix以及解除google验证码(内核级)

——————————— debian初始化——————————— 

wget http://coolaj.cn/tools/Debian10.list

sudo mv Debian10.list /etc/apt/sources.list

sudo apt update && sudo apt upgrade -y

apt install libgd3 libgd-dev -y

apt install gcc automake autoconf libtool make -y

 

——————————— WGCF安装——————————— 

#弄个文件夹方便管理相关文件

mkdir wgcf

cd wgcf

#下载对应程序

wget -O wgcf https://github.com/ViRb3/wgcf/releases/download/v2.1.4/wgcf_2.1.4_linux_amd64

#添加执行权限

chmod +x wgcf

#注册WARP账户

./wgcf register

#生成WireGuard配置文件

./wgcf generate

sed -i "s/AllowedIPs = 0.0.0.0\/0//" wgcf-profile.conf

———————————  WGCF加载———————————

apt-get install sudo net-tools openresolv -y
#Debian添加unstable源
echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable
#debian更新源并安装
apt-get update
apt-get install wireguard-dkms wireguard-tools
#加载内核模块
modprobe wireguard
#检查WG模块加载是否正常
lsmod | grep wireguard
cat wgcf-profile.conf >/etc/wireguard/wgcf.conf
#开启隧道
sudo wg-quick up wgcf
#关闭隧道
sudo wg-quick down wgcf
#查看是否显示V6IP
ifconfig

V2配置参考下方文章的六

CentOS7给VPS添加IPV6访问可解锁Netflix以及解除google验证码

CentOS7给VPS添加IPV6访问可解锁Netflix以及解除google验证码

一、安装wireguard-go

Github地址:https://github.com/WireGuard/wireguard-go

编译安装

一些需要的软件yum install -y wget git make

如果是debian/ubuntu:apt install -y wget git make

1.安装golang1.16

wget https://golang.org/dl/go1.16.1.linux-amd64.tar.gz

tar xvf go1.16.1.linux-amd64.tar.gz -C /usr/local

cat <<EOF >> /etc/profile

#golang env config

export GO111MODULE=on

export GOROOT=/usr/local/go 

export GOPATH=~/gopath

export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

EOF

source /etc/profile

 

2.拉取代码并编译

git clone https://git.zx2c4.com/wireguard-go.git

git checkout 0.0.20201118

cd wireguard-go

make

mv wireguard-go /usr/local/sbin

#下载编译好的二进制文件安装

#一些需要的软件yum install -y wget

#如果是debian/ubuntu:apt install -y wget

wget https://github.com/peng4740/wireguard-go-builder/releases/download/0.0.20201118/wireguard-go-linux-amd64.tar.gz

tar zxf wireguard-go-linux-amd64.tar.gz

mv wireguard-go /usr/local/sbin

rm -f wireguard-go-linux-amd64.tar.gz

 

二、安装wgcf

这个是用来生成warp配置的

Github地址:https://github.com/ViRb3/wgcf

安装

wget https://github.com/ViRb3/wgcf/releases/download/v2.2.2/wgcf_2.2.2_linux_amd64 -O /usr/local/sbin/wgcf

chmod +x /usr/local/sbin/wgcf

 

三、用wgcf生成配置

echo|wgcf register

wgcf generate

sed -i '/0\.0\.0\.0\/0/d' wgcf-profile.conf

#sed -i '/\:\:\/0/d' wgcf-profile.conf # 如果是IPV6VPS要添加IPV4则改用这个,上一条不要执行

mkdir -p /etc/wireguard

cp -f wgcf-profile.conf /etc/wireguard/wgcf.conf

 

安装wireguard-tools

CentOS7:yum install -y wireguard-tools

如果提示找不到包安装失败了可能是没有epel源,先安装yum install epel-release -y

其他系统其实也是差不多的

Debian、Ubuntu:apt install wireguard

没说到系统可参考官网教程:https://www.wireguard.com/install/

四、运行测试

1.启动

wg-quick up wgcf

#如果运行完就失联了(VPS的SSH终端没反应了)。先重启VPS,检查一下配置有没有问题。

#提示没有权限解决方案

vi /etc/sysctl.conf 

#修改disable_ipv6的所有变成0

#然后

/sbin/sysctl -p

 

当然,也不用太担心,如果你没漏掉什么步骤,一般是不会有事的。

2.测试

curl ipv6.ip.sb

 

如果能正常显示ip就正常

五、配置开机自启(务必要运行测试过后再配置)

systemctl enable wg-quick@wgcf

六、配置V2,增加ipv6的解析

1. "outbounds": 
2.         [
3.                 {"protocol": "freedom","tag": "direct","settings": {}},
4.                 {"protocol": "freedom","tag": "directv6","settings": {"domainStrategy": "UseIPv6"}},
5.                 {"protocol": "blackhole","tag": "blocked","settings": {}},
6.                 {"protocol": "freedom","tag": "twotag","streamSettings": {"network": "domainsocket","dsSettings": {"path": "/usr/local/etc/xray/ss","abstract": true}}}
7.         ],
8. 
9.         "routing": 
10.         {
11.                 "rules": 
12.                 [
13.                         {"type": "field","outboundTag": "directv6","domain": ["geosite:netflix","geosite:google"]},
14.                         {"type": "field","inboundTag": ["onetag"],"outboundTag": "twotag"},
15.                         {"type": "field","outboundTag": "blocked","ip": ["geoip:private"]},
16.                         {"type": "field","outboundTag": "blocked","domain": ["geosite:private","geosite:category-ads-all"]}
17.                 ]
18.         }

 

Centos服务器部署stairspeedtest

wget https://github.com/tindy2013/stairspeedtest-reborn/releases/download/v0.6.1-beta/stairspeedtest_reborn_linux64.tar.gz && tar -xzvf stairspeedtest_reborn_linux64.tar.gz -C speedtest/
cd speedtest
./webgui.sh
安装screen
yum -y install screen
screen -S speedtest

部署完毕后,使用服务器ip:65430即可访问

Linux CentOS 6.8 安装 Docker

一、移除Docker

yum remove docker

二、移除 Docker-selinux

yum remove docker-selinux

三、修改Docker镜像配置文件

rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm


四、安装Docker

yum update -y
yum -y install docker-io

五、启动Docker

service docker start
chkconfig docker on

分享10个可免费使用的网站CDN加速服务

CDN也称内容分发网络,其原理大概是将服务内容分发至全网加速节点,让用户从就近的服务器节点上获取内容,从而提高网站的访问速度。大部分服务商(如阿里云,网易蜂巢,京东云等)的CDN服务是按使用量收费的,也有一些服务商提供免费的CDN服务,本文简单的总结一下目前可免费使用的CDN,对个人网站来说,免费的已经够用了。

腾讯云CDN 官网:https://cloud.tencent.com/product/cdn
(评分 9.0)腾讯云可以免费申请SSL证书,腾讯云CDN也能很好的支持SSL证书,从而实现https访问,腾讯云的CDN不是完全免费的,但新注册的用户目前可有免费的流量包赠送,而且腾讯云每月都会赠送10G免费的加速流量,对个人网站来说相当的实用。

360网站卫士 官网:http://wangzhan.360.com/
(评分 8.5)360提供的免费CDN服务,不限流量,CDN加速功能和基本的安全防御功能比较稳定,其提供的免费域名解析服务也很稳定。360网站卫士支持上传SSL证书,还提供免费网站备案服务。请注意360网站卫士与360云加速(cdn.cloud.360.cn)是两个不同的产品,后者主要提供付费的CDN服务。

百度云加速 官网:https://su.baidu.com/
(评分 8.0)云加速分为免费版和付费版,免费版不支持SSL证书,海外网站也支持加速。百度云加速声称可以加速百度收录,但效果不是很明显,云加速还提供免费的域名解析服务。请注意,百度云加速与百度云(cloud.baidu.com)以及百度云盘(yun.baidu.com)分别是不同的产品,不要被这混乱的名称绕晕了。

又拍云CDN 官网:https://www.upyun.com/products/cdn
(评分 7.5)新注册的又拍云用户可以免费获得代金券,成为又拍云联盟的用户,一年内每月可免费使用10GB存储空间及15GB流量,又拍云也可以免费申请SSL证书实现https访问。

魔门云 官网:https://www.cachemoment.com/
(评分 7.0)免费支持SSL,免费版每月10GB的免费流量,每月免费10万次的https请求数,加入魔门云联盟,可享受每月50GB的免费流量和每月50万次免费HTTPS请求数,魔门云还支持海外网站的加速。

七牛云CDN 官网:https://www.qiniu.com/products/fusion
(评分 7.0)每个月可使用10G的免费存储量和10G的CDN流量与100万次的Get请求数,七牛云在海外也有众多加速节点,七牛云TCP压缩优化使网页中大图和样式等实现秒加载。使用七牛CDN,须保证账户中有最低金额10元。

性能魔方CDN 官网:http://www.mmtrix.com/ispeed
(评分 7.5)性能魔方云加速提供国内外30个IDC和300+CDN节点网络加速,免费版前3个月免费使用百余个CDN节点和每月1000GB流量,之后每月可获得200GB的免费流量,此网站还免费提供网站云监测和WEB检测服务,值得体验。

VeryCloud云分发 官网:https://www.verycloud.cn/cloud/cdninfo
(评分 7.0)云端网络将用户的加速内容分发至部署在全球的近500个服务节点,每月免费赠送50G的CDN加速流量,稳定支撑大量图片、音频、视频等文件的访问。

云盾CDN 官网:https://www.yundun.com/
(评分 7.5)免费版的云盾不支持SSL,云盾的缓存功能很强大,它拥有遍布全球的加速节点和精细的性能优化能力,开启缓存后网站速度会有明显的提升,它拦截CC攻击的效果也很不错。

Cloudflare 官网:https://www.cloudflare.com/
(评分 7.5)Cloudflare的免费版功能很强大,它最大亮点是提供完全免费的SSL证书一键实现https访问,如果不想使用国内的CDN服务,Cloudflare是最好的选择。但是由于它的域名解析服务器在国外,速度方面可能比国内差一些。

使用免费CDN的时候,偶尔会出现网站打不开的现象,出现的情况极少,但这也是难免的,免费的东西或多或少都会有一些不稳定的情况。针对网站的静态资源,目前有些网站提供了免费的CDN公共库,这样站长可以直接通过公共库引入所需的资源,也能加速网站的访问,常用的公共库如下:

百度静态资源公共库:http://cdn.code.baidu.com/

BootCDN开源项目加速服务:http://www.bootcdn.cn/

七牛云免费开放公共库:https://www.staticfile.org/

又拍云免费JS库:http://jscdn.upai.com/

解决Mac下brew安装软件缓慢

把源改为清华的镜像

# HOMEBREW_BOTTLE_DOMAIN就是目标源 修改这个路径就可以里

echo ‘export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles’>>   ~/.bash_profile   

source ~/.bash_profile   #执行.bash_profile脚本让配置即时生效

修复阿里云远程桌面链接错误

依次执行以下操作

win+R

gpedit.msc

计算机配置

管理模板

windows组件

远程桌面服务

远程桌面会话主机

安全

远程(RDP)链接要求使用制定的安全层已启用安全层选择RDP