http://www.emacswiki.org/emacs/WebloggerMode 是一个 Emacs 包,可以让你用
Emacs 来写 Blog,支持多站点配置。
安装也很简单,可以通过 http://tromey.com/elpa 来安装,也可以去
https://launchpad.net/weblogger-el 下载最新的版本,放到 load-path 中,然
后在配置文件中加上 (require ‘weblogger) 就 OK 了。
WebloggerMode 还依赖了 XmlRpc,这个也可以通过 ELPA 来安装。
安装好以后,先 M-x weblogger-setup-weblog 来设置一下 blog 站点,关键是把
“Server Endpoint” 设置对就行了。
下面是一些常见 blog 平台的 Server Endpoint:
Blogger.com: http://www.blogger.com/api
Wordpress: http://BLOG-URL/xmlrpc.php (For http://hexmode.wordpress.com/, this is http://hexmode.wordpress.com/xmlrpc.php. For a blog hosted at http://example.com/weblog/ it would be http://example.com/weblog/xmlrpc.php)
LiveJournal: http://www.livejournal.com/interface/blogger/
OpenWeblog: http://www.openweblog.com/interface/blogger/
MovableType: http://CGI-URL/mt-xmlrpc.cgi. If your CGI root is http://www.example.com/cgi-bin/mt/ then the Server Endpoint would be http://www.example.com/cgi-bin/mt/mt-xmlrpc.cgi.
Drupal: Enable the Blogger API and use http://DRUPAL-URL/xmlrpc.php
(like WordPress).
把站点配置好以后,就可以用 M-x weblogger-start-entry 来写文章了。
用法如下:
;; C-x C-s — post-and-publish current buffer to the weblog.
;; Calling weblogger-publish-entry with an prefix argument
;; (i.e. C-u C-x C-s) will prompt for which weblog
;; to use.
;; C-c C-c — save as draft and bury the buffer.
;; C-c C-n — post (but not publish) the current entry and
;; load the next entry.
;; C-c C-p — post (but not publish) the current entry and
;; load the previous entry.
;; C-c C-k — delete the current entry.
;; M-g — synchronise weblogger.el’s idea of the entries available
;; with the weblog server.
;; C-c C-t m — edit the main template.
;; C-c C-t a — edit the Archive Index template
;; C-c C-s s — Change the server being used.
;; C-c C-s w — Change the weblog.
;; C-c C-s u — Change the user (re-login).

从 Emacs 23 开始,设置字体就很简单了。

原先用的是 (set-default-font “文泉驿等宽正黑-10”) 来设置字体,用 C-h f set-default-font 看了帮助以后才知道这个函数已经在 23.1 版本开始不建议使用了,而是用 set-frame-font 来代替。

set-frame-font 是用来设置当前 frame 的字体,如果用 C-x 5 2 来创建一个新的 frame 之后,我们会发现用 set-frame-font 设置的字体没有生效。

http://www.emacswiki.org/emacs/SetFonts#toc2 这里就介绍了设置全局默认字体的方法,就是 (set-face-attribute ‘default nil :font FONT) 其中 FONT 是一个描述字体的字符串,和我们前面提到的 set-default-font 参数一样。

所以再要设置全局的默认字体为文泉驿等宽正黑就是 (set-face-attribute ‘default nil :font “文泉驿等宽正黑-10”)

MOMENTOS from Nuno Rocha on Vimeo.

Parcellite 是一个非常好用的剪贴板管理工具,可以帮你记录下最近的剪贴板记录,尤其是在 Ubuntu 下这个实在太有用了。试想一下这个场景,在 OOo 中复制了一大段文字,然后关闭了 OOo,再打开 gedit 却发现剪贴板被清空了,无法粘贴。这种看上去挺低级的错误在 windows 下好像都很少见,可是在 GNOME 下确实挺常见的。这时 Parcellite 就派上了用途,只要点击一下托盘的Parcellite 图表,然后点刚才复制的内容,然后又可以粘贴了。

除了记录剪贴板的内容,我们还可以在粘贴之前进行编辑。

Parcellite

最后还是要说本文的主题,Parcellite 有时就会不声不响的出错,本来设置了自动启动,却在开机后发现没有运行。在终端里直接执行 parcellite 命令,会看到如下类似的错误:

GLib-ERROR **: /build/buildd/glib2.0-2.25.11/glib/gmem.c:140: failed to allocate 18446744072089959167 bytes
aborting…
Trace/breakpoint trap

解决方法就是删除它的数据文件 ~/.local/share/parcellite

rm -rf ~/.local/share/parcellite

有的人买房只需要一拱就好几套,您买房需要多少年?

把 Hero 升级到中华电信版的 2.1 以后,用 adb 操作的时候就得到没有权限的提示了,而且也看不到设备名称。

chaifeng@chaifeng-desktop:~$ adb devices
List of devices attached
????????????    no permissions

google之后才发现adb 需要用root的权限运行才可以,为了省事写个简单的脚本:

#!/bin/bash

ADB_HOME=~/Applications/android-sdk-linux_86
pgrep -lf fork-server > /dev/null || ( echo “adb start-server”; sudo $ADB_HOME/tools/adb start-server )

$ADB_HOME/tools/adb $@

Enhanced by Zemanta