Apollo Connecting the World

Diligence and Intelligence

Archive for the ‘Linux’ Category

[zz]Ack: 比 Grep 更好用的代码搜索工具

leave a comment »

grep 的苦恼

身为一个程序员,经常要在代码海里面找到某个该死的东西在哪里出现过。大部分人都会用 grep -R pattern . 来递归查找,但是 grep 会把很多你完全不想要的东西挖出来,比如:

  • 版本管理系统的目录。用 svn 的人都知道,svn 会把 .svn 目录扔得到处都是(1.7 版本开始改善了这一点,但某厂还在用 1.6,你懂的),要排除掉不容易。同理, CVS , .git , .hg 这些目录里面的内容通常都不是我们关心的。
  • 备份文件。例如 foo~, #foo# 。
  • 二进制文件。例如 core dump, .o 文件, .a 文件。

Read the rest of this entry »

Written by apollozhao

2012/10/15 at 03:05

Posted in ack, grep, Programming

Tagged with , , , ,

[zz]Converting JPG Images to EPS

leave a comment »

from: http://fclose.com/b/linux/3549/converting-jpg-images-to-eps/

I write a lot latex documents and most of the documents have images in it. Latex deals EPS very well, while sometimes we need to add JPG / PNG images to it. I find converting the JPG images to EPS ones is the most convenient way to embed JPG images to latex documents. On Linux, this is quit easy with ImageMagick.

You need to install ImageMagick if it is not already installed in the system:

# yum install ImageMagick

Convert image image.jpg from JPG to EPS format:

$ convert image.jpg image.eps

For other image formats, the command is similar.

Written by apollozhao

2012/02/10 at 10:48

Posted in LaTeX, Linux

Tagged with , , , , ,


leave a comment »

from: http://server.zdnet.com.cn/server/2008/0617/931251.shtml


不同的GNU Linux版本的系统服务大都一样,但是也会有一些小区别,一般都提供50个左右的服务。








Read the rest of this entry »

Written by apollozhao

2011/09/21 at 15:36

Posted in Linux

Tagged with , ,

How to check the version of Linux (Fedora, Ubuntu, or other issues)

leave a comment »

If we want to check whether a Linux is a Fedora, or Ubuntu, or SuSE or whatever, in command line, we can simply do like this:

1. go to /etc, search for the file with string “issue” or “release”
$cd /etc
$ls *issue* (ls *release*)

2. read the found file, e.g.:
$more issue
$more lsb-release


Note: This method applies in Fedora, Ubuntu. For other systems the blogger has not verified.


Written by apollozhao

2011/09/20 at 15:35

Posted in Linux

Tagged with , ,


leave a comment »

$lspci | grep VGA



Written by apollozhao

2011/08/24 at 19:49

SSH Tunnel in Linux

leave a comment »

It is easy in Windows to create SSH tunnel with the help of many tools (e.g. putty). How to do it in Linux? It is easier. 🙂

Suppose mike has an account on remote machine sshserver.com, which is used to be the one to connect.

Open an terminal, type command:
$ssh -N mike@sshserver.com -D 7070

Input the password, and now you have created the SSH tunnel. To use it as a proxy, just config your browser, add a socks 5 proxy, with the proxy as: “”.

OK, now you can surf the Internet with the proxy.


Some articles use -L parameter in the SSH commands, please refer to [1].

[1] http://blog.fredrikbostrom.net/2009/04/10/ssh-tunnel-from-the-command-line


Written by apollozhao

2011/07/01 at 11:45

Posted in Internet, Linux, ssh, SSH Tunnel

Tagged with , , , ,


leave a comment »


例:搜索: content

grep -r content ./

Written by apollozhao

2011/05/25 at 15:09

Posted in grep, Linux

Tagged with , , ,