除了创建软连接到 /etc/lxc/auto 目录下,还需要在lxc的配置文件里加一句:
lxc.start.auto = 1
-
lxc auto start
-
一点购物经验
-
冰箱
- 一开始选择了松下的NR-C28WPD1-S(无锡产,松下压缩机,变频风冷),觉得高速运转的时候噪音有点大(另网上有人反馈有高频噪音),矫情病发作,于是就退掉换了西门子的KK22F57TI(恩布拉克压缩机,直冷),用起来之后发现噪音控制还不如松下的(摔!),仔细听了一下,倒也不是压缩机的噪音,估计是设计缺陷,另外西门子的空间也没有松下来的好,大致相当的外形尺寸,松下可以做到278L,西门子只有218L的空间。
- 尽量选择恩布拉克压缩机的冰箱
- 选择风冷,不用费心来除霜
- 西门子的东西Just so so吧
- 国产的品控真心不行,有条件就选择原装的吧,无责任推荐松下NR-F555T
- 有条件还是不要把冰箱放在客厅 -_-!
-
空调
- 直接选择了大金FTXJ335NC-N
- 另外:N多所谓自主品牌的空调压缩机都是用的外国货
-
床垫
- 偏向带乳胶的产品
- 金可儿,五星之选,相对比较厚道的厂商
- 如果有条件的话,可以直接从美帝买Simons过来
- 国产的爱舒,乳胶系的谨慎购买,因为这家乳胶味道比较重,一度想退货
-
家具
- 选择了橡木
- 框架用的橡木,背板用的杉木(松木?)
- 橡木的木纹很好看,但是裸板杉木绝逼味道大(木头的味道,个人闻不惯,但是有人喜欢-_-!),谨慎呐
-
保温壶
- 象印SH-HA15-PF,容量1.5L,保温效果非常好
- 日本国购得,然后是Made In China。。
-
-
apparmor的坑
将mysql的datadir修改了个路径,mysqld死活启动不了,可以dmesg看一下是否是路径被apparmor拦截了:
type=1400 audit(1390890338.307:153): apparmor=”DENIED” operation=”open” parent=4033 profile=”/usr/sbin/mysqld” name=”/srv/app/mysql/ibdata1″ pid=4415 comm=”mysqld” requested_mask=”rw” denied_mask=”rw” fsuid=105 ouid=105
mysql的错误日志会提示无法访问plugin表:
/usr/sbin/mysqld: Can’t find file: ‘./mysql/plugin.frm’
解决方法:
/etc/apparmor.d/usr.sbin.rsyslogd 把新的datadir路径加进去即可。 -
lxc & aufs & docker
将rootfs放置于aufs上可以节省不少空间(template):
create a linux container named “p1” with template “ubuntu” on a 32bit pc
1. mkdir -p /var/lib/lxc/p1/rw /var/lib/lxc/p1/rootfs
2. mount -t aufs -o br=/var/lib/lxc/p1/rw:/var/cache/lxc/saucy/rootfs-i386 none /var/lib/lxc/p1/rootfs
3. lxc-create -t ubuntu -n p1 -
Print Curl Verbose Info on the web browser in php
curl_setopt($hCurl, CURLOPT_STDERR, fopen(‘php://output’, ‘w+’));
curl_setopt($hCurl, CURLOPT_VERBOSE, 1);Ref: http://projectivemotion.com/2012/07/30/print-curl-verbose-info-web-browser-php/
-
Capturing the first frame of an animated GIF with ImageMagick
convert “animation.gif[0]” file.jpg
Ref: http://devblog.bluefuton.com/post/2976224441/capture-first-frame-animated-gif-imagemagick
-
set default grub options
1. open /etc/default/grub
2. then change anything you want -
memcached expire time 0
今天一个同事问道缓存设置0然后判断永不过期的实现机制是怎么样子的,当时猜想可能是设置了一个比较大的值(比如十年),不过对此不确定。
兴起去pull了memcached的源码来看:git pull https://github.com/memcached/memcached.git
memcached.c 文件 3314 行:
/*
If exptime is zero realtime() would return zero too, and
realtime(exptime) – 1 would overflow to the max unsigned
value. So we process exptime == 0 the same way we do when
no delay is given at all.
*/
if (exptime > 0)
settings.oldest_live = realtime(exptime) – 1;
else /* exptime == 0 */
settings.oldest_live = current_time – 1;原来是用了无符号整数的溢出。。。
-
Resque
在厦门PHPer群里看到的。
这个玩意儿比较好的地方就是可以跟操作系统解耦。
其中用到了redis作为队列处理,依赖还是较强,处理量不大的话,用sqlite来替代会不会更好?。里面的几个思路跟我自己在cron脚本的一些处理上蛮像,殊途同归,LOL。
Resque: https://github.com/defunkt/resque
PHP的clone:https://github.com/chrisboulton/php-resqueRef: http://avnpc.com/pages/run-background-task-by-php-resque
-
使用hping来tcp ping
在Windows Azure起了两台测试,奇葩的微软没有开放ICMP。
于是用hping来测试:
hping3 -S -p 80 google.com