How to Change Open Files Limit on OS X and macOS

To check the current limits on your Mac OS X system, run:

$ launchctl limit maxfiles

The last two columns are the soft and hard limits, respectively.

Adjusting Open File Limits

To adjust open files limits on a system-wide basis, you must create a configuration file. It is a property list (aka plist) file in /Library/LaunchDaemons/limit.maxfiles.plist that contains the following XML configuration:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
    <key>Label</key>
    <string>limit.maxfiles</string>
    <key>ProgramArguments</key>
    <array>
      <string>launchctl</string>
      <string>limit</string>
      <string>maxfiles</string>
      <string>200000</string>
      <string>200000</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>ServiceIPC</key>
    <false/>
  </dict>
</plist>

This will set the open files limit to 200000. The file must be owned by root:wheel and have permissions -rw-r–r–. This permissions should be in place by default, but you can ensure that they are in place by running:

$ sudo chmod 644 /Library/LaunchDaemons/limit.maxfiles.plist

Configure NGINX as RMTP server on FreeBSD 12

Unfortunately the Nginx package for FreeBSD does not contain the RTMP module, so you need to compile it either from upstream sources or use the FreeBSD ports and enable the RTMP module before compiling:

# portsnap auto
# cd /usr/ports/www/nginx
# make config
# make
# make install

now create a new file name rtmp.conf in /usr/local/etc/nginx using your favorite editor, i use neovim:

# cd /usr/local/etc/nginx
# nvim rtmp.conf

now paste following code to rtmp.conf:

rtmp {
    server {
        listen 1935;
        chunk_size 4096;
        application hlslive {
            live on;
            hls on;
            hls_path /usr/local/www/nginx-dist/hlslive;
            hls_fragment 3s;
            hls_playlist_length 18s;
        }
    }
}

save it and open nginx.conf and add the following:

load_module /usr/local/libexec/nginx/ngx_rtmp_module.so;  # <-- must be loaded at the top of the file
include rtmp.conf; # <-- can be at the end of the file

check if the config is valid:

# nginx -t

if valid you can start your Nginx/RTMP server and send the first RTMP to it.

Configure Windows Server to query an external NTP Server

This is generally performed on DCs in an Active Directory domain. Then all workstations use AD to get time from the DCs. This could also be used on a non-DC windows machine to be your NTP server for your network that you point to for all of your switches/routers and various other devices.

First, open PowerShell and stop the Windows Time Service:

> net stop w32time

then set the used NTP servers using

> w32tm /config /syncfromflags:manual /manualpeerlist:"0.us.pool.ntp.org,1.us.pool.ntp.org,2.us.pool.ntp.org,3.us.pool.ntp.org"

(get the best servers for your region from https://www.ntppool.org)

mark the servers as reliable with

> w32tm /config /reliable:yes

and last, start the service again.

> net start w32time

You can check the configuration by using following commands:

> w32tm /query /configuration
> w32tm /query /status