Oct 20, 2019

Terminal or Vi hangs after pressing ctrl + s

People who used to editors with shortcut CTRL + s to save files may have developed a habit to hit CTRL + s reflexively. 

I do the same. So, when I was using Vi, I may also accidentally pressed CTRL + s, which paused my terminal. Don't worry. Everything is fine. Simply press CTRL + q and the terminal will resume.

Picture: Pumpkins in Minnesota Arboretum. Oct. 2017




Oct 12, 2019

x11 forwarding for Microsoft Windows and GitBash

1. Install Xming. Then, start the Xming X server.

2. Open GitBash.


3. Export display environment on the bash command.
export DISPLAY=localhost:0


4. ssh to the target machine with x11 forwarding enabled
ssh -XY username@remote.host

5. Try your x11 forwarding by running an application with GUI, such as gedit.


Enjoy your X window.

Picture: Sunset at the Gull Lake August 2017

Oct 4, 2013

LATEX ERROR: paragraph ended before \@citex was complete


While I was compiling my paper with ACM sigplan template, I get a lot of error messages like this:
paragraph ended before \@citex was complete
I could only know there is something wrong in citations/references. But, I had no clue of how to fix it.

I firstly read the Author’s Guide to the ACM SIGPLAN Class (sigplanconf.cls). It states that SIGPLAN class wants the bibliography to be included in the main LATEX file. So, I merged my BBL file to the main tex file, as the author's guide suggested. However, it did not solve the problem.

After trying to remove many different parts of my article, I finally find a way to successfully build my paper
comment out \usepackage{cite}. 
I do not know if this is bug of the class file or if I am not using it properly. I would be happy to know why the "cite" package conflicts with the sigplan class file. Before that, I am happy that I can keep compiling and writing my article now.

Picture today: Manhattan, NYC. [courtesy of my dear wife - Claire Huang]



Oct 3, 2013

CloudSuite - Cassandra server - out of memory error

While I was trying to run YCSB with Cassandra on VM, which has 1 VCPU and 512 MB memory.
When I was using run_load.command (from CloudSuite package) to populate the store, the Cassandra server keeps crashing and reporting
java.lang.OutOfMemoryError: Java heap space 
After trying different parameter combinations, I finally successfully populated the data store.
Let me describe how I solved this.

In the file conf/cassandra.yaml, I tried to change the following parameters to different values.
binary_memtable_throughput_in_mb
memtable_throughput_in_mb
flush_largest_memtable_at
Basically, when these threshold are met, e.g., heap usage is over binary_memrable_throughput_in_mb, it will flush binary memtable to relieve the stress on memory space.
However, simply tuning these parameters did not solve the problem.

So, in the conf/cassandra-env.sh, I also tried to tune
MAX_HEAP_SIZE
NEW_HEAP_SIZE
Then, problem solved. This surprised me because I assume it would automatically choose the right size. However, it does not.

So, below is the summary of workable environment settings.
Machine: The smallest Rackspace VM (1 VCPU and 512 MB memory)
OS: Ubuntu 12.10
binary_memtable_throughput_in_mb: 32M
memtable_throughput_in_mb: 32M
MAX_HEAP_SIZE="256M"
NEW_HEAP_SIZE="100M"

Note: this setting may lead to lower throughput because of low memory footprint.

Picture today: Statue of Liberty [courtesy of my dear wife - Claire Huang]



Oct 2, 2013

CloudSuite - Cloud9 compiling issues



Environment: Linux 3.5  Ubuntu 12.10

LLVM 2.9  building error

Building Cloud9 in CloudSuite from EPFL requires LLVM.

While compiling LLVM, I had this error
Intercept.cpp:69:67: error: lseek64 was not declared in this scope
 This can be solved by adding  #include < unistd.h > into Intercept.cpp.

Referece:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673266


KLEE building error

When compiling KLEE, I had this error message
:1:24: error: asm/unistd.h
It can be solved by creating a soft link to a specific architecture directory.
ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/asm
Then, another problem shows up when assembler is processing crtn.o
Error: .size expression for _init does not evaluate to a constant
The solution is to comment out
 .size _init,.-_init and .size _fini, .-_fini
in ./libc/sysdeps/linux/x86_64/crtn.S

Note, you should change x86_64 to your target machine's architecture, if it is not x86_64.

Reference:
http://ubuntuforums.org/showthread.php?t=1861069

Picture today: West Point, NY [courtesy of my dear wife - Claire Huang]