Linux Note

搜索 Apt 已安装的软件 ubuntu 下 apt-get install 完一个软件,想知道它装到哪里了用这个命令 dpkg -L python-qt4 Install chrome date: 2016-05-27 wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo gdebi google-chrome-stable_current_amd64.deb Install new font date: 2015-04-29 How-to For system wide installation, copy the fonts to /usr/share/fonts and run sudo fc-cache to rebuild the font cache, or for user local installation, make sure ~/.fonts exists, copy them into there, then rebuild the font cache. Example Install adobe-fonts/source-code-pro in Ubuntu 14.04: [ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype sudo git clone https://github....

May 27, 2016 · 2 min · Me

Sqlite Note

常用查询函数 def query_db(self, sql, args=(), one=False): cur = self.cx.execute(sql, args) rv = [dict((cur.description[idx][0], value) for idx, value in enumerate(row)) for row in cur.fetchall()] return (rv[0] if rv else None) if one else rv 清空表的内容,并重置自增字段 delete from your_table; delete from sqlite_sequence where name='your_table'; 如何将两个字段字符串合并 使用 || 符号。 内置函数 核心函数 An application may define additional functions written in C and added to the database engine using the sqlite3_create_function() API. abs(X) 该函数返回数值参数 X 的绝对值。如果 X 为 NULL ,则返回 NULL。如果 X 是无法转换 为数值的字符串或 blob ,则返回 0....

April 24, 2015 · 20 min · Me

Build Static Blog With Pelican

Setup environment and install software: $ mkdir pelican_blog $ cd pelican_blog $ mkvirtualenv pelican_blog $ pip install pelican markdown beautifulsoup4 Pelican quickstart: $ pelican-quickstart You will see blow: Welcome to pelican-quickstart v3.5.0. This script will help you create a new Pelican-based website. Please answer the following questions so this script can generate the files needed by Pelican. > Where do you want to create your new web site? [.] > What will be the title of this web site?...

March 10, 2015 · 4 min · Me

Linux 下压缩和解压缩

Linux下压缩文件种类繁多,这里简单介绍一下常用的命令。 常用压缩命令 扩展名 解压 打包 .tar tar xvf FileName.tar tar cvf FileName.tar DirName .tar.gz tar zxvf FileName.tar.gz tar zcvf FileName.tar.gz DirName .tar.bz2 tar jxvf FileName.tar.bz2 tar tar jcvf FileName.tar.bz2 DirName .gz gunzip FileName.gz gzip -d FileName.gz gzip FileName .bz2 bzip2 -d FileName.bz2 bunzip2 FileName.bz2 bzip2 -z FileName .bz bzip2 -d FileName.bz bunzip2 FileName.bz .tar.bz tar jxvf FileName.tar.bz .Z uncompress FileName.Z compress FileName .tar.Z tar Zxvf FileName.tar.Z tar Zcvf FileName.tar.Z DirName ....

October 20, 2014 · 1 min · Me

Spyder in Winxp

现象:在 Windows XP 下安装完 Python(x,y) 后无法运行 spyder 和 Ipython console 。 原因:新编译的 pyzmq 只支持 Windows Visa 以上版本,不支持 Windows XP。 解决:重新安装老版本的 pyzmq 。 参考:https://code.google.com/p/pythonxy/issues/detail?id=670。

November 21, 2013 · 1 min · Me