Sunday, February 28, 2016

Extract a .tar.bz2 file

Use tar can unzip a .tar.bz2 file. Run

sudo tar -xjvf VESTA-x86_64.tar.bz2

Here sudo is required, or it doesn't work well.

Saturday, February 27, 2016

Ubuntu reconnect wireless network

Sometimes Ubuntu loses the wireless internet connection, and never(greater than the time you can wait) gets it back. Restart the wireless scan can solve it. Run:
sudo service network-manager restart

ifort command not found

After install Intel FORTRAN on Ubuntu, compiling fortran source code gives:


ifort: command not found
This is because the current user doesn't have correct environment variables. Run

source /opt/intel/compilers_and_libraries_2016.2.181/linux/bin/ifortvars.sh intel64
or add this line to the .bashrc file at home directory.

Direction keys and Sogou Pinyin malfunction in Vi for Ubuntu

When use Vi edit some file, the direction keys, up, down, left and right, enter a character, instead of direction. Besides of this, Sogou Pinyin does't work for Vi as well. In this case,  edit your .vimrc file under home directory and add:

set nocompatible

The problem will be solved.

Thursday, November 12, 2015

Paste stuff in system's clipboard to vi when using putty

Sometimes one wanna copy and paste something to a file opened in Vi from a webpage or a pdf file when using putty. This can be done as the following.
First, copy your stuff to the system's clipboard.
Then, go to putty and set the file to edit mode by pressing key i.
Finally, press Shift and Insert keys at the same time. Those in system's clipboard would be pasted to the file opened in Vi editor.

Monday, August 17, 2015

Change a Network Printer from Offline to Online

Sometimes, a network printer shows offline on a computer (Windows operating system) while it is fine on another computer. This is because the port used for the printer doesn't work right. A possible reason is that the port may use SNMP message to check the status of the printer while the printer doesn't respond to it correctly. A solution to this problem is to disable this setting for that port. However, one may find out that the port configuration doesn't work either, like below,
Here I'll give a simple way to fix this problem. Go to Devices and Printers, right-click on the printer in the Printers window, choose Printer Properties menu. On the Printer Properties window, go to Ports tab. Click the Add Port button. A Printer Ports window is popped up. Select "Standard TCP/IP Port" from the "Available port types", then click New Port button
A Printer Port Wizard is shown. Follow the Wizard, and fill the IP address for the Network Printer, then the Wizard will automatically search the printer on the given address. When the Wizard find the printer and commutes with it right, the Wizard finish and a new port is created for the Pinter.

After the Wizard is finished, one will be redirected to the Printer Properties window and the new port is chosen for the Printer. Click the Configure Port. Uncheck the SNMP Status Enabled setting at the bottom of the Configure Standard TCP/IP Monitor. Close the Printer Properties window. The Printer will be back online immediately.


Wednesday, May 13, 2015

Irrecognizable Code when Using Adobe Pdf Printer

When use Adobe pdf printer to print something to a pdf file, it may end in a log file, which shows printing error, or a file with irrecognizable code. This happens when one use an English version windows. A possible reason is that one may change the "Current language for non-Unicode program" to non-English. To solve this problem, one doesn't have to change this setting back to English. Instead, one can uncheck one of settings in Printing Preferences.
  1. When print, choose Adobe pdf printer. Then click the properties button.

  2. The Printing Preferences is popup. Go to "Adobe PDF Settings" tab, and uncheck the setting "Rely on system fonts only; do not use document fonts". Then everything would print OK.