How to add a “status bar” to screen on Linux?

Posted on

I noticed that some guys’ screen console has a status bar with tab numbers. That will be very useful for 1) know you are using screen rather than a normal terminal. 2) which tab you are working in. Below is my ~/.screenrc: hardstatus alwayslastline hardstatus string ‘%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]’ It
Read more

How to install latest version of Calibre?

Posted on

How to install latest version of Calibre? The version from my distro (Ubuntu, Linux Mint, Fedora) seem at 1.xx while the latest Calibre is already at 2.x. You may check Caibre website’s instruction: http://calibre-ebook.com/download_linux sudo -v && wget -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c “import sys; main=lambda:sys.stderr.write(‘Download failedn’); exec(sys.stdin.read()); main()”

How to config network in host (wireless network) for QEMU guest os

Posted on

The host os is connected into network by wireless one so how to let its guest os connect network. Take [1] as a reference. I run it successfully with following steps. 1, create /etc/qemu-ifup script and chmod it. 2, start a qemu guest os with command sudo ./qemu/qemu-system-x86_64 -enable-kvm -m 1024 -drive file=marss_dram.qcow2 -vnc 127.0.0.1:0
Read more

How to get logs of a specific time range on Linux?

Posted on

The logs I am processing is Hadoop log (log4j). It is in format like: 2014-09-20 21:55:11,855 INFO org.apache.hadoop.nfs.nfs3.IdUserGroup: Updated user map size: 36 2014-09-20 21:55:11,863 INFO org.apache.hadoop.nfs.nfs3.IdUserGroup: Updated group map size: 55 2014-09-20 22:10:11,907 INFO org.apache.hadoop.nfs.nfs3.IdUserGroup: Update cache now 2014-09-20 22:10:11,907 INFO org.apache.hadoop.nfs.nfs3.IdUserGroup: Not doing static UID/GID mapping because ‘/etc/nfs.map’ does not exist. Now, I
Read more

What’s the difference between Reliability, Durability, and Availability for data storage system?

Posted on

Some important concepts in distributed system like Hadoop distributed file system, Google file system and so on. Answer from http://www.quora.com/Whats-the-difference-between-Reliability-Durability-and-Availability-for-data-storage-system The difference between durability and availability is fairly simple. Durability is about what happens when all power goes out everywhere. Has all data been written to stable storage that doesn’t require power (e.g. disk/flash), in
Read more

How to monitor temperatures of laptop on Linux

Posted on

How to monitor temperatures of laptop on Linux? This works on Linux Mint: sudo aptitude install lm-sensors hddtemp For lm-sensors, first detect the sensors by: sudo sensors-detect To detect the temperature in the system: sudo sensors To detect the HDD (e.g. sda) temperature: sudo hddtemp /dev/sda An example of the output: [zma@mini:~]$ sudo sensors acpitz-virtual-0
Read more

How to install no-ip update client on Linux Mint?

Posted on

How to install no-ip.com update client noip2 on Linux Mint 17? First, install the noip2 client: sudo su – cd /usr/local/src wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz tar xzf noip-duc-linux.tar.gz cd no-ip-2.1.9-1 make make install Then, generate the configuration file noip2 -C Last, make noip2 daemon run at reboot crontab -e Add this line to crontab: @reboot /usr/local/bin/noip2 I’ve
Read more

How to import a googlecode git project to github project

Posted on

I wanna migrate leveldb (code.google.com/p/leveldb) to my github repository. Create a new repo on github.com with this link https://help.github.com/articles/creating-a-new-repository git clone https://code.google.com/p/ project-name.git Set the remote origin url as follows: git remote set-url origin https://github.com/ username/ repo-name.git git pull to pull the latest. git push origin master after making local changes. This is the original
Read more

How to adjust the system partition (C:) size of Windows?

Posted on

The disk management tools of Windows can adjust it to some level. But there are more space available as far as I can tell. How to further adjust the system partition (C:) size of Windows? You may check these tools: EASEUS Partition Master (free) Includes Partition Manager, Disk & Partition Copy Wizard and Partition Recovery
Read more

Filter away non-printable ASCII characters on Linux?

Posted on

Sometimes the commands’ output have some non-printable ASCII characters. How to filter away these non-printable ASCII characters on Linux? You can consider the problem as “how to leave only printable ascii characters?”. The printable characters in ASCII table are: Octal 011: Tab Octal 012: Line Feed Octal 015: Carriage Return Octal 040 to 176: printable
Read more

How to calculate the average of value in lines of a text file on Linux by a script?

Posted on

How to calculate the average of value in lines of a text file on Linux by a script? The file.txt is like: Run 0: Time used: 22.235331711 seconds. Run 1: Time used: 20.784491219 seconds. Run 2: Time used: 21.851638876 seconds. What I want it to calculate the average time. awk is handy for this purpose:
Read more

How to install multiple versions of sbt on my Linux host?

Posted on

How to install multiple versions of sbt on my Linux host For example, some projects use 0.12.x while some use 0.13.x. Installing neither in the system only is not sufficient enough. You may use the excellent sbt-extras: https://github.com/paulp/sbt-extras Most of the time, it detects the version of sbt needed in the project direoctory automatically: [zma@office
Read more

How to package a Scala project to a .jar with sbt?

Posted on

How to package a Scala project to a .jar file with sbt? Manually packaging the .class files are fine but too tedious. A jar of just the project classes The command: sbt package will produces the main artifact as a jar into target/scala-2.x.y/project_name_2.x.y-zz.jar. Continuously building the package: sbt ~package Standalone jar with all dependencies If
Read more