西维蜀黍

【Linux】设置时区

View Timezone

$ timedatectl
                      Local time: Wed 2019-01-23 22:45:47 UTC
                  Universal time: Wed 2019-01-23 22:45:47 UTC
                        RTC time: Wed 2019-01-23 22:45:48
                       Time zone: Etc/UTC (UTC, +0000)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

The system timezone is configured by symlinking /etc/localtime to a binary timezone identifier in the /usr/share/zoneinfo directory.

ls -l /etc/localtimeCopy
lrwxrwxrwx 1 root root 27 Dec 10 12:59 /etc/localtime -> /usr/share/zoneinfo/Etc/UTC
  ...


【Linux】systemctl

systemd

systemd is an init system and system manager that has widely become the new standard for Linux distributions. Due to its heavy adoption, familiarizing yourself with systemd is well worth the trouble, as it will make administering servers considerably easier. Learning about and using the tools and daemons that comprise systemd will help you better appreciate the power, flexibility, and capabilities it provides, or at least help you to do your job with less hassle.

In this guide, we will be discussing the systemctl command, which is the central management tool for controlling the init system. We will cover how to manage services, check statuses, change system states, and work with the configuration files.

  ...


【WMware】EXSi - 网卡直通 (Passthrough)

网卡直通(Passthrough)

如果以这样的顺序添加网卡,进入openwrt后

  • 0000:03:00:0 则为 openwrt中的eth0
  • 0000:02:00:0 为 openwrt中的eth1
  ...


【WMware】EXSi - 硬盘直通

RDM 硬盘直通

找到要挂载到的 DataStroe的路径

  ...


【WMware】EXSi - 增加第三方网卡驱动

USB3.0 网卡

ESXi-Customizer-PS

因为我用的是USB3.0 网卡,所以需要下载相关驱动,否则会出现 No network adapters were detected 的错误。

Use https://github.com/VFrontDe/ESXi-Customizer-PS

  ...


【WMware】EXSi - Troubleshooting

VMFS Volume is locked

Ref

  ...


【OpenWrt】运行在ESXi中的OpenWrt增加硬盘容量

Knowledge

Partition layout

The x86 image is using the following partition layout (as seen from inside of the device):

  1. /dev/sda1 is a 16MB ext4 /boot partition where GRUB and the kernel are stored.
  2. /dev/sda2 is a 256MB partition containing the squashfs root filesystem and a read-write f2fs filesystem OR the ext4 root filesystem (depending on what image you have chosen).

Any additional space in the device is unallocated.

  ...


【OpenWrt】维护

Install

Ref

常用软件

$ opkg install vim curl git htop wget iperf3 tcpdump fdisk unzip git make gcc tar diffutils grep wget python3 bind-dig scapy losetup luci-app-hd-idle block-mount kmod-fs-ext4 kmod-usb-storage resize2fs cfdisk vim e2fsprogs fdisk kmod-usb-core block-mount kmod-fs-ext4 kmod-usb-storage-extras e2fsprogs blkid parted losetup

Golang

// TODO

  ...


【OpenWrt】包管理

# Install a package:
$ opkg install package

# Remove a package:
$ opkg remove package

# Update the list of available packages:
$ opkg update

# Upgrade all the installed packages:
$ opkg upgrade

# Upgrade one or more specific package(s):
$ opkg upgrade package(s)

# Display information for a specific package:
$ opkg info package

# List all the available packages:
$ opkg list
  ...


【OpenWrt】安全性设置

SSH

打开 系统 -> 管理权 -> SSH访问

  • 指定监听接口为 lan 仅可内网访问。
  • 修改默认端口为其他端口,如30001等非常用端口。
  • 不允许密码验证
  • 不允许 root 用户凭密码登录
  ...