I find there are too many TCP segments retransmited in a Xen virtual machine. sudo netstat -s | grep segments 537559 segments received 558908 segments send out 3533 segments retransmited 2677 bad segments received. There are 4 VMs on a host which has 4 cores. The segment retransmision rate is too high. It finally turns
Read more
Author: Q A
Cache at Facebook
Posted onAbout caching system at Facebook. According to: https://www.facebook.com/notes/facebook-engineering/monitoring-cache-with-claspin/10151076705703920 Facebook has two major cache systems: Memcache, which is a simple lookaside cache with most of its smarts in the client, and TAO, a caching graph database that does its own queries to MySQL. The NSDI’13 paper introduces more about Memcache: https://www.usenix.org/conference/nsdi13/scaling-memcache-facebook The USENIX ATC’13 paper introduces
Read more
How to exclude certain repositories in yum?
Posted onThis tutorial introduces how to exclude certain repositories in yum. Excluding certain repositories is needed usually. One example may be when you have several repositories that have the same package and you only want the one from a certain repository. For my situation, I choose to exclude the google-chrome and other repositories from Google when
Read more
How to install Scala on Fedora Linux
Posted onThis tutorial introduces how to install Scala 2.9.2 on 64-bit Fedora Linux 17. There are some changes needed to make scala work on Fedora Linux 17. Please check it out in the answer. Install Java Scala depends on Java, so please install Java first. In this tutorial, we installed JDK to: /usr/java/jdk1.6.0_24/lib/. Install Scala from
Read more
Question2answer: show excerpt in the RSS feed
Posted onThere is a “Include full text in feeds:” option in the “RSS feeds” configuration panel but no options/method to only show excerpt instead of the “full text” or nothing for RSS feeds. This need to hack the question2answer source code. Details are in the answer. The changes based on Question2asnwer 1.5.4: diff –git a/qa-include/qa-index.php b/qa-include/qa-index.php
Read more
How to delete all topics and posts from a user/spammer in myBB?
Posted onThis is a tutorial on “how to delete all topics and posts from a user/spammer in myBB”. Please check out the answer. I use the Goodbye Spammer plugin for MyBB. First, install it after downloading the plugin form its homepage: Upload ./inc/plugins/goodbyespammer.php to ./inc/plugins/ Upload ./inc/languages/english/goodbyespammer.lang.php to ./inc/languages/english/ Go to ACP > Plugins > Activate
Read more
How to get the assembly code for OCaml code generated by ocamlopt?
Posted onHow to get the native assembly code (e.g. x86-64 asm) for OCaml code generated by the native ocamlopt compiler? To get the assembly code for an OCaml program, add these parameters to ocamlopt: -S -inline 20 -nodynlink An example is as follows. The OCaml program: $ cat not.ml let not x = ((x – 1)
Read more
How to repair a MySQL table?
Posted onAfter a server crash and restarting, MyBB reports a SQL Error as follows: MyBB SQL Error MyBB has experienced an internal SQL error and cannot continue. SQL Error: 145 – Table ‘./mybb/mybb_sessions’ is marked as crashed and should be repaired Query: SELECT * FROM mybb_sessions WHERE sid=’40021925bd0494ea31…’ AND ip=’x.x.x.x’ LIMIT 1 The dababase is MySQL.
Read more
Plain text file pipelined to Linux mailx turns to “Content-Type: application/octet-stream” (an attachment)
Posted onPlain text file pipelined to Linux mailx turns to “Content-Type: application/octet-stream” which is recognized as an attachment by some email client. The command is like this: $ cat log.txt | mail -s “Updated log file” -r “from@example.com” “to@example.com” I expect it to be: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit But it turns out to be: Content-Type:
Read more
Where are the Linux routing table entries stored on disk?
Posted onI know the routing tables on Linux is in memory after being set. However, where are the routing table entries stored on disk? I mean where are the routing table is persistently stored so that the routing table can be reloaded like the iptables (under /etc/sysconfig/iptables on Fedora/RHEL/CentOS Linuxes). If the system uses the /etc/rc.d/init.d/network
Read more
How to save a Word as a PDF in Office 2007
Posted onHow to save a Word document to be a PDF in Office 2007? I find this add-on for Office 2007 from Microsoft: 2007 Microsoft Office Add-in: Microsoft Save as PDF or XPS. It works very well for me. After installing this plugin, I can open a Word document and save it as a PDF file.
How to use OCaml as a script language?
Posted onHow to use OCaml as a script language like bash and python? It will be good that I can write a script in OCaml and directly invoke it. For example, I write a script named “script.ml” and then I can invoke it directly by $ ./script.ml Thanks! Three helloworld scripts: script3.ml #! /usr/bin/env ocaml print_string
Read more
How to list a git repository’s all branches on the remote server?
Posted onI can list all local branches by git branch How to list a git repository’s all branches on the remote server? You need the -r option: git branch -r From the man page of git-branch. -r List or delete (if used with -d) the remote-tracking branches.
How to change the position of y-axis label in Gnuplot
Posted onAfter setting the font sizes for Gnuplot, they fonts look good. However, the y labels is too far away from the y-axis. How to change the position of y-axis label in Gnuplot? You can make use of the {offset <offset>} option. For example: set ylabel “Y Label” offset 3,0,0 which moves the ylabel 3 characters
Read more
Where are the backup files of my iPhone by iTune and how to get the real files from them?
Posted onI backup my iPhone with iTune to my local computer. Where can I find out the backup files of my iPhone by iTune? And how to get the real files (like songs, notes, etc.) from the backup files? The location of the backup files from iTune It depends on the computer’s operating system: Mac: ~/Library/Application
Read more
How to print the text in a web page?
Posted onHow to efficiently print a webpage? E.g. I want to only print the text for some pages but with figures for some other pages. I tried to copy the webpage to a document, but the format turns to be just terrible. One good tool that I use is PrinterFriendly which can convert a webpage to
Read more
How to change the font sizes in Gnuplot
Posted onHow to change the font sizes of labels (x and y axis) and keys for Gnuplot? The default fonts turn to be too small when I shrink the images in my paper. Several methods are available for Gnuplot: Set the global fonts size for the terminal: set terminal enhanced font ‘Verdana,10’ Here, 10 is the
Read more
Grub2: How to boot Fedora to an old kernel?
Posted onGrub2: How to boot Fedora to an old kernel? The old kernel is a submenu under “Advanced options for Fedora”. It is not shown if I follow the instruction that # grep menuentry /boot/grub2/grub.cfg | cut -d “‘” -f2. The old kernel in grub2 is in a submenu entry in a menu. The key is
Read more
Set Chrome RSS Subscription Extension to Subscribe to RSS feed using Feedly
Posted onHow to set Chrome RSS Subscription Extension so that I can subscribe to RSS feed using Feedly? Both tools are great and it will be better to combine them together. The link in feedly to subscribe a RSS feed (e.g. https://www.systutorials.com/b/feed/ ) is: http://www.feedly.com/home#subscription/feed/https://www.systutorials.com/b/feed/ We can replace the RSS feed URL with a %s in
Read more
Good tools to manage OCaml packages
Posted onWhich tools to mange OCaml packages in my system (Linux)? I use OPAM to manage OCaml packages: http://opam.ocamlpro.com/index.html To install it: $ wget https://raw.githubusercontent.com/ocaml/opam/master/shell/opam_installer.sh $ sh ./opam_installer.sh /usr/local/bin More options are available here. To make opam settings take effect, append this to ~/.bashrc: eval `opam config env` Some frequent usages: opam list # List all
Read more