How to host a domain name registered in another account in one Dreamhost account. Simply trying to add the new domain, it reports: Error! You can’t add that domain: already in our system You need to delete the domain from your hosting (DNS) from the account first. Don’t worry, the domain name is still there
Read more
Tag: System
How to import OCaml libraries
Posted onHow to import 3rd party libraries (e.g. not standard libraries) in OCaml? An answer by Gabriel Scherer on how to import Batteries is just great and answers this question with much information. Although it is for Batteries, the method is general. The OCaml compiler (or toplevel, etc.) will find with no additional information only the
Read more
Force Linux to reboot
Posted onHow to force Linux to reboot when the reboot command does not work. Enable the use of the magic SysRq option: # echo 1 > /proc/sys/kernel/sysrq Reboot the machine: # echo b > /proc/sysrq-trigger Even if you could not log on the system but sshd is working, you can force the Linux to reboot by:
Read more
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
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
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
Is cin much slower than scanf in C++?
Posted onI frequently hear that cin is significantly slower than scanf in C++. Is this true? And how to improve the efficiency of cin? It is really nice to use most of time. One discussion about that cin is very slow is here: http://apps.topcoder.com/forums/?module=Thread&threadID=508058&start=0&mc=7 In short: cin is not always slower (can be faster actually, see
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
How to call C functions from OCaml code
Posted onI am writing a OCaml program but want to call some C functions provided in some source code or library. How to achieve this? Is there any good tutorials on this? A very good tutorial that is easy to follow and understand: How to wrap C functions to OCaml. A comprehensive reference manual: Chapter 19
Read more
SQL layers on NoSQL databases
Posted onWhat are the SQL layer solution over NoSQL databases such as key/value stores? Phoenix: A SQL layer on HBase: https://github.com/forcedotcom/phoenix They also show some performance results: https://github.com/forcedotcom/phoenix/wiki/Performance F1 – The Fault-Tolerant Distributed RDBMS Supporting Google’s Ad Business: http://research.google.com/pubs/pub38125.html With F1, we have built a novel hybrid system that combines the scalability, fault tolerance, transparent sharding,
Read more
Auto completion in Vim
Posted onHow to enable auto code completion in Vim, like in the IDE? Several plugins I use: snipMate: Plugin for using TextMate-style snippets in Vim omnicppcomplete: Plugin for C/C++ omnicompletion neocomplcache: Ultimate auto completion system for Vim
How to install the caption latex package on Fedora?
Posted onI got a message: Package subcaption Error: `caption’ package not loaded I guess that I should install the cpaton package. How to install the caption latex package on Fedora? Fedora 19 is already shipped with the latex Tex Live 2013. You can directly install it by yum. # yum install texlive-caption For older Fedora releases,
Read more
How to write a autostart script for gnome
Posted onI want to automatically run a program when I log in gnome. How to write a autorun script for it? Here is one example: $ cat ~/.config/autostart/dropbox.py.desktop [Desktop Entry] Comment[en_US]= Comment= Exec=/home/zma/bin/dropbox.py start GenericName[en_US]= GenericName= Icon=system-run MimeType= Name[en_US]= Name= Path= StartupNotify=true Terminal=false TerminalOptions= Type=Application X-DBUS-ServiceName= X-DBUS-StartupType= X-KDE-SubstituteUID=false X-KDE-Username= To set up a new one, you
Read more
x86-64 calling convention by gcc
Posted onWhat is the x86-64 calling convention by gcc? The calling convention of the System V AMD64 ABI is followed on GNU/Linux. The registers RDI, RSI, RDX, RCX, R8, and R9 are used for integer and memory address arguments and XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6 and XMM7 are used for floating point arguments. For
Read more
Converting String to long Integer in C
Posted onConverting a string to a long in C is a common operation that can be useful in various programming tasks. In this post, we will explore how to use the strtol and strtoul C library functions to convert a string to a long in C. Using strtol and strtoul The strtol and strtoul functions are
Read more
Installing Latex and Compiling a Latex Docuent in Linux
Posted onLatex is a popular document preparation system that is widely used for creating scientific and technical documents. Compiling Latex documents on Linux is a straightforward process that requires only a few Latex packages and a set of commands. By following the steps outlined in this post, you can easily compile Latex documents on your Linux
Read more
How to install the MATE fork of Gnome 2 on Fedora 17?
Posted onI miss Gnome 2. How to install the MATE fork of Gnome 2 on Fedora 17? MATE is already included into Fedora 17’s repository and is an official feature of Fedora 18. To install MATE on Fedora 17 # yum install @mate-desktop To install softwares usually needed: # yum install mate-media mate-screensaver mate-system-monitor mate-power-manager mate-utils
Read more
Mmaping Memory Range Larger Than the Total Size of Physical Memory and Swap
Posted onIn Linux, mmap() is a system call that is used to map a portion of a file or device into the memory of a process. This can be useful for a variety of purposes, such as memory-mapped I/O, shared memory, and virtual memory management. However, when mapping a large range of memory that is larger
Read more
A Beginners’ Guide to x86-64 Instruction Encoding
Posted onThe encoding of x86 and x86-64 instructions is well documented in Intel or AMD’s manuals. However, they are not quite easy for beginners to start with to learn encoding of the x86-64 instructions. In this post, I will give a list of useful manuals for understanding and studying the x86-64 instruction encoding, a brief introduction
Read more