西维蜀黍

【FreeBSD】搭建DHCP服务器

  ...


【Hackintosh】macOS 下制作 OpenCore 引导 U 盘

制作 OpenCore 引导 U 盘

Setting up the installer

Now we’ll be formatting the USB to prep for OpenCore. We’ll want to use macOS Extended (HFS+) with a GUID partition map. This will create two partitions: the main MyVolume and a second called EFI which is used as a boot partition where your firmware will check for boot files.

  • Note: By default, Disk Utility only shows partitions – press Cmd/Win+2 to show all devices (alternatively you can press the View button)

  ...


【macOS】Alfred 效率

快捷键

  ...


【TrueNAS】使用 Node Exporter(Grafana)监控 TrueNAS

Situation

我们都知道,如果你知道在 TrueNAS OS 中通过 pkg 来安装软件,会得到下面的错误:

$ pkg install git
Updating local repository catalogue...
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
repository local has no meta file, using default settings
pkg: file:///usr/ports/packages/packagesite.txz: No such file or directory
Unable to update repository local
Error updating repositories!

事实上,官方 doc 中有明确说到:我们不应该在 TrueNAS OS 中安装你想安装的软件,而是把这些软件安装在 Jail 里面。

问题来了,如果我想使用 Node Exporter 监控 TrueNAS 宿主机。

(实在是看不习惯 TrueNAS 自带的监控)

那么如果我把 Node Exporter 安装在 Jail instance里面,那么自然监控的是 Jail 本身,而不是 TrueNAS 宿主机。

  ...


【Linux】Shell - 判断当前操作系统

#!/usr/bin/env bash

if [ "$(uname)" == "Darwin" ]; then
    # Do something under Mac OS X platform        
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
    # Do something under GNU/Linux platform
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
    # Do something under 32 bits Windows NT platform
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
    # Do something under 64 bits Windows NT platform
fi
  ...