Systemd service unit files

Systemd service unit files are configuration files used by the systemd system and service manager in Linux systems. systemd acts as an init system and service manager, responsible for bootstrapping the user space and managing system processes after booting. Each service unit file represents a service and contains instructions and configurations for starting, stopping, and managing the service.

These unit files typically have a .service extension and are located in directories such as /etc/systemd/system/, /run/systemd/system/, or /lib/systemd/system/, representing system-specific, runtime, and default service unit files, respectively.

A service unit file includes several sections, most notably:

  • The [Unit] section, which describes the service with documentation and its dependencies.
  • The [Service] section, which specifies the commands to start and stop the service and the behavior of the service.
  • The [Install] section, which defines how the unit is installed (i.e., how the service should be automatically started at boot time).

By editing these unit files, system administrators can control the services on the system with precision.

用新電腦首先要做什麼

  1. 安裝telegram
  2. 下載無蝦米
  3. 下載Git
  4. 下載jetbrains要用到的軟體
  5. 下載cmder
  6. 安裝NVM
  7. webstorm改成用bash
    settings 選terminal,再shell path打:”D:\Program Files\Git\bin\sh.exe” -login -i
    (看GIT資料夾放在哪裡)
  8. 安裝Line
  9. 設定鍵盤中英切換的快捷鍵,我發現我初始竟然是Shift…找很久發現是無蝦米的設定
加了一個英文鍵盤,先這樣設定試試

Linux tutorial

Learning Linux involves understanding various components that range from basic commands to system administration and networking. Here’s a structured outline to guide your learning journey:

1. Basics of Linux

  • Introduction to Linux: History, distributions, philosophy.
  • Getting Started: Installation of Linux (dual boot or virtual machine), introduction to the GUI and command line interface.

2. Command Line Basics

  • Basic Commands: Navigating the file system (cd, ls, pwd), file operations (cp, mv, rm, touch), viewing and editing files (cat, nano, vi).
  • File System Structure: Understanding the Linux file system hierarchy.
  • Permissions and Ownership: Managing file permissions and ownership (chmod, chown).

3. System Administration

  • User and Group Management: Adding/removing users, managing groups (useradd, usermod, groupadd).
  • Package Management: Installing, updating, and removing software using package managers like apt, yum, or dnf.
  • System Monitoring and Processes: Monitoring system resources (top, htop), managing processes (ps, kill, jobs, bg, fg).
  • System Services and Daemons: Managing services with systemd (systemctl start, stop, enable, disable).
  • System Logs: Understanding and monitoring system logs (/var/log, journalctl).

4. Shell Scripting

  • Basics of Shell Scripting: Writing simple scripts, variables, control structures (if-else, loops).
  • Advanced Scripting: Functions, arguments, script debugging.

5. Networking

  • Basic Networking Commands: ifconfig, ping, ssh, scp, netstat.
  • Firewall Management: Basics of iptables and firewalld.
  • Network File System (NFS) and SSH Filesystem (SSHFS): Setting up file sharing and remote file systems.

6. Advanced Topics

  • Disk Management: Partitioning, file systems creation, and mounting (fdisk, mkfs, mount).
  • Backup and Recovery: Tools and strategies for data backup and recovery.
  • Virtualization: Introduction to virtualization technologies like KVM, VirtualBox.
  • Containerization: Basics of Docker and container management.
  • Security: Basic security practices, secure shell (SSH) setup, basic firewall setup.

7. Learning Resources

  • Online Tutorials and Courses: Websites like Linux Academy, Coursera, and edX offer courses ranging from beginner to advanced levels.
  • Books: “The Linux Command Line” by William Shotts, “How Linux Works” by Brian Ward.
  • Community and Documentation: Engaging with the Linux community through forums like Stack Overflow, Reddit, and reading official documentation of Linux distributions.

This outline should help you systematically approach learning Linux, from understanding its basics to mastering advanced system administration tasks. Remember, the best way to learn is by doing, so try to practice each topic by setting up your own Linux environment to experiment in.

Understanding JavaScript Closures: A Simple Explanation


In JavaScript, a closure is a feature where an inner function has access to variables from an outer function even after the outer function has finished executing. This happens because the inner function ‘remembers’ the environment in which it was created.

Here’s a simple way to understand it:

  1. Outer Function: You have an outer function that defines some variables.
  2. Inner Function: Inside this outer function, you create an inner function. This inner function can use the variables defined in the outer function.
  3. Closure: Even after the outer function has finished executing and its scope is gone, the inner function still has access to those variables. This persistent access to the variables of the outer function is what we call a closure.

It’s like having a backpack. When you leave your house (the outer function), you take things (variables) with you in your backpack. Throughout the day (even after you’ve left your house), you can still use everything you put in your backpack. That backpack and its contents are your closure in the outside world.