Tag Archive for 'Linux'

Filezilla 3.5.3 连接VsFTPd TLS问题

Response arg: error:1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared cipher

/etc/vsftpd/vsftpd.conf

ssl_ciphers=HIGH

原因是

The default is DES-CBC3-SHA which seems that is not supported anymore by FileZilla

NFS quick howto for centos 5

NFS quick howto for centos 5

To use nfs successfully, you have to configure the server and the client. In this example, the client is 192.168.0.3 and the server is 192.168.0.1. The folder to be shared is /home/sharing, and to be mounted to /mnt on the client

On the server

  1. Make directory that you want to use.
    • # mkdir /home/sharing
  2. Edit /etc/exports, insert the client machine’s ip
    • # vi /etc/exports
    • Add this line:
    • /home/sharing 192.168.0.3/255.255.255.255(rw,sync)
  3. Save
  4. Edit /etc/hosts.allow
    • # vi /etc/hosts.allow
    • Add this line:
    • portmap: 192.168.0.0/255.255.255.0
  5. Save
  6. Start nfs and portmap
    • # /etc/init.d /nfs start
    • # /etc/init.d/portmap start
On the client
  1. Start portmap
    • # /etc/init.d/portmap start
  2. Mount the nfs folder
    • # mount 192.168.0.1:/home/sharing /mnt
  3. Check /var/log/messages for any error that might occur
    • # tailf /var/log/messages
  4. Use mount to check if the folder is mounted properly
    • # mount 
    • This should be the output:
    • 192.168.0.1:/home/sharing on /mnt type nfs (rw,addr=192.168.0.1)
  5. Edit /etc/fstab to mount the shared folder on boot
    • # vi /etc/fstab
    • Add this line
    • 192.168.0.1:/mnt/sdb1/backup /mnt nfs rw,hard,intr 0 0
  6. Save
You can use 'man exports' to see the options available for /etc/exports

Continue reading ‘NFS quick howto for centos 5′

thinkpad只插电源适配器会锁频

在Gentoo上捣鼓 cpufreq-info 时发现只插电源适配器会锁频,可能是电源适配器只有65W 的原因。

苹果

以前总觉得苹果的 macbook pro 非常好,觉得matetext是那么Cool。以致于自己都想买一台,可是当自己做为Linux的9年用户得时候,觉得macbook并不是那么神通广大。然而Iphone,也不是那么炫。不是还有Android吗?放弃封闭的,投奔开放吧。

在Linux中把前台程序放到后台运行

  • 方法一:先通过 ctrl-z 把程序放到后台,再通过 bg %<jobid> 提交命令到后台,最后使用 disown -h %<jobid>。现在就可以退出终端,程序依然还在运行。
  • 方法二:使用screen和retty
    $ screen -S my_process
    $ retty $(pgrep my_process)
    /redraw

怎样在linux下修改ID3信息

mid3iconv
由于Ubuntu中的Amarok等播放器只支持UTF8字符,所以在Amarok中常常出现乱码。解决方案如下:

1
sudo apt-get install python-mutagen

修改mp3中编码:
到你的music目录去

1
find . -iname "*.mp" -execdir mid3iconv -e GBK {} \;

6个Linux性能监控命令行工具

  1. htop http://htop.sourceforge.net/
    一个可以让用户与之交互的进程查看器。作为文本模式的应用程序,主要用于控制台或 X 终端中。当前具有按树状方式来查看进程,支持颜色主题,可以定制等特性。
  2. Continue reading ’6个Linux性能监控命令行工具’

Linux For Thinkpad 下投影仪使用

安装完Linux一般都会发现快捷键不好用了。

1、简单方法
切入到文本控制台CTRL+ALT+F1
执行 echo crt_enable > /proc/acpi/ibm/video
切回图形界面就可以使用投影仪了。
注:执行前确认  /proc/acpi/ibm/video 存在
如果不存在请往下看。

2、复杂且有效方法

linux-wiki

http://www.thinkwiki.org/wiki/Problem_with_video_output_switching

cpulimit – 限制进程的 CPU 占用率

cpulimit

cpulimit 是一个简单而有用的小程序,通过它你可以限制一个进程的 CPU 占用率。如果善加利用,必将成为系统管理员的得力助手。

cpulimit 的用法也很简单,如上图所示,通过 -e 选项指定需控制的进程名(或 -p 选项指定 pid),-l 选项指定 CPU 的占用百分比即可。这里,我将 Chrome 的 CPU 占用率限制到 25%。

cpulimit 可从其项目主页下载,或通过你所用的 Linux 发行版包管理器安装。

Bash Shell Keyboard shortcuts

The following shortcuts work when using default (Emacs) key bindings. Vi-bindings can be enabled by running set -o vi.

Tab ⇆ : Autocompletes from the cursor position.
Ctrl+a : moves the cursor at the beginning of the line (equivalent to the key Home).
Ctrl+e : (end) moves the cursor at the line end (equivalent to the key End).
Ctrl+p : (previous) recalls the previous command (equivalent to the key ).
Ctrl+n : (next) recalls the next command (equivalent to the key ).
Ctrl+r : (research) recalls the last command including the specified character(s). A second Ctrl+r recalls the next anterior command which corresponds to the research
Ctrl+s : Go back to the next more recent command of the research (beware to not execute it from a terminal because this command also launches its XOFF). If you changed that XOFF setting, use Ctrl+q to return.
Ctrl+o : executes the found command from research.
Ctrl+l : clears the screen content (equivalent to the command clear).
Ctrl+u : clears the line content before the cursor and copy it in the clipboard.
Ctrl+k : clears the line content after the cursor and copy it in the clipboard.
Ctrl+w : clears the word before the cursor and copy it in the clipboard.
Ctrl+y : (yank) adds the clipboard content from the cursor position.
Ctrl+d : sends an EOF marker, which (unless disabled by an option) closes the current shell (equivalent to the command exit).
Ctrl+c : sends the signal SIGINT to the current task, which aborts and closes it.
Ctrl+z : sends the signal SIGTSTP to the current task, which suspends it. To return to it later one can enter fg ‘process name’ (foreground).
Ctrl+x Ctrl+x : (because x has a crossing shape) alternates the cursor with its old position.
Ctrl+x Ctrl+e : (editor because it takes the $EDITOR shell variable) edits the current line in vi.
Alt+f : (forward) moves forward the cursor of one word.
Alt+b : (backward) moves backward the cursor of one word.
Alt+Del : cuts the word before the cursor.
Alt+d : cuts the word after the cursor.
Alt+u : capitalizes every character from the cursor’s position to the end of the current word.
Alt+l : lowers the case of every character from the cursor’s position to the end of the current word.
Alt+c : capitalizes the character under the cursor and moves to the end of the word.
Alt+r : cancels the changes and put back the line as it was in the history.