0%

安装google Noto 字体,Noto是No Tofu的缩写,google志在设计一款不缺失任何字型的超级字体,消灭可恶的Tofu

1
# apt-get install fonts-noto

Vundle接口发生了变化,配置不太一样了

安装

1
$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

配置

~/.vimrc文件添加:

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
34
35
36
37
38
39
40
41
42
43
44
45
""""""""""""""""""""""""""""""""""""""""""""""""
" vundle
""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible " be iMproved, required
filetype off " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
Plugin 'user/L9', {'name': 'newL9'}

" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append \`!\` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append \`!\` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append \`!\` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

用法

1
2
3
4
5
6
:PluginList // 列出.vimrc文件中配置的插件
:PluginInstall // 安装插件
:PluginInstall! // 跟新插件
:PluginUpdate // 更新插件
:PluginSearch foo // 搜索插件,后面附加!号刷新本地缓存
:PluginClean // 清理不使用的插件

命令行安装插件

1
$ vim +PluginInstall +qall

References:
[1]Vundle

===
[erq]

我们知道,mac os x 终端下有一个命令open,可以打开任意类型的文件,当然是以系统内对应文件类型默认关联的应用程序来打开文件,如果系统本身没有该类型文件的处理程序,那么open命令一样无能为力。open命令还可以打开目录,默认用finder打开。

比如用finder打开当前目录

1
$ open .

其实linux平台上也有类似的命令,与mac open命令最接近的应该是xdg-open。xdg-open是桌面环境无关的默认应用程序处理器,在不同的桌面环境下,会调用桌面环境自己的默认程序处理器,比如gnome环境下会调用gnome-open。gnome-open以与nautilus相同的规则来打开各种类型的文件以及目录。

当没有桌面环境,或者桌面环境不支持默认程序处理时, xdg-open会使用自己的配置文件,自己来处理各种类型文件的默认应用程序。

比如,gnome环境下,执行以下命令,会用nautilus打开当前目录:

1
$ xdg-open .

XDG是X Desktop Group的缩写,freedesktop.org以前就叫这个名字,所以freedesktop所做的工作,很多冠以xdg开头。

Debian系统内也有一个open命令,这个命令是openvt的符号链接,用于在一个新的虚拟终端中运行应用程序。

可以在bashrc文件中用别名覆盖掉默认的open,这样:

1
alias open='xdg-open 2>/dev/null' 

这样终端下就可以直接open各种文档了。

References:
[1]xdg-open
[2]Linux下的通用打开命令
[3]Debian alternatives system
===
[erq]

cassandra是键值对NoSQL数据库,其数据表结构是这样组织的:

1
2
3
4
5
6
7
keyspace:{
column_family:{
column_family_key:{column_key:column_value, column_key:column_value, ...},
column_family_key:{column_key:column_value, column_key:column_value, ...},
...
}
}

可以这样来访问列:

1
keyspace.column_family\[column_family_key\]\[column_key\] = column_value;

可以将其结构理解为map:

1
Map<RowKey, SortedMap<ColumnKey, ColumnValue>>

References:
[1]Cassandra原理介绍

===
[erq]

中间件处于操作系统软件与用户的应用软件的中间。中间件在操作系统、网络和数据库之上,应用软件的下层,总的作用是为处于自己上层的应用软件提供运行与开发的环境,帮助用户灵活、高效地开发和集成复杂的应用软件。形象地说就是上下之间的中间。
  此外,中间件主要为网络分布式计算环境提供通信服务、交换服务、语义互操作服务等系统之间的协同集成服务,解决系统之间的互连互通问题。形象地说就是所谓左右之间的中间。

“JAVA是第一个天生的网络应用平台,特别是J2EE发布以来,JAVA从一个编程语言,演变为网络应用架构,成为应用服务平台的事实标准。应用服务器中间件,成为中间件技术的集大成者,也成为事实上的中间件的核心。”

man useradd里有一句话:

useradd is a low level utility for adding users. On Debian, administrators should usually use adduser(8) instead

也就是说useradd是一个低层次的用户添加工具,适合高阶用户使用,而在简单的场合适合使用adduser来添加用户,adduser添加用户时系统有step by step的用户提示来交互时的添加用户,使用比较简单,无需指定复杂的命令行选项。

那么说,useradd适用于非交互式场景,比如在脚本中创建用户,而adduser更适用于交互式场景

===
[erq]

PostgreSQL执行外部sql脚本有两种方式:
一种是在bash命令行上为psql命令用-f选项或重定向指定sql脚本

1
$ psql -U username -d dbname -f /path/to/script.sql

1
$ psql -U username -d dbname < /path/to/script.sql

另一种是在psql命令行上用\i命令执行sql脚本

1
=# \\i /path/to/script.sql

mac os x的bash切换到名字含有空格的目录时,可以使用单引号包围目录名,此时自动完成是正常的,也可以使用backslash反斜杠来转义空格,但此时无法自动完成,只能手工输入。#不如linux好用#