Install TOSHIBA eStudio 4540c printer on CentOS 6 Linux

  1. Download CUPS driver from Toshiba web site:
  2. Extract and install the driver (as root/sudo):
    cp eBX_CUPS_Colour_V7.13/normal/TOSHIBA_ColorMFP_CUPS.tar /tmp/
    rm -fr eBX_CUPS_Colour_V7.13
    cd /; sudo tar -xvf /tmp/TOSHIBA_ColorMFP_CUPS.tar
  3. Extract and rename the ppd file:
    cp /usr/share/cups/model/Toshiba/TOSHIBA_ColorMFP_CUPS.gz ~/Downloads
    cd ~/Downloads; gunzip ~/Downloads/TOSHIBA_ColorMFP_CUPS.gz; mv ~/Downloads/TOSHIBA_ColorMFP_CUPS ~/Downloads/TOSHIBA_ColorMFP_CUPS.ppd
  4. Install system-config-printer (if not installed yet):
    sudo yum install system-config-printer
  5. Go to system menu: System -> Administration -> Printing, then New Printer
  6. Select Network Printer, then LPD/LPR Host or Printer, type your printer host/ip address then click Probe button, when the Queue is detected, click Forward button.
  7. Select Provide PPD file and select the PPD file:
  8. Select the TOSHIBA_ColorMFP_CUPS.ppd file:
  9. Click Forward button to proceed:
  10. Set Model Selection to TOSHIBA e-STUDIO4540CSeries and click Forward:
  11. Set Printer name, description and location information, and click Apply button:

How to enable Department Code?

  1. Open http://localhost:631/printers in your web browser
  2. Click to select the Toshiba eStudio 4540c printer
  3. Select Maintenance and then Set Default Options
  4. Click Printing Modes

    then enable Department Code:
  5. Click Printing Modes DC then set the Department Code (DC) digits, and finally cick Set Default Options to save.

Setup HTTP proxy in Eclipse

  • Window (on Mac OS, Eclipse) -> Preferences -> General -> Network connections
  • Change Active Provider to Manual and set the proxies like below:

yum: list packages installed from specific repository

sudo yum list installed | grep repo-name

Install shutter screen capture tool on CentOS 6

Shutter is considered the best screen capture tool for Linux. To install it on CentOS:
  • Enable epel repository
  • Enable nux-desktop repository:
    sudo rpm -Uvh$(uname -m)/nux-dextop-release-0-1.el6.nux.noarch.rpm
  • Install shutter:
    sudo yum install shutter

Enable EPEL repository on CentOS 6

  • Install epel-release repository:
    sudo rpm -Uvh$(uname -m)/epel-release-6-8.noarch.rpm
    After installation, you should be able to see it in the repository list:
    sudo yum repolist
  • (According to this) Install Priorities:
    sudo yum install yum-plugin-priorities
  • Set the priorities of epel to 50 (low priority) (see how to set repository priorities)
    sudo vi /etc/yum.repos.d/epel.repo

Install file-roller archive manager on CentOS 6

If file-roler archive manager is not installed, you won't be able open/extract zip/tar archives in your file manager. Run the following command to install file-roller archive manager:
sudo yum install file-roller
After installation, you can right click an archive then select Archive Manager to open it.

Install gnome-screenshot on CentOS 6

The screen capture utility gnome-screenshot is now loaded by default. It is included in the package gnome-utils, run the following command to install it:
sudo yum install gnome-utils

Compile and install Keepassx on CentOS 6

  • Install the required packages for compiling keepassx:
    sudo yum groupinstall "Development Tools"
    sudo yum install qt qt-devel libXi-devel libXtst-devel gcc gcc-c++
  • Download the source code from
  • Extract the source code:
    tar zxvf keepassx-0.4.3.tar.gz
  • Compile the source code, and install it (as root) to /usr/local:
    cd keepassx-0.4.3
    qmake-qt4 PREFIX=/usr/local
    sudo make install
  • To start KeepassX: type keepassx in a Terminal window. Or go to system menu: Applications -> Accessories -> KeePassX

Enable RPMForge Repository on CentOS 6

  1. Import the key of the RPMForge repository:
    sudo rpm --import
  2. Download the repository RPM:
    wget$(uname -m).rpm
  3. Verify the downloaded RPM package:
    rpm -K rpmforge-release-0.5.3-1.el6.rf.$(uname -m).rpm
  4. Install the RPM package:
    sudo rpm -i rpmforge-release-0.5.3-1.el6.rf.$(uname -m).rpm

Calculus 1 in 20 minutes (微积分)

Mount a FAT 32 partition writable on Linux

  • Edit /etc/fstab and add the following line:
    /dev/hda5    /win32data   vfat   rw,noatime,uid=500,gid=500,user   0 0
    where /dev/hda5 is the FAT32 partition, and uid=500,gid=500 will make the user(uid=500) be the owner of the mounted partition.

How to change MAC address on CentOS Linux

  1. Edit /etc/sysconfig/network-scripts/ifcfg-eth0,
    sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
    and add the MAC address in the following format:
  2. Restart the network:
    sudo service network restart


The above assumes you want to change ethernet interface eth0. You need to change the interface name if it is not eth0. (e.g. eth1)

If /etc/sysconfig/network-scripts/ifcfg-eth0 does not exist, you may need to create one. Here is an example:
or if use dhcp:

Check the gateway address on Linux

  • Method 1:
    netstat -nr
  • Method 2:
    route -nee
  • Method 3:
    ip route show

Install DropBox on CentOS Linux

If your computer has direct internet connection

  1. Download the rpms for Fedora from
    • 32 bit:
      wget -c
    • 64 bit:
      wget -c
  2. Install the rpm:
    sudo rpm -Uvh nautilus-dropbox-1.6.0-1.fedora.*.rpm
  3. Select Applications->Internet->DropBox from the system menu to download and install dropbox.
  4. Fix the yum repository error. Installing the rpm above will, however, cause the yum update fail:
    $ sudo yum update
    Loaded plugins: fastestmirror, refresh-packagekit, security
    Loading mirror speeds from cached hostfile
     * base:
     * extras:
     * updates: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: Dropbox. Please verify its path and try again

    To fix the error:
    sudo vim /etc/yum.repos.d/dropbox.repo
      name=Dropbox Repository

If you computer is behind proxy or firewall

You need to download and install DropBox via Command Line:
  1. Download and extract DropBox into your home directory:
    • 32 bit:
      cd ~ && wget -O - "" | tar xzf -
    • 64 bit:
      cd ~ && wget -O - "" | tar xzf -
  2. Run the Dropbox daemon from the newly created .dropbox-dist folder.
    ~/.dropbox-dist/dropboxd &

Install Skype on CentOS

Windows 7/8: how to configure windows update via http proxy

I. Set the proxy

  • Run Command Prompt as Administrator, and type the following command:
    netsh winhttp set proxy
    or the following command to import the proxy settings from Internet Explorer settings:
    netsh winhttp import proxy source=ie

II. Show current proxy settings

  • Run Command Prompt as Administrator, and type the following command:
    netsh winhttp show proxy

III. Reset the proxy

  • Run Command Prompt as Administrator, and type the following command:
    netsh winhttp reset proxy

clear/unset all aliases in Unix/Linux

  • Unset alias foo:
    unalias foo
  • Clear all aliases:
    unalias -a

GWT 2.5.0: gwtc failed: java.lang.RuntimeException: Unexpected IOException on in-memory stream

Got following error when compiling a GWT project using GWT 2.5.0:
[INFO]    [ERROR] Unexpected internal compiler error
[INFO] java.lang.RuntimeException: Unexpected IOException on in-memory stream
[INFO]  at
Work around is remove gwt-unitCache folder.