Skip to content

Instantly share code, notes, and snippets.

@wklchris
Last active March 21, 2020 13:10
Show Gist options
  • Save wklchris/42ba78692b9449216d1a6e7e2201f66f to your computer and use it in GitHub Desktop.
Save wklchris/42ba78692b9449216d1a6e7e2201f66f to your computer and use it in GitHub Desktop.
Linux Usage.

Bash commands are largely different from DOS/PowerShell ones.

Create Folder Shortcuts / 为文件夹创建快捷方式

Actually create a soft link, use command ln with arg -s.

$ sudo ln -s /path/to/the/target/folder ~/Desktop/shortcutname

Manjaro Installation

The manjaro (I choosed KDE version) can be burnt into a portable disk using Rufus. After clicking the button, Rufus will ask if it uses DD modes or not. Please select the DD mode.

I installed the manjaro on a SSD+HDD machine. After entering the live desktop, you may prepare something before launching the installer:

  1. Check if you can use the KDE Partition manager. By clicking the icon from the start menu, you may meet a non-admin warning. This is an error from the upstream (KDE side) when I was installing. If it is not fixed yet, you can try sudo partitionmanager. The worst case is that this sudo command doesn't help either, then you need to install gparted.
  2. If KDE partition manager doesn't work, open terminal (e.g. F12) and install gparted: sudo pacman -Sy gparted. Run it by sudo gparted.
  3. Use the KDE partition manager (or gparted) to construct partitions manually. In most cases, you don't need to do so. I planned to do this since I want to move my /home dir to the HDD while keep other dirs on the SSD.
  • First, delete all partitions and save. Create a new partition table and select GPT (GUID).
  • On SSD, create two partitions:
    1. A ~500 MB EFI booting partition. The format should be FAT32. Label it as UEFI or anything you want.
    2. All the rest as an ext4-format partition. This is reserved from / mounting point (i.e. root). I labeled it as Manjaro.
  • On HDD, also create two partitions:
    1. A partition whose size of 0~1 times your installed RAM storage as swap. The format should be linux-swap. Usually we put it at the end of the disk.
    2. All the rest as an ext4-format partition, as /home later. This is because apps will be installed under it, so my small SSD can't handle them.
  • Save the partition table.
  • Remember to right click on the EFI partition and set flags for it. It should have flag boot and esp.
  1. Run the Manjaro installer. Let the installer automatically partition the disk if you didn't manually do that in partition manager or gparted. Normally we only need to specify EFI and root partition. If you manually partitioned the disk, you need to set the mount points for all previous partitions (except the SWAP partition) in this step.
  2. Click on Next and begin the installation.

本文介绍实用的 Ubuntu 命令。

返回本机的 ip 地址

hostname -I

检查服务是否正常运行

最简单的:service <service-name> status,下面是一个正常运行中的 xrdp 服务:

wu@DC-Lab:~$ service xrdp status
● xrdp.service - xrdp daemon
   Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-02-24 20:29:52 PST; 11min ago
     Docs: man:xrdp(8)
           man:xrdp.ini(5)
  Process: 8505 ExecStop=/usr/sbin/xrdp $XRDP_OPTIONS --kill (code=exited, status=0/SUCCESS)
  Process: 8517 ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS (code=exited, status=0/SUCCESS)
  Process: 8509 ExecStartPre=/bin/sh /usr/share/xrdp/socksetup (code=exited, status=0/SUCCESS)
 Main PID: 8518 (xrdp)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/xrdp.service
           └─8518 /usr/sbin/xrdp

如果要进一步展示日志,比如检查 xrdp 服务为什么不能正常工作,请使用 sudo systemctl status xrdp。注意看下面列出的提示信息中带有“Error”的行(一般会标为红色)。

wu@DC-Lab:~$ sudo systemctl status xrdp
    ● xrdp.service - xrdp daemon
   Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-02-24 20:22:57 PST; 1min 32s ago
     Docs: ...

... xrdp[3289]: (3289)(139896572966720)[ERROR] Cannot read private key file /etc/xrdp/key.pem: Permission denied

Safely remove USB disk / 安全地移除 USB 设备

The normal way is to right click on the disk shown in the file explorer, then choose remove (NOT unmount!).

If the remove option is grey (i.e. unclickable), try steps as follows:

  1. Click unmount instead.
  2. Open terminal, enter gnome-disk. On the pop-up window, select the disk your want to remove, and click power off from the upper-right hamburg menu. You should see notification saying that the USB disk is disconnected.
  3. After the disk is powered off, disconnect it from the USB port.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment