Although I used to be an RA at CUHK, it still cost me nearly two weeks to setup everything on my desktop. Here is the recording.

## Why Gentoo?

I have used Arch Linux on my laptop for more than 2 years. Arch Linux is a perfect Linux distros, except its stability, which always leads to annoying problems. Even now when I try to shutdown my laptop, the screen will freeze so I have to hold the power button to force a shutdown.
Gentoo, on the contrary, is a great choice for me. Moreover, my office has 24h electricity supply; my desktop has a powerful 4-core Xeon CPU. Anyway, long-time compilation is acceptable.

## Choose the right installation medium

The official Minimal CDs are incapable of booting in UEFI mode. They boot in BIOS (MBR) mode only. If you want to make your system UEFI bootable, you must download the Hybrid ISO (LiveDVD).
For me, another advantage of using LiveDVD is that it contains many nice wallpapers.

## Network configuration

Every desktop in CSE department uses static IP address. However, the Gentoo Installation Guide doesn’t provide enough information about the configuration for static addresses. A useful document is here: Gentoo Linux x86 Handbook: Network configuration

## Proxy configuration

According to ANSR Lab Wiki, I can get access to the Internet. But I can’t use ping, ssh, ftp and git clone over ssh protocol.
As far as I know, all of these problems are unresolvable. However, we can use this command to rewrite the default protocol of Github:

And set the proxy of git:

UPDATE on Jan 17, 2018: Actually we can use git clone through ssh, just add the following configurations to the file ~/.ssh/config.

The nc command must be OpenBSD version, otherwise you will get an error message like this:

## Printer configuration

The printer in my office is a Windows printer via SAMBA, so the first thing is to install samba and the HP printer driver hplip.
For Arch Linux and Gentoo, you can install system-config-printer. Its GUI is similar to System Settings -> Printers on Ubuntu.
If you don’t set your search domain, the printer address should be smb://NTSVR6.cse.cuhk.edu.hk/lp120. Or you can set your search domain by adding the following line in /etc/resolv.conf

## Unix access

You can use ssh to connect to the Unix/Linux servers in CSE department. For example:

To change your password, use yppasswd command. Somehow, I can’t change my password on linux1 with the following error:

Jack Lee told me to try solar1 and problem solved.

## Personal website

After you connect to a Unix/Linux server, create a directory named www in your home directory. Now you can upload your personal website in it. Note that you need to set permission at least 755:

## Use WiFi on my desktop

As I mentioned above, many ports have been disabled by our department. Therefore, I can’t use ssh, ftp and so on. It’s very disgusting, you will find yourself be magically blocked from time to time.
Luckily, I have a 360 WiFi version 2, a wireless USB adapter. Current Linux kernel (4.9.34) contains its driver. You can find it at /sys/module/mt7601u/.

By default, Gentoo uses netifrc to control network interfaces, but I can’t utilize it for both Ethernet and WiFi because they have different DNS, search domain, etc. So I installed networkmanager and nm-applet to manage them. Don’t forget to remove existing netifrc scripts from controlling network interfaces, see the wiki
Note that when you use WiFi, you need to disable your proxy settings: