Docker ZFS Storage

2016-10-24
阅读 1 分钟
2.2k
vim /etc/sysconfig/docker-storage DOCKER_STORAGE_OPTIONS='--storage-driver=zfs'

postgresql 自定义aggregate function实现reduce

2016-09-29
阅读 1 分钟
2.9k
isnp=# select i, yml(i) over (order by i) from generate_series(1,10) i;

postgresql 查看page, index, tuple 详细信息

2016-09-23
阅读 1 分钟
4.2k
下面的内容需要理解postgres术语 page, tuple, regclass, relname. sql command 需要用到 pgstattuple,pageinspect extension.

postgresql delete duplicated rows

2016-09-21
阅读 1 分钟
1.7k
Deleting duplicates 使用window function row_number 对数据partition 举例: {代码...}

Postgresql 探索MVCC

2016-09-18
阅读 7 分钟
3k
Postgresql MVCC Postgresql的隐藏列 tableoid 是表对象的一个唯一标识符,可以和pg_class中的oid联合起来查看 xmin 是插入的事务标识符,是用来标识不同事务下的一个版本控制 xmax 是删除更新的事务标识符,如果该值不为0,则说明该行数据当前还未提交或回滚 cmin 插入事务的命令标识符,从0开始 cmax 删除事务的命令标识...

Postgresql Server Side Cursor

2016-09-13
阅读 4 分钟
3k
When a database query is executed, the Psycopg cursor usually fetches all the records returned by the backend, transferring them to the client process. If the query returned an huge amount of data, a proportionally large amount of memory will be allocated by the client.

CentOS7.2 network.service NetworkManager.service 冲突

2016-07-18
阅读 1 分钟
21.8k
今天通过NetworkManager Gui修改了网卡eth0的Gateway,后来reboot了虚拟机,然后奇怪的事情出现了. 1.ifconfig not found eth0

systemd deletes shared memory segment in postgresql

2016-07-11
阅读 1 分钟
2.6k
最近在server上部署PostgreSQL9.5(源码安装), 总是报because another server process exited abnormally and possibly corrupted shared memory, google 发现竟然是systemd问题。

PostgreSQL Role Management

2016-06-17
阅读 2 分钟
2.6k
首先需要知道Pg的数据库逻辑分层1. Database -> 2. Schema -> 3. Table; Pg 的用户有1.Superuser 2. User Group 3. User

tornado stream upload

2016-06-06
阅读 2 分钟
4.3k
tornado 4.0 新加tornado.web.stream_request_body decorator ,用于stream request

psycopg2 import error libpq.so.5 的解决方法

2016-05-16
阅读 1 分钟
11.3k
psycopg2 raises ImportError with message _psycopg.so: undefined symbol: lo_truncate when imported. 这种情况多出现与系统有两个postgresql-server, 源码安装和使用yum,apt-get安装的, 而且两个server需要的libpq.so的版本不一致。 解决方法: ldd site-packages/psycopg2/_psycopg.so|grep libpq 确保libpq.so的版...

Golang Read File line by line

2014-09-29
阅读 2 分钟
6.8k
func main(){ rw,err := os.Open("") if err != nil { panic(err) } defer rw.Close() rb := bufio.NewReader(rw) for { line, _, err := rb.ReadLine() if err == io.EOF { break } //do something fmt.Println(string(line)) } }func main(){ rw,err := os.Open("") if err != nil { panic(err) } defer rw.Close() sb...

/proc/PID 文件夹

2014-07-24
阅读 1 分钟
3.3k
cmdline 命令行全名(加参数变量)和 ps 命令中的command 列结果一样 cwd 进程的工作目录 和 (pwdx PID) 结果相同 environ 进程的环境变量 exe 一般是/bin/ 的链接 fd 进程打开的文件描述fu .用ls -l 可以查看具体的文件 (可以用lsof -p PID) status 进程的相关状态 task 该目录下是进程所包含的线程(note: ps 可以查看线...

Hello assembly (x86 GAS)

2014-07-10
阅读 1 分钟
2.1k
.global _start_start: {代码...} .data # section declaration {代码...}

Install MariaDB 5.5.37 on Fedora 20

2014-07-08
阅读 1 分钟
2.2k
记下今天的傻事, 今天安装mariadb, 安装好了启动之后登录总是要求输入密码.记得以前root可以直接登录, 然后修改权限.(note:Ubuntu 上面是安装过程要求输入以前觉得这种方式很好不过跟现在有更好的方式了). 1 yum install mariadb mariadb-server

xargs 几个常见错误分析

2014-07-02
阅读 2 分钟
2.7k
ls *.mp3|xargs -n1 -I{} mv {} $(basename {} .mp3).pcm xyz@localhost ~/test $ :>lmy.mp3 xyz@localhost ~/test $ ls lmy.mp3|xargs -n1 -I{} mv {} $(basename {}.mp3).pcm xyz@localhost ~/test $ ll total 0 -rw-r--r--. 1 xyz xyz 0 Jul 2 18:45 lmy.mp3.pcm does't work. 原因: shell 最先执行子命令$(basena...

分布式搜索elasticsearch配置文件详解

2014-06-24
阅读 3 分钟
5.6k
elasticsearch的config文件夹里面有两个配置文件:elasticsearch.yml和logging.yml,第一个是es的基本配置文件,第二个是日志配置文件,es也是使用log4j来记录日志的,所以logging.yml里的设置按普通log4j配置文件来设置就行了。下面主要讲解下elasticsearch.yml这个文件中可配置的东西。

PTQL (Process Table Query Language)

2014-06-20
阅读 2 分钟
3.7k
PTQL (Process Table Query Language) Hyperic SIGAR provides a mechanism to identify processes called Process Table Query Language. All operating systems assign a unique id (PID) to each running process. However, the PID is a random number that may also change at any point in time when a process is...

mysql ibdata1

2014-06-19
阅读 3 分钟
2.6k
When you have innodb_file_per_table enabled, the tables are stored in their own tablespace but the shared tablespace is still used to store other InnoDB’s internal data:

mysql cursor

2014-06-18
阅读 1 分钟
2.6k
{代码...}

Handlebars.js learning

2014-06-13
阅读 1 分钟
2.1k
最近想学Ember.js, 了解到Handlebars模板引擎. 相比Python Mako, Jinja2 跟简单. 自定义 Block 非常的方便Handlebars.registerHelper(name, function() { ... });

Change mysql datadir (for Ubuntu)

2014-06-05
阅读 1 分钟
2.5k
Copy the existing data directory (default located in /var/lib/mysql) using the following command:sudo cp -R -p /var/lib/mysql /newpath

python frame 对象

2014-06-04
阅读 2 分钟
6.4k
Return a frame object from the call stack. If optional integer depth is given, return the frame object that many calls below the top of the stack. If that is deeper than the call stack, ValueError is raised. The default for depth is zero, returning the frame at the top of the call stack.

A Python Mini ORM

2014-06-04
阅读 5 分钟
3.1k
原文地址 {代码...}

Linux LVM

2014-05-28
阅读 3 分钟
3.3k
What’s LVM? Why using Linux Logical Volume Manager or LVM? Well, these questions are not the scope here. But in brief, the most attractive feature of Logical Volume Manager is to make disk management easier in Linux!