Skip to content

Instantly share code, notes, and snippets.

View archsh's full-sized avatar

Mingcai SHEN archsh

  • Shenzhen, China
View GitHub Profile
@archsh
archsh / lvmcache_on_centos6.md
Last active July 7, 2022 08:33
Using lvmcache on CentOS6

目标

  1. 使用SSD加速系统IO;
  2. 通过LVMCACHE来将SSD作为HDD的CACHE使用;

确认安装版本是否支持lvmcache:

lvm 命令

[root@localhost mnt]# lvm segtypes

(看输出里面有cache,cache-pool即表示支持了)

@archsh
archsh / TurboMail_on_TG2
Created June 21, 2014 01:28
Hints forTurboGears
在TurboGears2中使用TurboMail发送邮件
1、安装TurboMail:
pip install turbomail
或者在项目的setup.py中添加依赖,然后运行setup.py develop
2、在项目lib中增加一个模块文件: tm_tg2.py:
@archsh
archsh / howto.txt
Created June 21, 2014 01:26
PyQT 之 QWizardPage registerField注册自定义属性绑定
PyQT 之 QWizardPage registerField注册自定义属性绑定
在使用QWizard的时候,基本上比较多的会使用到registerField的功能,来捕捉控件的属性值并且供全局共享。
Qt也支持自动绑定一些控件的属性,比如:
Widget Property Change Notification Signal
/* A SQL get all rows with duplicated values in cols*/
/*从一个表里面查询出一个或多个字段含有同样值的SQL语句。*/
SELECT orders.* FROM risingstardb2.sales_order AS orders
LEFT JOIN ( SELECT group_concat(ids) AS ids FROM
(SELECT COUNT(*) AS num, group_concat(id) as ids