Documentation hacks to support your local

Documentation hacks to support your local
  • Dotfiles,
  • scripts,
  • plaintext sources etc

Simple rules :

  1. Uncommented text is code,
  2. #comments are paragraphs, <p>

Example 1

/etc/dhcpcd.conf

# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
#hostname

# Use the hardware address of the interface for the Client ID.
#clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
duid

# Persist interface configuration when dhcpcd exits.
persistent

# vendorclassid is set to blank to avoid sending the default of
# dhcpcd-<version>:<os>:<machine>:<platform>
vendorclassid

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search
option classless_static_routes
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# Request a hostname from the network
option host_name

# Most distributions have NTP support.
#option ntp_servers

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private
noipv4ll
/etc/dhcpcd.conf

Reversed for legibility:


A sample configuration for dhcpcd.

See dhcpcd.conf(5) for details.

Allow users of this group to interact with dhcpcd via the control socket.

controlgroup wheel

Inform the DHCP server of our hostname for DDNS.

hostname

Use the hardware address of the interface for the Client ID.

clientid

or

Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.

Some non-RFC compliant DHCP servers do not reply with this set.

In this case, comment out duid and enable clientid above.

duid

Persist interface configuration when dhcpcd exits.

persistent

vendorclassid is set to blank to avoid sending the default of

dhcpcd-[version]:[os]:[machine]:[platform]

vendorclassid

A list of options to request from the DHCP server.

option domain_name_servers, domain_name, domain_search
option classless_static_routes

Respect the network MTU. This is applied to DHCP routes.

option interface_mtu

Request a hostname from the network

option host_name

Most distributions have NTP support.

option ntp_servers

Rapid commit support.

Safe to enable by default because it requires the equivalent option set

on the server to actually work.

option rapid_commit

A ServerID is required by RFC2131.

require dhcp_server_identifier

Generate SLAAC address using the Hardware Address of the interface

slaac hwaddr

OR generate Stable Private IPv6 Addresses based from the DUID

slaac private
noipv4ll

Example 2

/etc/mbpfan.conf

[general]
# see https://ineed.coffee/3838/a-beginners-tutorial-for-mbpfan-under-ubuntu for the values
# 
# mbpfan will load the max / min speed of from the files produced by the applesmc driver. If these files are not found it will set all fans to the default of min_speed = 2000 and max_speed = 6200
# by setting the values for the speeds in this config it will override whatever it finds in:
# /sys/devices/platform/applesmc.768/fan*_min
# /sys/devices/platform/applesmc.768/fan*_max
# or the defaults.
#
# multiple fans can be configured by using the config key of min_fan*_speed and max_fan*_speed
# the number used will correlate to the file number of the fan in the applesmc driver that are used to control the fan speed.
#

#min_fan1_speed = 1000	# put the *lowest* value of "cat /sys/devices/platform/applesmc.768/fan*_min"
#min_fan1_speed = 2000
min_fan1_speed = 3000
max_fan1_speed = 6156	# put the *highest* value of "cat /sys/devices/platform/applesmc.768/fan*_max"

#min_fan2_speed = 1000   # put the *lowest* value of "cat /sys/devices/platform/applesmc.768/fan*_min"
#min_fan2_speed = 2000
min_fan2_speed = 2800
max_fan2_speed = 5700   # put the *highest* value of "cat /sys/devices/platform/applesmc.768/fan*_max"

low_temp = 49			# try ranges 55-63, default is 63
high_temp = 52			# try ranges 58-66, default is 66
max_temp = 88			# take highest number returned by "cat /sys/devices/platform/coretemp.*/hwmon/hwmon*/temp*_max", divide by 1000
polling_interval = 1	# default is 1 seconds

Reversed document:


[general]

see https://ineed.coffee/3838/a-beginners-tutorial-for-mbpfan-under-ubuntu for the values

mbpfan will load the max / min speed of from the files produced by the applesmc driver. If these files are not found it will set all fans to the default of min_speed = 2000 and max_speed = 6200

by setting the values for the speeds in this config it will override whatever it finds in:

/sys/devices/platform/applesmc.768/fan*_min

/sys/devices/platform/applesmc.768/fan*_max

or the defaults.

multiple fans can be configured by using the config key of min_fan*_speed and max_fan*_speed

the number used will correlate to the file number of the fan in the applesmc driver that are used to control the fan speed.

min_fan1_speed = 1000	 put the *lowest* value of "cat /sys/devices/platform/applesmc.768/fan*_min"
min_fan1_speed = 2000
min_fan1_speed = 3000
max_fan1_speed = 6156	# put the *highest* value of "cat /sys/devices/platform/applesmc.768/fan*_max"
min_fan2_speed = 1000    put the *lowest* value of "cat /sys/devices/platform/applesmc.768/fan*_min"
min_fan2_speed = 2000
min_fan2_speed = 2800
max_fan2_speed = 5700   # put the *highest* value of "cat /sys/devices/platform/applesmc.768/fan*_max"
low_temp = 49			# try ranges 55-63, default is 63
high_temp = 52			# try ranges 58-66, default is 66
max_temp = 88			# take highest number returned by "cat /sys/devices/platform/coretemp.*/hwmon/hwmon*/temp*_max", divide by 1000
polling_interval = 1	# default is 1 seconds

Example 3

/etc/avahi/avahi.conf

# This file is part of avahi.
#
# avahi is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# avahi is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with avahi; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.

# See avahi-daemon.conf(5) for more information on this configuration
# file!

[server]
#host-name=foo
#domain-name=local
#browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
use-ipv6=yes
#allow-interfaces=eth0
#deny-interfaces=eth1
#check-response-ttl=no
#use-iff-running=no
#enable-dbus=yes
#disallow-other-stacks=no
#allow-point-to-point=no
#cache-entries-max=4096
#clients-max=4096
#objects-per-client-max=1024
#entries-per-entry-group-max=32
ratelimit-interval-usec=1000000
ratelimit-burst=1000

[wide-area]
enable-wide-area=yes

[publish]
#disable-publishing=no
#disable-user-service-publishing=no
#add-service-cookie=no
#publish-addresses=yes
publish-hinfo=no
publish-workstation=no
#publish-domain=yes
#publish-dns-servers=192.168.50.1, 192.168.50.2
#publish-resolv-conf-dns-servers=yes
#publish-aaaa-on-ipv4=yes
#publish-a-on-ipv6=no

[reflector]
#enable-reflector=no
#reflect-ipv=no
#reflect-filters=_airplay._tcp.local,_raop._tcp.local

[rlimits]
#rlimit-as=
#rlimit-core=0
#rlimit-data=8388608
#rlimit-fsize=0
#rlimit-nofile=768
#rlimit-stack=8388608
#rlimit-nproc=3

Reversed document:


This file is part of avahi.

avahi is free software; you can redistribute it and/or modify it

under the terms of the GNU Lesser General Public License as

published by the Free Software Foundation; either version 2 of the

License, or (at your option) any later version.

avahi is distributed in the hope that it will be useful, but WITHOUT

ANY WARRANTY; without even the implied warranty of MERCHANTABILITY

or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public

License for more details.

You should have received a copy of the GNU Lesser General Public

License along with avahi; if not, write to the Free Software

Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307

USA.

See avahi-daemon.conf(5) for more information on this configuration

file!

[server]
host-name=foo
domain-name=local
browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
use-ipv6=yes
allow-interfaces=eth0
deny-interfaces=eth1
check-response-ttl=no
use-iff-running=no
enable-dbus=yes
disallow-other-stacks=no
allow-point-to-point=no
cache-entries-max=4096
clients-max=4096
objects-per-client-max=1024
entries-per-entry-group-max=32
ratelimit-interval-usec=1000000
ratelimit-burst=1000
[wide-area]
enable-wide-area=yes
[publish]
disable-publishing=no
disable-user-service-publishing=no
add-service-cookie=no
publish-addresses=yes
publish-hinfo=no
publish-workstation=no
publish-domain=yes
publish-dns-servers=192.168.50.1, 192.168.50.2
publish-resolv-conf-dns-servers=yes
publish-aaaa-on-ipv4=yes
publish-a-on-ipv6=no
[reflector]
enable-reflector=no
reflect-ipv=no
reflect-filters=_airplay._tcp.local,_raop._tcp.local
[rlimits]
rlimit-as=
rlimit-core=0
rlimit-data=8388608
rlimit-fsize=0
rlimit-nofile=768
rlimit-stack=8388608
rlimit-nproc=3