西维蜀黍

【Linux】Segmentation Fault

Segmentation Fault

In computing, a segmentation fault (often shortened to segfault) or access violation is a fault, or failure condition, raised by hardware with memory protection, notifying an operating system (OS) the software has attempted to access a restricted area of memory (a memory access violation). On standard x86 computers, this is a form of general protection fault. The OS kernel will, in response, usually perform some corrective action, generally passing the fault on to the offending process by sending the process a signal. Processes can in some cases install a custom signal handler, allowing them to recover on their own, but otherwise the OS default signal handler is used, generally causing abnormal termination of the process (a program crash), and sometimes a core dump.

  ...


【Linux】用户及用户组管理

Background

查看当前用户

$ whoami

用户和密码

在 linux 系统中,所创建的用户帐号和其相关信息 (密码除外) 均是存放在 /etc/passwd 配置文件中。

由于所有用户对 passwd 文件均有读取的权限,因此密码信息并未保存在该文件中,而是保存在了 /etc/shadow 的配置文件中(将原密码采用 MD5 加密后存储)。

  ...


【Linux】命令 - ps(查看进程信息)

linux上进程有5种状态:

  • 运行(正在运行或在运行队列中等待)
  • 中断(休眠中, 受阻, 在等待某个条件的形成或接受到信号)
  • 不可中断(收到信号不唤醒和不可运行, 进程必须等待直到有中断发生)
  • 僵死(进程已终止, 但进程描述符存在, 直到父进程调用wait4()系统调用后释放)
  • 停止(进程收到SIGSTOP, SIGSTP, SIGTIN, SIGTOU信号后停止运行运行)

ps工具标识进程的5种状态码:

  • D 不可中断 uninterruptible sleep (usually IO)
  • R 运行 runnable (on run queue)
  • S 中断 sleeping
  • T 停止 traced or stopped
  • Z 僵死 a defunct (”zombie”) process

ps

In most Unix and Unix-like operating systems, the ps program (short for “process status”) displays the currently-running processes. A related Unix utility named top provides a real-time view of the running processes.

  ...


【Linux】命令 - ifconfig

SYNOPSIS

$ ifconfig [-v] [-a] [-s] [interface]
$ ifconfig [-v] interface [aftype] options | address ...
  ...


【Linux】网络管理

相关command

  • ifup
  • ifdown
  • netstat
  • route
  • ip
  ...


【FreeBSD】读取CPU 温度

View

$ sysctl -a | grep temperature
hw.acpi.thermal.tz1.temperature: 29.9C
hw.acpi.thermal.tz0.temperature: 27.9C
dev.cpu.7.temperature: 39.0C
dev.cpu.6.temperature: 39.0C
dev.cpu.5.temperature: 42.0C
dev.cpu.4.temperature: 42.0C
dev.cpu.3.temperature: 49.0C
dev.cpu.2.temperature: 49.0C
dev.cpu.1.temperature: 46.0C
dev.cpu.0.temperature: 46.0C
  ...


【FreeBSD】压力测试

stress

It is a simple workload generator for POSIX systems. It imposes a configurable amount of CPU, memory, I/O, and disk stress on the system. It is written in C, and is free software licensed under the GPLv2. It is not a benchmark, but is rather a tool designed

  ...


【FreeBSD】资源使用查看

View Network Traffic

# Network Throughput
$ systat -ifs
                    /0   /1   /2   /3   /4   /5   /6   /7   /8   /9   /10
     Load Average   ||

      Interface           Traffic               Peak                Total
            lo0  in      0.391 KB/s          0.391 KB/s          341.838 KB
                 out     0.391 KB/s          0.391 KB/s          341.838 KB

            aq0  in    117.038 MB/s        117.038 MB/s           10.210 GB
                 out     2.935 MB/s          2.935 MB/s          261.974 MB
  ...


【FreeBSD】网络管理

netstart

SYNOPSIS

$ /etc/netstart	[[-n] interface ...]

DESCRIPTION

netstart is the command script that is invoked by rc(8) during an automatic reboot and after single-user mode is exited; it performs network initialization.

The netstart script can also be used to start newly created bridges or interfaces, or reset existing interfaces to their default state. The behaviour of this script is (or can be) controlled to some extent by variables defined in rc.conf(8), which specifies which daemons and services are to be run.

  ...


【FreeBSD】包管理

Packages and Ports: Adding Software in FreeBSD

FreeBSD provides two methods for installing applications: binary packages and compiled ports. Each method has its own benefits:

Binary Packages

  • Faster installation as compared to compiling large applications.
  • Does not require an understanding of how to compile software.
  • No need to install a compiler.
  ...