Tag Archive for 'Linux'

Linux版本Google Chrome更改字体方法

在Linux下的Google自然可以通过设置更改字体,不过不能选择像“sans-serif”,“monospace”这样的字体。

你需要用编辑器手工编辑 .config/google-chrome/Default/Preferences

1
2
3
4
5
6
7
8
9
10
11
   "webkit": {
      "webprefs": {
         "global": {
            "fixed_font_family": "monospace",
            "sansserif_font_family": "sans-serif",
            "serif_font_family": "serif",
            "standard_font_family": "sans-serif"
         },
         "uses_universal_detector": true
      }
   }

dejavu是我一直使用的字体。

Share

在哪里找Google Chrome播放的Flv缓存

这里只是 Linux上的方法

  1. 先找到PID
    1
    ps ax | grep -i chrome | grep -i flash  
  2. 再找到文件
    1
    file /proc/Flash_Plugin_PID/fd/* | grep -i deleted

    或者

    1
    lsof -p Flash_plugin_pid | grep -i deleted
  3. 拷贝文件 /proc/[pid]/fd/[fileno] 到 recovered_file.flv
Share

内网服务器使用SSH端口转发访问外网

很多使用我们不能在内网防火墙中的服务器上使用yum等工具,不过我们可以使用SSH来映射本地端口到服务器完成。

在你的笔记本电脑上使用以下Python(twisted)来做一个代理,当然你也可以用nodejs,Perl,或者直接用Squid等。

from twisted.web import proxy, http
from twisted.internet import reactor

class ProxyFactory(http.HTTPFactory):
   def buildProtocol(self, addr):
      return proxy.Proxy()

reactor.listenTCP(8080, ProxyFactory())
reactor.run()

然后把这个8080端口映射到内网服务器上的8083端口上

1
ssh -g -R 8083:localhost:8080 remote-server

最后在内网服务器上使用代理

1
export http_proxy="http://localhost:8083"

 

Share

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

Share

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′

Share

thinkpad只插电源适配器会锁频

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

Share

苹果

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

Share

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

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

怎样在linux下修改ID3信息

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

1
sudo apt-get install python-mutagen

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

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

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

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

Share