军哥lnmp安装DirectoryLister

1. lnmp vhost add 添加新域名
2. 军哥lnmp默认禁用了scandir, 需要启用scandir函数
cp /usr/local/php/etc/php.ini /usr/local/php/etc/php.ini.bak
sed -i 's/,scandir//g' /usr/local/php/etc/php.ini # 取消scandir函数禁用
/etc/init.d/php-fpm restart # 重启 PHP生效

3. 下载DirectoryLister解压,然后变更目录权限
wget https://github.com/DirectoryLister/DirectoryLister/releases/download/3.5.0/DirectoryLister-3.5.0.tar.gz
tar -zxf *.gz -C ./
chmod -R 755 /home/wwwroot/www.yourdomain.com
chown -R www /home/wwwroot/www.yourdomain.com

4. 如果是私人使用,需要block各种搜索引擎的爬虫,上传robots.txt
User-agent: *
Disallow: /

天下武功唯快不破–使用流量中转技术提高网速

最近学会了nat小鸡透过haproxy中转流量,网速提高了不少。这个技术实在是牛逼,这些数据中心的QOS比家宽不知道高到哪里去了,用起来实在是爽,哈哈哈!而且nat小鸡一般卖的很便宜,30块钱一个月也就一杯喜茶的钱。以后搬家买房都不必过多考虑宽带运营商的问题了,中转一下就OK了。前几天还傻傻地办了一条电信的100M,花了1000多,实在是傻。其实年初的时候我已经会通过nginx中转流量了,但是当时用的是阿里云。阿里云的流量有点贵。但是nat小鸡实在是便宜。

除了上面提到的haproxy和nginx,还可以用iptables中转流量。

Twenty Twelve主题修改

Twentyten这个主题感觉没有自适应,不如Twenty Twelve,还是换回Twenty Twelve

1. 在footer.php中删除页脚代码
2. 使用WP-PageNavi插件设置分页, 将functions.php中的下列代码

<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>

替换为

<?php wp_pagenavi(); ?>

Twentyten 主题的修改

1. 将页面顶部图像设置为1*1像素的图片,这样就不用改代码隐藏了
2. 在footer.php中删除页脚代码
3. 使用WP-PageNavi插件设置分页
将loop.php中的下列代码

<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>

替换为

<?php wp_pagenavi(); ?>

vultr 挂载 block storage

今天登录一个VPS发现存储的数据都消失了,想起来前几天无意重启了该VPS,猜测block storage重启后需要重新挂载,挂载命令如下:
mount /dev/vdb1 /home/

也可以设置开机自动挂载:
vim /etc/fstab
/dev/vdb1 /home ext4 defaults 0 0

phoenixnap開戶經歷

第一次在phoenixnap開戶是幾個月以前,當時拒絕了我的開戶申請,讓我發ID,發了護照以後又拒絕了,我當時很生氣。現在回顧一下,當時注冊的方法的確很有問題,當時用的是代理ip和假地址,這樣在phoenixnap的系統後臺很可能被判定為fraud order。

第二次用的是真實地址了,第二天sale給我打電話錯過了,就又失敗了。

第三次是上周,用真實地址和真實ip,先在webpage上和Sale聊了一下,基本上就是説下服務器用途,本來覺得又會失敗,然後Sale打電話過來了,尬聊了4分鐘,我的口語實在是差,爲難老外了,然後sale批准了賬戶,用paypal付款就搞定了。

簡單來説就是要先在web上在綫聊下,説下開戶理由,然後注冊的ip和地址資料什麽的要匹配,不能用代理ip,注冊完后要和sale通個電話,完全不會英語肯定是不行的,然後就是paypal付款了,paypal賬戶和注冊phoenixnap的賬戶郵箱要一直,避免被人家的系統風控。最後感覺phoenixnap的生意可能也一般般,所以現在比較容易開戶吧。

phoenixnap dedicated server benchmark

这是一款 E-2276G (010120)套餐的dedicated server, 月费105USD, 主板品牌是supermicro,型号是SYS-5039MC-H12TRF, 机房是Phoenix Node 1

[root@E3-2276 ]#  (curl -s wget.racing/nench.sh | bash; curl -s wget.racing/nench.sh | bash) 2&gt;&amp;1 | tee nench.log
-------------------------------------------------
nench.sh v2019.07.20 -- https://git.io/nench.sh
benchmark timestamp:    2020-08-04 10:07:22 UTC
-------------------------------------------------

Processor: Intel(R) Xeon(R) E-2276G CPU @ 3.80GHz
CPU cores: 12
Frequency: 861.169 MHz
RAM: 62G
Swap: 31G
Kernel: Linux 3.10.0-1062.el7.x86_64 x86_64

Disks:
nvme0n1 931.5G SSD

CPU: SHA256-hashing 500 MB
0.887 seconds
CPU: bzip2-compressing 500 MB
CPU: AES-encrypting 500 MB
0.548 seconds

ioping: seek rate
min/avg/max/mdev = 22.1 us / 140.5 us / 2.97 ms / 65.5 us
ioping: sequential read speed
generated 14.7 k requests in 5.00 s, 3.58 GiB, 2.93 k iops, 733.2 MiB/s

dd: sequential write speed
1st run: 777.24 MiB/s
2nd run: 740.05 MiB/s
3rd run: 773.43 MiB/s
average: 763.58 MiB/s

IPv4 speedtests
your IPv4: 184.95.39.xxxx

Cachefly CDN: 15.87 MiB/s
Leaseweb (NL): 9.01 MiB/s
Softlayer DAL (US): 30.79 MiB/s
Online.net (FR): 15.18 MiB/s
OVH BHS (CA): 29.77 MiB/s

No IPv6 connectivity detected
-------------------------------------------------

-------------------------------------------------
nench.sh v2019.07.20 -- https://git.io/nench.sh
benchmark timestamp: 2020-08-04 10:08:09 UTC
-------------------------------------------------

Processor: Intel(R) Xeon(R) E-2276G CPU @ 3.80GHz
CPU cores: 12
Frequency: 888.769 MHz
RAM: 62G
Swap: 31G
Kernel: Linux 3.10.0-1062.el7.x86_64 x86_64

Disks:
nvme0n1 931.5G SSD

CPU: SHA256-hashing 500 MB
0.891 seconds
CPU: bzip2-compressing 500 MB
CPU: AES-encrypting 500 MB
0.547 seconds

ioping: seek rate
min/avg/max/mdev = 21.6 us / 138.6 us / 2.71 ms / 47.3 us
ioping: sequential read speed
generated 14.4 k requests in 5.00 s, 3.51 GiB, 2.88 k iops, 718.9 MiB/s

dd: sequential write speed
1st run: 739.10 MiB/s
2nd run: 755.31 MiB/s
3rd run: 752.45 MiB/s
average: 748.95 MiB/s

IPv4 speedtests
your IPv4: 184.95.39.xxxx

Cachefly CDN: 16.94 MiB/s
Leaseweb (NL): 10.96 MiB/s
Softlayer DAL (US): 28.83 MiB/s
Online.net (FR): 15.80 MiB/s
OVH BHS (CA): 29.55 MiB/s

No IPv6 connectivity detected
-------------------------------------------------

[root@E3-2276 ]#  smartctl --all /dev/nvme0n1p1
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.0-1062.el7.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org</code>

=== START OF INFORMATION SECTION ===
Model Number: INTEL SSDPE2KX010T8
Serial Number: PHLJ006501CB1P0FGN
Firmware Version: VDV10131
PCI Vendor/Subsystem ID: 0x8086
IEEE OUI Identifier: 0x5cd2e4
Total NVM Capacity: 1,000,204,886,016 [1.00 TB]
Unallocated NVM Capacity: 0
Controller ID: 0
Number of Namespaces: 1
Namespace 1 Size/Capacity: 1,000,204,886,016 [1.00 TB]
Namespace 1 Formatted LBA Size: 512
Namespace 1 IEEE EUI-64: 5cd2e4 1f68240100
Local Time is: Tue Aug 4 06:11:00 2020 EDT
Firmware Updates (0x02): 1 Slot
Optional Admin Commands (0x000e): Format Frmw_DL NS_Mngmt
Optional NVM Commands (0x0006): Wr_Unc DS_Mngmt
Maximum Data Transfer Size: 32 Pages
Warning Comp. Temp. Threshold: 70 Celsius
Critical Comp. Temp. Threshold: 80 Celsius

Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 25.00W - - 0 0 0 0 0 0

Supported LBA Sizes (NSID 0x1)
Id Fmt Data Metadt Rel_Perf
0 + 512 0 2
1 - 4096 0 0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning: 0x00
Temperature: 34 Celsius
Available Spare: 100%
Available Spare Threshold: 10%
Percentage Used: 0%
Data Units Read: 16,186 [8.28 GB]
Data Units Written: 37,828 [19.3 GB]
Host Read Commands: 182,341
Host Write Commands: 260,938
Controller Busy Time: 0
Power Cycles: 4
Power On Hours: 179
Unsafe Shutdowns: 2
Media and Data Integrity Errors: 0
Error Information Log Entries: 0
Warning Comp. Temperature Time: 0
Critical Comp. Temperature Time: 0

Error Information (NVMe Log 0x01, max 64 entries)
No Errors Logged

点评: 刚用没有太多感受,phoenixnap家的IPMI不能自己挂载iso,必须要发TK让客服挂载,有点麻烦,不过客服的响应速度还是可以的。系统感觉没有WEBNX家的好用。但是还是很便宜的,内存给的多,additional ip也不贵。SSD感觉比WEBNX的那个1.2T的NVME SSD差点。

使用mega.nz同步数据

白嫖的dropbox快满了,dropbox的付费plan的确是有点坑。一直以来使用google driver作为补充,但是google driver的backup and sync from google 客户端对于CN地区的用户体验的确是太差了,因为不能在后台设置Socks5代理。今天切换到Mega.nz了,mega.nz客户端用起来很不错,可以设置socks5代理,免费的70G空间也够用了,流量也够用,付费的Plan我看了一下,5美元就够我用了,日后升级也没啥压力,还是很不错的。