Plain 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
Category: QA
Questions and answers.
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 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 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 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
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
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
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
How to import a source file to OCaml’s toplevel?
Posted onHow to import a source file to OCaml’s toplevel? Say, I want to use a function implemented in a source file in the toplevel. #use “file-name”;; Read, compile and execute source phrases from the given file. This is textual inclusion: phrases are processed just as if they were typed on standard input. The reading of
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
Systems Conferences
Posted onWhich ones are good systems conferences? Top ones by ACM and USENIX: OSDI: https://www.usenix.org/conferences/byname/179 SOSP: http://sosp.org/ Other SIGOPS Events: http://www.sigops.org/conf-sponsored.html EuroSys: http://www.eurosys.org/ SoCC: http://www.socc2013.org/ (SoCC 2013) ASPLOS: http://www.sigplan.org/Conferences/ASPLOS/Main VEE: http://www.sigplan.org/vee.htm USENIX ATC: https://www.usenix.org/conferences/byname/131 NSDI: https://www.usenix.org/conferences/byname/178 IEEE Conferences: ICDCS: http://www.temple.edu/cis/icdcs2013/ (2013) IPDPS: http://www.ipdps.org/ Other related ones and workshops: HPCA: Search HPCA ConferenceSC: http://www.supercomp.org/IEEE CLUSTER: http://www.clustercomp.org/ HotCloud:
Read more
Length of int in OCaml?
Posted onWhat is the length of int in OCaml? It is said that int in OCaml is 31. But I get this: # (1 lsl 33);; – : int = 8589934592 8589934592 is larger than 2^31. On my laptop (64-bit Fedora Linux), the int in OCaml is 63 bits. The code (count1s counts the number of
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
Consistency models for distributed systems
Posted onWhich are the consistency models used for distributed systems? Papers that survey the consistency models Robert C. Steinke and Gary J. Nutt. 2004. A unified theory of shared memory consistency. J. ACM 51, 5 (September 2004), 800-849. DOI=10.1145/1017460.1017464 http://doi.acm.org/10.1145/1017460.1017464 David Mosberger. 1993. Memory consistency models. SIGOPS Oper. Syst. Rev. 27, 1 (January 1993), 18-26. DOI=10.1145/160551.160553
Read more
Transactional memory learning materials
Posted onI want to learn transactional memory technologies. Any suggestions on Transactional memory learning materials? Thanks! I highly suggest the Transactional Memory lecture by James R. Larus and Ravi Rajwar of Synthesis Lectures on Computer Architecture: The Transactional Memory lecture:http://www.morganclaypool.com/doi/abs/10.2200/S00070ED1V01Y200611CAC002 Link to the PDF:http://www.morganclaypool.com/doi/pdf/10.2200/S00070ED1V01Y200611CAC002
How to set Google Chrome’s proxy settings in command line on Linux?
Posted onHow to set Google Chrome’s proxy settings in command line on Linux? I am using Google Chrome on Linux and start it by google-chrome. How can I set the proxy using the command line? It tell me that my desktop is not supported but I can set the proxy in command line. Use the –proxy-server
Read more