【流氓方案】 FreeBSD 系统的强行跨版本更新

下载需要的镜像

准备工作,下载你希望升级到 FreeBSD 版本,如 10.2,它在官方FTP的存储的目录为:
http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/10.2-RELEASE/
你需要将 FreeBSD 基本系统跟内核包下载下来备用 (base.txz,kernel.txz)

1
2
fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/10.2-RELEASE/base.txz
fetch http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/10.2-RELEASE/kernel.txz

备份旧系统

切换到 / ,将静态编译的工具包 rescue 改名为 r
创建存放旧系统的 old 目录,并把所有跟新系统冲突的文件移动到 old 目录

1
2
3
4
5
6
cd /
mv rescue r
mkdir old
/r/mv .profile .rnd .cshrc COPYRIGHT entropy \
bin etc media root usr boot home mnt \
sbin var lib sys libexec tmp old

执行完毕后可以使用 /r/ls 查看目录下文件是否已全部正常的转移了

阅读全文 »

更新我的 NGINX 配置文件

最新版配置文件:My-NGINX-Config

不需要多创建两个虚拟机了。。。简洁多了,哈哈哈

2015,11,01,懒得管配置文件了。。。直接去我的

—>>> NGINX 配置文件仓库

sites/gehaowu.com.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
server {
server_name gehaowu.com www.gehaowu.com;
include includes/listen_full.template;
include includes/header_add.template;
include includes/headers_set_more.template;
include sites/rewrite.gehaowu.com.template;
ssl_certificate keys/www.gehaowu.com.crt;
ssl_certificate_key keys/www.gehaowu.com.key;
ssl_trusted_certificate keys/startcom_ssl_trusted_certificate.crt;
ssl_dhparam keys/dhparam.pem;
ssl_ecdh_curve secp384r1;
include includes/ssl.template;
include includes/ssl_stapling.template;
set $rewriterule https;
if ($scheme = https) {
set $rewriterule "${rewriterule}1";
}
if ($host ~* ^www.) {
set $rewriterule "${rewriterule}2";
}
if ($rewriterule != "https12") {
return 301 https://www.gehaowu.com$request_uri;
}
include includes/block_files.template;
include includes/expires.template;
index index.html index.htm;
root /usr/home/wwwroot/www.gehaowu.com;
error_page 404 /404.html;
error_page 403 /403.html;
error_page 500 502 503 504 /50x.html;
access_log /usr/home/wwwroot/logs/gehaowu.com.access.log;
error_log /usr/home/wwwroot/logs/gehaowu.com.error.log;
}

强制拉取 Github 仓库内容

让 anonymouscoward 君给帮忙写了个 github 同步脚本。。哈哈哈

完美解决 github 同步的麻烦问题了

将脚本加入 cron 定时执行就可以了,

———————————————

如果出现代码需要合并啥的不正常 git pull 情况,

则执行脚本会直接删除仓库,然后重新 git clone 仓库回来。。

———————————————

( ̄︶ ̄)↗ 飕装逼了~~~

阅读全文 »

MINGW64环境更新HEXO到Github提示TTY错误

最近碰到好多朋友使用 MINGW64 使用 Github + HEXO 搭建博客的时候提示下列错误,

ERROR INFO

1
2
3
4
5
6
7
8
9
10
#Code Star
The file will have its original line endings in your working directory.
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': Invalid argument
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': Invalid argument
#Code End

目测是 终端 哪个地方出问题,

阅读全文 »