Skip to content

Commit

Permalink
add and update post, drop comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aieu committed Jan 21, 2017
1 parent fc6c05e commit 8ff2d97
Show file tree
Hide file tree
Showing 17 changed files with 235 additions and 26 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ sudo: false

rvm:
- 2.3.0
- 2.0.0

branches:
only:
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ collections:
# comment
comments:
duoshuo:
name: havanna
name:
rcomments:
num: 10
avatar: 0
Expand Down
4 changes: 2 additions & 2 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{% if site.webmaster.google.verify %}<meta name="google-site-verification" content="{{ site.webmaster.google.verify }}" />{% endif %}
{% if site.webmaster.bing.verify %}<meta name="msvalidate.01" content="{{ site.webmaster.bing.verify }}" />{% endif %}

<script>
<!--<script>
var domain = "havee.me";
var targetProtocol = "https:"
var current = ["www.havee.me", "hae.coding.me"];
Expand All @@ -36,5 +36,5 @@
document.location.href = "\/\/" + domain + this.location.pathname;
}
}
</script>
</script>-->
</head>
2 changes: 0 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ <h3 class="title"> {{ page.title }} <time class="small">{{ page.date | date: "%Y
{% endif %}
</ul>

{% include comments.html %}

3 changes: 2 additions & 1 deletion _posts/2009-09-29-gentoo-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ tags: [Gentoo, CLI, Lerning]
挂载/proc和/dev文件系统

# mount -t proc none /mnt/gentoo/proc
# mount -o bind /dev /mnt/gentoo/dev
# mount --rbind /sys /mnt/gentoo/sys
# mount --rbind /dev /mnt/gentoo/dev

chroot到新环境里

Expand Down
16 changes: 11 additions & 5 deletions _posts/2011-12-14-cranky.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ category: Other
tags: [Essay]
---

本文在10年首发于某PT站原创文学区,后转到wordpress,现转回自己博客

如果说人生是瓶美酒,那么我就是个抵抗不住这美味缺又怕极了酒精的人士,酒精的蒸腾如同烈日下被剥光衣服后旋即又被推入烤炉般的让人难受,无法欣赏赤裸的原始美色,是因为难以忍受这赤裸裸的身体被世间灼热的目光所凝视。

<!-- more -->

儿时纯真年代,总想改变这污秽杂乱的世界,师长们总用着这看穿人士百态的口吻教训着,石头是属于土地的,干嘛突兀而出,骄傲的小东西;长大知道伪装后,总想改变自己,面具背后的我们总以为这是所谓的成熟,曾惨烈而骄傲的向世人宣告,成熟是需要代价的,这就是代价;成年后,什么都不想改变,安乐知天命,我们都被生活磨平了棱角,上帝此时终于传来了随和的一声叹息,圆润光滑的背后,是一个个死气沉沉的灵魂。
儿时纯真年代,总想改变这污秽杂乱的世界,师长们总用着这看穿人士百态的口吻教训着,石头是属于土地的,干嘛突兀而出,骄傲的小东西;

长大了知道伪装后,总想改变自己,面具背后的我们总以为这是所谓的成熟,曾惨烈而骄傲的向世人宣告,成熟是需要代价的,这就是代价;

成年后,什么都不想改变,安乐知天命,我们都被生活磨平了棱角,上帝此时终于传来了随和的一声叹息,圆润光滑的背后,是一个个死气沉沉的灵魂。

窗外的阵阵喧嚣,宣告着这座城市浮华的存在。

在这城市的五年间,天天如此,大家都按部就班的沉沦在三点一线的忙碌生活中,奢望着窗外风景的靓丽。曾经的恋人如同路人般,来去匆匆,没有丝毫眷恋。早已摆脱生计的人们,却也始终勘不破这除了生计外的花花绿绿。

窗外时而传来广播声,宣告着这城市浮华的存在。在这城市的5年间,天天如此,大家都按部就班的沉沦在三点一线的凡人生活中,没有一点靓丽。曾经的恋人也如同路人般,来去匆匆,没有丝毫留恋。早已摆脱生计的人们,始终勘不破这除了生计外的花花绿绿
烟头烫手,始知燃尽,云雾缭绕,终知一切均过眼云烟,然肚子的饥饿感,让我知道回归现实是多么的重要,灵魂的撞击处,虽然瞬间美丽,却也无法长久,这一切均敌不过生活的油盐酱醋

烟头烫手,始知燃尽,云雾缭绕,终知一切均过眼云烟,然肚子的饥饿感,让我知道回归现实是多么的重要,灵魂的撞击处,虽然瞬间美丽,却也无法长久,这一切均敌不过生活的油盐酱醋。对着黑色的显示屏,看着这被岁月雕琢的逐渐苍老的幽暗脸颊,解嘲似的笑了笑,知道胡思乱想该结束了,于是起身吃饭。
对着黑色的显示屏,看着这被岁月雕琢的逐渐苍老的幽暗脸颊,解嘲似的笑了笑,知道胡思乱想该结束了,于是起身吃饭。
2 changes: 1 addition & 1 deletion _posts/2013-07-16-gossip.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tags: [Essay]

#### profile-sync-daemon

关注了 SSD 硬盘后,才发现,gentoo & arch 用户可以直接通过源安装该脚本包。用途是将一些软件包的 profiles 移动到 `/tmp` | `/dev/shm`,很好的一脚本。
关注了 SSD 硬盘后,才发现,gentoo & arch 用户可以直接通过源安装该脚本包。用途是将一些软件包的 profiles 移动到 `/tmp` `/dev/shm`,很好的一脚本。

同时老家的本子速度太慢,Emachines D725,09年购置的,因为慢,所以扔老家。

Expand Down
2 changes: 1 addition & 1 deletion _posts/2014-12-31-centos-7-records.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ tags: [Nginx, PHP, PHP-FPM, SQL, Tips, CentOS]

确认下 sshd 服务

# ss -tnlp | grep sshd
# ss -alnptu | grep sshd

#### Nginx

Expand Down
34 changes: 34 additions & 0 deletions _posts/2015-01-02-using-firewalls-on-centos-7.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,40 @@ eth0 存在与 public zone,将该网卡添加至 work zone,并将之从 publ

# firewall-cmd --permanent --add-rich-rule="rule family='ipv4' source address='222.222.222.222' reject"

当然,我们仍然可以通过 ipset 来封禁 ip

封禁 ip

# firewall-cmd --permanent --zone=public --new-ipset=blacklist --type=hash:ip
# firewall-cmd --permanent --zone=public --ipset=blacklist --add-entry=222.222.222.222

封禁网段

# firewall-cmd --permanent --zone=public --new-ipset=blacklist --type=hash:net
# firewall-cmd --permanent --zone=public --ipset=blacklist --add-entry=222.222.222.0/24

导入 ipset 的 blacklist 规则

# firewall-cmd --permanent --zone=public --new-ipset-from-file=/path/blacklist.xml

如果已经存 blacklist,则需要先删除

# firewall-cmd --get-ipsets
blacklist
# firewall-cmd --permanent --zone=public --delete-ipset=blacklist

然后封禁 blacklist

# firewall-cmd --permanent --zone=public --add-rich-rule='rule source ipset=blacklist drop'

重新载入以生效

# firewall-cmd --reload

查看 blacklist

# firewall-cmd --ipset=blacklist --get-entries

以上都是一些常用方法,更多高级方法,请参考:

- <https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Using_Firewalls.html>
Expand Down
20 changes: 18 additions & 2 deletions _posts/2017-01-04-upgrade-kernel-4-9-for-centos.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,25 @@ Linux Tovalds 于 2016 年 12 月 11 日发布了 Kernel 4.9 正式版本,带

yum --enablerepo=elrepo-kernel install kernel-ml

当然,将 kernel-ml 选为第一启动
当然,将 kernel-ml 选为第一启动,首先查看系统的内核以及顺序

grub2-set-default 0
awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg

看下你当前默认启动项

grub2-editenv list

将 kernel-ml 版本的内核设置为默认启动内核

grub2-set-default N

以后升级内核默认启用 kernel-ml,编辑文件 `/etc/sysconfig/kernel`

DEFAULTKERNEL=kernel-ml

同时编辑文件 `/etc/sysconfig/kernel`,在 `[elrepo-kernel]`

enabled=1

重启后,通过 `uname -a` 查看内核是否切换到 4.9,譬如我的

Expand Down
57 changes: 57 additions & 0 deletions _posts/2017-01-21-docker-container-start-problem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
layout: post
title: "Systemd 232 导致 Docker container 启动问题"
category: Linux
tags: [Systemd, Docker]
---

#### 问题

近期又一次在 Gentoo 下做了一个升级维护,期间遇到了一个问题,Docker container 死活启动不起来,有点懵逼。

回想近期做的维护更新,无非 kernel 从 4.4.* LTS 升级到 4.9.* LTS,docker 从 1.11 升级到 1.13,还有一些系统级的维护。发生这个问题,有点让人猝不及防。问题总是要解决的,于是一点点排查起来。

$ docker-compose up -d
Creating redis

ERROR: for redis Cannot start service redis: containerd: container not started
ERROR: Encountered errors while bringing up the project.

查看一下日志 `systemctl status docker`

<!-- more -->

......
Jan 21 13:52:32 iMac dockerd[16269]: time="2017-01-21T13:52:32.431087496+08:00" level=warning msg="failed to retrieve docker-init version: unknown output format: tini version 0.13.2\n"
Jan 21 13:52:32 iMac dockerd[16269]: time="2017-01-21T13:52:32.823126391+08:00" level=error msg="containerd: start container" error="containerd: container not started" id=a863dc7a53c2ad23020187161f8f782072061550a7834b2a542e7d5a05584e47
Jan 21 13:52:32 iMac dockerd[16269]: time="2017-01-21T13:52:32.823493109+08:00" level=error msg="Create container failed with error: containerd: container not started"
Jan 21 13:52:33 iMac dockerd[16269]: time="2017-01-21T13:52:33.150447827+08:00" level=error msg="Handler for POST /v1.21/containers/a863dc7a53c2ad23020187161f8f782072061550a7834b2a542e7d5a05584e47/start returned error: containerd: container not started"
......

看不出错误,只有一个警告。

那么直接 `docker run` 看输出呢:

$ docker run --rm hello-world
container_linux.go:247: starting container process caused "process_linux.go:359: container init caused \"rootfs_linux.go:53: mounting \\\"cgroup\\\" to rootfs \\\"/var/lib/docker/overlay/700b3203dc8c3f997c72ab6fcb10000b5d9a64401c0ec7524cfb1ca4a7b7a876/merged\\\" at \\\"/sys/fs/cgroup\\\" caused \\\"no subsystem for mount\\\"\""
docker: Error response from daemon: containerd: container not started.

OK,找到了,十有八九是 cgroup 问题:

> container init caused "rootfs_linux.go:53: mounting "cgroup" to rootfs "/var/lib/docker/overlay/700b3203dc8c3f997c72ab6fcb10000b5d9a64401c0ec7524cfb1ca4a7b7a876/merged" at /sys/fs/cgroup caused "no subsystem for mount"
以此为关键词,直接去 github issues 搜,终于找到问题根源,果然是最新的 systemd 232 的问题,然后才想到这次维护中有 systemd 的更新,具体来说,就是 systemd v32 以 cgroup v2 结构层次挂载导致 runc 出现错误提示 **“no subsystem for mount”**[systemd/systemd#3965](https://github.com/systemd/systemd/pull/3965)

#### 解决方案

既然根源找到了,那么解决方案也就明确了。共两种解决方案,任选其一:

- 所有 container 启动时添加一个参数 `-v /sys/fs/cgroup:/sys/fs/cgroup:ro`
- 添加 `systemd.legacy_systemd_cgroup_controller=yes` 到你的 grub2、syslinux 等启动器的内核启动参数中

我使用的是第二种方案。

参考:

- <https://github.com/docker/docker/issues/28109>
- <https://github.com/systemd/systemd/pull/3965>
104 changes: 104 additions & 0 deletions _posts/2017-01-24-macos-installation-guide-for-thinkpad-x230.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
layout: post
title: "ThinkPad X230 安装黑苹果"
category: Mac
tags: [ThinkPad]
---

[ThinkPad X220]({% post_url 2015-11-22-os-x-el-capitan-installation-guide-for-thinkpad-x220 %}) 跟人家替换了 ThinkPad X230,也有一段时间了,这不,快年底了,终于闲下来,然而耐不住骚动的心,又开始入了黑苹果的坑。

首先要说明的是,X230 以后,就不存在 BIOS 白名单了,所以,要么上烧录夹硬刷 BIOS 芯片,要么就换个白名单中在黑果上免驱的无线网卡。我采用的是后者,淘宝上淘了块 ar9285 无线网卡。

#### 一. BIOS 设置

首先,直接去官网下载最新版的 BIOS 来升级:[BIOS Update Utility V2.67](http://support.lenovo.com/us/zh/products/Laptops-and-netbooks/ThinkPad-X-Series-laptops/ThinkPad-X230/downloads/DS029187)

然后按照如下 BIOS 设置:

<!-- more -->

```
Config
Network
Wake On Lan: Disabled
USB
USB UEFI BIOS Support: Enabled
Always On USB: Disabled
USB 3.0 Mode: Enabled
Serial ATA (SATA)
Serial SATA Controller Mode Option: AHCI
Power
Intel (R) Rapid Start Technology: Disabled
Security
Fingerprint
Predesktop Authentication: Disabled
Security Chip
Security Chip: Disabled
Memory Protection
Execution Prevention: Enabled
Virtualization
Intel (R) Virtualization Technology: Disabled
Intel (R) VT-d Feature: Disabled
I/O Port Access
Fingerprint Reader: Disabled
Anti-Theft
Current Setting: Disabled
Computrace
Current Setting: Disabled
Secure Boot
Secure Boot: Disabled
Startup
Network Boot: PCI LAN
UEFI/Legacy Boot: UEFI Only
CSM Support: no
Boot Mode: Quick
```

#### 二. CLOVER

同样,usb安装盘的制作以及如何安装就不说了,太多的文章。Clover 相关的配置,可以直接从这里提取:[EFI for macOS Sierra on ThinkPad X230](https://pan.baidu.com/s/1pLLZGRD)(2017-11-10 更新),解压开,将EFI 目录直接拷贝至你的 U 盘安装盘的 EFI 分区,或者拷贝至你系统盘的 EFI 分区。

##### EFI

我的 EFI 目录树,所有驱动都通过 dsdt 与 clover 来解决。

```
EFI
├── BOOT
│   └── BOOTX64.efi
└── CLOVER
├── ACPI
│   ├── WINDOWS
│   ├── origin
│   │   ├── Clean DSDT.dsl
│   │   └── ssdt.dsl
│   └── patched
│   ├── DSDT.aml
│   └── SSDT.aml
├── CLOVERX64.efi
├── config.plist
├── drivers64UEFI
├── kexts
│   └── Other
│   ├── ACPIBatteryManager.kext
│   ├── ACPISensors.kext
│   ├── AppleALC.kext
│   ├── AppleIntelE1000e.kext
│   ├── BrcmFirmwareRepo.kext
│   ├── BrcmPatchRAM2.kext
│   ├── CPUSensors.kext
│   ├── FakeSMC.kext
│   ├── GPUSensors.kext
│   ├── HibernationFixup.kext
│   ├── IntelGraphicsFixup.kext
│   ├── LPCSensors.kext
│   ├── Lilu.kext
│   └── VoodooPS2Controller.kext
├── themes
│   └── embedded
└── tools
```

暂停更新...

参考:<https://github.com/Bizzaro/x230-osx/>
7 changes: 1 addition & 6 deletions about.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: page
title: "About"
title: "关于"
description: "业余爱好的点滴记录,同时作为配置备份的存储地,好记性不如滥笔头。"
---

Expand All @@ -27,8 +27,3 @@ description: "业余爱好的点滴记录,同时作为配置备份的存储地

<span style="color:red;">**注意:**</span>如果你喜欢本站样式,欢迎 clone or fork,同时,由于本博客的样式由 Jekyll 内置 SCSS 预处理器直接生成 css,所以,你可能需要阅读 [《使用 Jekyll 内置的 Sass 预处理器》]({% post_url 2014-09-15-use-built-in-sass-with-jekyll %}) 这篇文章。

{% if site.comments.duoshuo.name %}
<div id="comments">
<div class="ds-thread" data-thread-key="/about.html" data-title="{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }}" data-url="{{ site.url }}{{ page.url }}"></div>
</div>
{% endif %}
2 changes: 1 addition & 1 deletion archive.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Archive
title: "归档"
layout: page
---

Expand Down
2 changes: 1 addition & 1 deletion categories.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Categories
title: "目录"
layout: page
---

Expand Down
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,5 @@ <h3 class="title"><a href="{{ post.url }}">{{ post.title }}</a><time class="smal
<aside class="col-md-3 visible-lg visible-md">
{% include categories.html %}
{% include recently_posts.html %}
{% include recently_comments.html %}
{% include blogroll.html %}
</aside>
2 changes: 1 addition & 1 deletion tags.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Tags
title: "标签"
layout: page
---

Expand Down

0 comments on commit 8ff2d97

Please sign in to comment.