Automatic keyboard pressers are useful tools. However, it seems that there is no simple and easy to use automatic keyboard presser for Linux if you search for “automatic keyboard presser linux”. After some digging, I find using the xvkbd with some options is a good method for automatic keyboard pressing though it is not designed
Read more
Tag: R
ASCII Table and ASCII Code
Posted onThis post gives the ASCII table and ASCII code with ASCII control characters and ASCII printable characters and a tool to convert ASCII codes to ASCII characters. Introduction to ASCII table and ASCII code ASCII stands for American Standard Code for Information Interchange. An ASCII code is the numerical representation of a character since computers
Read more
How to Read File into String in PHP
Posted onRead content of a file to string (in this example, we echo it): // Get text from file function get_text($text_filename) { if ($text_filename != “”) { $text = “”; $text_file = fopen($text_filename, “r”); while (!feof($text_file)) { $text = $text . fgets($text_file, 4096); } fclose($text_file); if ( $text != “” ) { echo $text; } }
Read more
How to Redirect WordPress Feed to Feedburner Using .htaccess
Posted on.htaccess is a powerful tool. Let’s look at how to using .htaccess to redirect WordPress feeds to feedburner. Let’s use my blog as the example. The WordPress’s feed url of my blog is https://www.systutorials.com/feed/. Now I want to redirect it to feedburner with url http://feeds.feedburner.com/systutorials . The idea is quite straightforward: For every request to
Read more
How to Redirect Old Domain to New Domain Using htaccess Redirect
Posted onI want to move the sub domain blog.pkill.info to systutorials.com permanently. I can manage all the pages I want to post using WordPress. Changing domain in a bad way is dangerous. Put a page the tell the reader that the site is moved to a new domain is very unfriendly to the user and also
Read more
Emacs Tips and Howtos
Posted onWith Emacs, I feel happy. I love the rich functions of Emacs, such as compiling, quickly jumping to the lines with compilation error and debugging with gdb, and more. I ever wrote small tips posts about Emacs before. But it is a good idea to put them together and keep adding new ones. Here comes
Read more
How to Generate and Apply Patches using diff and patch on Linux
Posted on`diff` and `patch` are tools to create patches and apply patches to source code, which is widely used in the open-source world, such as Linux kernel and application. patch: applying patches To apply a patch to a single file: $ patch < foo.patch If the foo.patch does not identify the file the patch should be
Read more
Installing ns-2 and ns-3 on Fedora Linux
Posted onns is a discrete-event network simulator targeted primarily for research and educational use. There are two version of ns, ns-2 and ns-3, which are quite different with each other in the implementation and method to use them. In this post, we introduce how to install ns-2 and ns-3 on Fedora Linux 15. Install ns-2.34 on
Read more
Setting Up Ubuntu DomU on Xen: Ubuntu 10.10 on Fedora Xen Dom0
Posted onSetting up Ubuntu 10.10 DomU on top of Fedora Xen Dom0 is introduced in this post. The process of setting up Ubuntu 10.10 DomU is the same as Setting Up Stable Xen DomU with Fedora: Unmodified Fedora 12 on top of Xenified Fedora 12 Dom0 with Xen 4.0 This post only show the difference which
Read more
Xen DomU’s I/O Performance of LVM and loopback Backed VBDs
Posted onThis posts list benchmark (using bonnie++) result of I/O performance of Xen LVM and loopback backed VBDs. The configuration of machines Dom0 VCPU: 2 (Intel(R) Xeon(R) CPU E5520 @ 2.27GHz) Memory: 2GB Xen and Linux kernel: Xen 3.4.3 with Xenified 2.6.32.13 kernel DomU VCPU: 2 Memory: 2GB Linux kernel: Fedora (2.6.32.19-163.fc12.x86_64) DomU’s profile: name=”10.0.1.200″ vcps=2
Read more
Problems during Installing Xen Dom0 in Fedora
Posted onHere is a list of problem that may occur during installing and configuring Xen Dom0 in Fedora. It is found originally in Fedora systems, but the tips in this post should also be helpful for installing Xen Dom0 on other platforms. BIOS configuration If xen stops at: “I/O virtualization disabled.” We may need to enable
Read more
Setting Up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12
Posted onPlease refer to for the latest stable Xen Dom0 solution. In this post, the detailed tutorial for setting up Xen 3.4.1 dom0 on top of Fedora 12 with kernel 2.6.29 will be introduced. Hardware: Dom0 hardware platform: Motherboard: INTEL S5500BC S5500 Quad Core Xeon Server Board CPU: 2 x Intel Quad Core Xeon E5520 2.26G
Read more
How to Capture Desktop Video on Linux using ffmpeg
Posted onffmpeg is a powerful tool and it can do the work of capturing Linux desktop video very well. ffmpeg is a very fast video and audio converter that can also grab from a live audio/video source. ffmpeg can grab X11 input and create a video file such as mp4 at specific fps with the specific
Read more
Installing akmod NVIDIA Driver on Fedora
Posted onInstalling akmod NVIDIA driver from rpmfusion on Fedora 12. First make sure your nvidia card is in “Supported NVIDIA GPU Products List”: Click here for the list 1. Add rpmfusion repository: Enable RPM Fusion repositories 2. Install akmod nvidia driver akmod builds the required kmod on bootup # yum install akmod-nvidia xorg-x11-drv-nvidia-libs.i686 3. Add nouveau
Read more
An I/O Performance Comparison Between loopback Backed and blktap Backed Xen File-backed VBD
Posted onI have done some I/O performance benchmark test of Xen DomU. For easier management, some of our DomU VMs are using file-backed VBDs. Previously, our VMs are using Loopback-mounted file-backed VBDs. But blktap-based support are recommended by Xen community. Before considering changing from loopback based VBD to blktap based VBD, I have done this performance
Read more
Mostly Used MPlayer Keyboard Control Shortcuts
Posted onMPlayer has a fully configurable, command-driven control layer which allows you to control MPlayer using keyboard. But which are these shortcuts are not immediately know to users of MPlayer. Below is a list of mostly used MPlayer keyboard control shortcuts. They come from the [[man:1|mplayer|mplayer manual]] where you can find a full list of all
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
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
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
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