Apollo Connecting the World

Diligence and Intelligence

Posts Tagged ‘Linux

[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 , , , , ,

[zz]关闭Linux下不必要的系统服务以加快速度

leave a comment »

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

Linux系统在/etc/rc.d/init.d下定义了很多的系统服务向用户提供,默认情况下这些服务大多都是随机启动,但是很多服务是一般不需要的,或者是你没有进行配置就根本不起作用的,但由于设置成随机启动,在内核加载进内存开始运行后会花时间启动这些服务相应的进程从而大大降低开机速度,所以你可以通过关闭这些服务从而加快开机速度。

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

以redhat9为例,下面的系统服务一般情况下大都可以关闭:

Cron(看情况,有时会需要)

Anancron

Apmd

Atd

Autofs

Cups(有打印机可以不关)

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 , ,

Fedora下查看显卡信息+显卡帧数

leave a comment »

查看显卡型号:
$lspci | grep VGA

 

查看帧数:
$glxgears

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: “127.0.0.1:7070”.

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

 

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

Preference:
[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 , , , ,

grep递归搜索

leave a comment »

如何使用grep递归搜索一个目录下及其所有子目录中文件中的字符串?

例:搜索: content

grep -r content ./

Written by apollozhao

2011/05/25 at 15:09

Posted in grep, Linux

Tagged with , , ,

Count number of lines of all files in a directory

leave a comment »

In Linux, given a directory “dir”, if you want to count number of lines of all files (e.g. .txt files) in the directory (inclucing sub-directory), simply type this command:

find ./ -name ‘*.txt’ | xargs wc -l

 

NOTE: This method works in Fedora 12

Written by apollozhao

2011/04/05 at 18:39

Posted in Linux, wc

Tagged with , , , , ,