When editing some files fro Windows in vim, there are some ugly “^M” returns. Here is a method to remove and replace these “^M”s (please note that you should not copy/past to use the follows): :1,$s/{Ctrl+V}{Ctrl+M}//{Enter} {Ctrl+V} means keyboard operation that is push ‘ctrl’ and ‘v’ together. {Enter} is push ‘enter’. : means that it
Read more
Author: Eric Ma
Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.Howto: Git Server over SSH
Posted onGit and SSH are both powerful tools, and git/ssh work well together. We introduce how to set up git server via ssh in this post. Git server through SSH is easy and fast to set up, although every user will have access to all repositories in the git server over SSH and every user is
Read more
Fedora 中文字体设置
Posted onFedora 一直有中文字体难看的问题, 尤其是在英文环境中. 使用本文中的配置方法可以得到令人满意的中文效果. 此方案中使用字体都为开源且在Fedora源中自带. 此方案对 Fedora 9 – 20 有效. 对于后续版本支持我会确认并更新此文章. 此方案对Gnome, KDE都有效. Firefox 中也有中文难看的问题, 后面会提到. 快速配置方法 如果你想马上配置好,请使用如下命令。此方法测试使用效果良好。 # yum install cjkuni-ukai-fonts cjkuni-uming-fonts # wget https://raw.githubusercontent.com/zma/config_files/master/others/local.conf \ -O /etc/fonts/local.conf 相关英文字体配置可以参考:Improving Fedora Font Rendering with Open Software and Fonts Only. Fedora 系统中文字体的配置方案 使用uming和ukai字体,即AR PL UMing CN等. 中文字体和等宽字体效果如图所示(点击看大图, Firefox 中文字体设置在后面会提到). 方法如下: 安装字体 首先安装这两个字体: cjkuni-ukai-fonts cjkuni-uming-fonts (在Fedora
Read more
How to Create ISO Image from DVD Disk on Linux
Posted onDVD disks are still commonly used in some areas while the disks are not fast and convenient enough for frequent usage. For frequent usage or archiving, an image of the DVD on hard drives will be better. ISO images do not use a particular container format. They are just a sector-by-sector copy of the data
Read more
Installing NVIDIA Driver in Fedora
Posted onUsing rpmfusion’s rpm packages to install NVIDIA driver in Fedora is introduced in this post. First, check the proper drivers for the card on [1]. 1. Add rpmfusion. Enable RPM Fusion repositories 2. Install the driver # yum install kmod-nvidia xorg-x11-drv-nvidia The reboot system. 3. Edit /etc/X11/xorg.conf # nvidia-xconfig The nouveau module conflicts with the
Read more
ALSA Problem of Fedora 11 on Compaq Presario CQ35-240TX
Posted onWhen I get my new Compaq Presario CQ35-240TX, of course, the first thing is to install Fedora ;) But unfortunately, after installation there is no sound! It seems there is something wrong with the driver configuration. Here is a solution to this: Add these two line at the end of /etc/modprobe.d/dist.conf options snd-hda-intel model=hp-m4 enable=1
Read more
Compiz-fusion on Fedora
Posted on1. Install relevant packages #yum install ccsm emerald-themes compizconfig-backend-gconf fusion-icon-gtk emerald compiz-fusion compiz-fusion-gnome libcompizconfig compiz-gnome compiz-bcop compiz compizconfig-python compiz-fusion-extras compiz-fusion-extras-gnome 2. Start compiz-fusion by using command “fusion-icon”. It can be found in “Applications -> system tools -> fusion-icon”. It will be more convenient if “fusion-icon” is added to autostart list by adding a entry in
Read more
Add More Loop Device in Linux
Posted onWe need more loop devices on Linux than the default number (most commonly 8) some time, such as we are building 12 or more virtual machines on top of xen using loop device backed VBD. In this post, we want to use 32 loops. 1. If loop device is compiled directly in the kernel Pass
Read more
How to Speed Up Firefox DNS Lookup in Linux
Posted onHow to speed Up Firefox DNS Lookup in Linux: 1. Close IPV6 support # echo “alias net-pf-10 off” >> /etc/modprobe.conf # echo “alias ipv6 off” >> /etc/modprobe.conf Type “about:config” into the address line and enter. Set “network.dns.disableIPv6” to “true” 2. Some other tweaks Type “about:config” into the address line and enter. Set “network.http.pipelining” to “true”
Read more
Create and Manage Virtual Machines on Xen
Posted onIn this post, these content are introduced: Create and manage file-backed virtual block device (VBD) for virtual machines on xen. Install Fedora 11 via internet as DomU on top of xen. Manage virtual machines using xm. Create file-backed VBD: The actual space of VBD will be the amount of disk the virtual machine used. And
Read more
Configure sMobileNet of HKUST on Linux
Posted onHow to configure NetworkManager to connect to sMobileNet in HKUST is introduced in this post. The wireless network connection configuration for sMobileNet in NetworkManager The SSID is “sMobileNet” Wireless security is “WPA & WPA2 Enterprise” Authentication is “Protected EAP (PEAP)” Anonymous identity is “” (empty) CA certificate is “(None)” (there will be a warning appear,
Read more
Chinese Charactor Configuration on Fedora 11
Posted on最新的更新版本请看: Fedora 中文字体设置. 使用Linux时我个人倾向使用英文环境系统,而Fedora11在英文环境下中文字体有时会不太好看,经常遇到需要字体优化美化的问题。 以下是我的配置方案,经测试效果还算不错,解决了Fedora 11 中文字体难看的问题: 方案1:使用uming和ukai字体,即AR PL UMing CN等。 关键是使用的字体包如下: 首先要安装这两个字体: cjkuni-ukai-fonts cjkuni-uming-fonts 然后配置一下~/.fonts.conf文件. 使sans-serif serif monospace字体中文使用uming/ukai即可. 我的.fonts.conf文件可以从这里下载(两种选择, 我喜欢前者): https://github.com/zma/config_files 使用Liberation和uming/ukai字体: .fonts.cofn.liberation 使用dejavu和uming/ukai字体: .fonts.conf.dejavu 下载后放到自己的$HOME下改名为.fonts.conf就可以了。 使用uming字体效果如下(请放大后看效果): 方案2:安装文泉驿字体,这个非常简单,安装相应包即可了。 如果喜欢其它的字体选择性的安装上就可以了,只要注意只安装自己需要的就行了。有人使用微软雅黑字体,首先这是侵权的,其次开源的字体做得其实已经很不错了。 最后将字体平滑选项打开, KDE和gnome都有相关设置方法。 以上内容只是针对使用xft字体系统的设置。对于使用核心字体系统的X程序来说字体依然会出现很丑的情况。 下面是针对emacs的设置方法: 首先需要安装这个字体包: xorg-x11-fonts-misc 注意到在中文系统下emacs的中文显示非常好,而在英文环境中去非常差,我们可以利用这一点,在运行emacs前首先将系统环境设为中文即可。 在~/bin/下建立一文件ema 内容如下: #!/bin/bash rm -f ~/.emacs ln -s ~/.emacs.x ~/.emacs LANG=zh_CN.UTF-8 emacs –fullheight -r $* 然后加入执行权限即可: chmod +x
Read more
Beautiful Desktop – Gnome 2 of OSX style on Linux
Posted onScreenshots of the desktop: Metacity theme: Humanoid-OSX-Blend GTK 2.x theme: OSX-theme-mod 0.9 GNOME Icon: OSX 3.3 X11 Mouse theme: MacOSX PantherX Mouse Theme[For Baghira] 1.1 Wallpaper: Elementary The system: Fedora 10 Gnome 2.24.3 Updated on 6 Mar. 2010. Screenshots added.
Converting Movie Files to wav and mp3 Files Using MPlayer and LAME
Posted onAs a multimedia enthusiast, you may want to convert your movie files to audio files for various reasons such as creating soundtracks, audio books or listening to dialogues & music without the video. Converting movie files to WAV and MP3 files using MPlayer and LAME is a simple and straightforward process. By following the steps
Read more
Creating and Running Virtual Machine Using VMware Player and qemu-img
Posted on基于VMware Player, qemu-img创建和运行虚拟机 Linux系统上的免费个人虚拟机方案. 1. 创建虚拟硬盘映象文件: qemu-img create -f vmdk WindowsXPPro.vmdk 10G 2. 创建.vmx虚拟机配置文件: 这是一文本文件. WindowsXPPro.vmx内容: config.version = “8” virtualHW.version = “3” ide0:0.present = “TRUE” ide0:0.filename = “WindowsXPPro.vmdk” memsize = “256” MemAllowAutoScaleDown = “FALSE” ide1:0.present = “TRUE” ide1:0.fileName = “auto detect” ide1:0.deviceType = “cdrom-raw” ide1:0.autodetect = “TRUE” floppy0.present = “FALSE” ethernet0.present = “TRUE” usb.present =
Read more
Several Vim Tips (in Chinese)
Posted on窗口模式操作 CTRL-W CTRL-S 将当前窗口分割为两窗口 CTRL-W CTRL-W 切换窗口 CTRL-W j 切换到下一窗口 CTRL-W k 切换到上一窗口 CTRL-W CTRL-R 将窗口的位置轮换 CTRL-W CTRL-_ 将当前窗口最小化 CTRL-W CTRL-= 将所有窗口变为等大 搜索和替换 /word 搜索word 搜索之后按回车高亮显示,n 下一个 p 上一个 :%s/模式/替换成的内容/gc % 全局选项,如果没有开启则只在当前行进行替换 g 表示 全局替换,如果没有g选项则只替换每行出现的第一个单词 c 表示需要确认 Esc替换按键 ESC键在键盘的左上角,按起来很不方便,而在VIM中ESC经常用到,其实有一个同样作用的组合按键:CTRL-[,这两个按起来手基本不用做大的动作,方便多了。 块操作 使用visual可视模式 v 进入可视模式,移动光标可进行选择 CTRL-Q 或 CTRL-V 进入列式模式,可进行块操作,选定的是一个矩形块。如果使用behave mswin CTRL-V可能映射成为past
Configuring Gnome Desktop with Gconf-editor
Posted ongconf-editor gnome桌面配置工具 最近换了一个漂亮的图标集,以前嫌桌面上我的电脑等图标没有用处就关闭了,现在换了好看的图标想再把它们拿出来。 找到了gconf-editor这个工具,还是很不错的,配置起来挺方便的。 # yum install gconf-editor 在apps->nautilus->desktop 设置下 computer_icon_visible home_icon_visible trash_icon_visible 三个值就可以了。
How to Create, Mount, and Burn ISO Images on Linux
Posted onLinux has many tools for mounting, creating and burning iso image files. In this posts, I will introduce how to use the iso files on Linux. The tools we used in this post are mount, genisoimage and wodim. 1. Mount an iso image file Mounting an iso on Linux is straightforward. We mount the iso
Read more
Moved back to WordPress from MediaWiki
Posted onWordPress is so missed for many great features and plugins. Hence, we moved the site back to the WordPress system on Jul. 12, 2013. MediaWiki is great but, for this site, WordPress is a better solution. The so missed features of WordPress Related posts via the YARPP Plugin. URLs without strongly mapped to the title
Read more
How to Run a cron Job Every Two Weeks / Months / Days
Posted onWe may want to run some jobs for every two weeks/months/days… under some situation such as backing up for every other week. In addition, we may add more complex rules for running jobs, e.g. run a command when the load of the server is higher than a certain level. With the help of the shell
Read more