Kubernetes Dashboard Disable Token TTL/Skip Login

The default token TTL for Kubernetes Dashboard is 10 minutes, it is inconvenient in a development environment. We can remove this limit by disabling the TTL or enabling the skip login.

1. Inspect the configuration for kubernetes-dashboard

kubectl -n kubernetes-dashboard describe deployments kubernetes-dashboard

You may see --auto-generate-certificates in the **arg** section.

2. Update the configuration to add --token-ttl=0 to disable the session timeout; add -enable-skip-login to enable the skip login button.

kubectl -n kubernetes-dashboard edit deployments kubernetes-dashboard


Args:
--auto-generate-certificates
--token-ttl=0
--enable-skip-login
--enable-insecure-login

-EOF-

Update FreeBSD hostname

1. Show current hostname

hostname

2. Edit /etc/rc.conf

vim /etc/rc.conf

And modify the hostname

hostname="new-freebsd-hostname"

3. Edit /etc/hosts

vim /etc/hosts

and add new hostname mapping

::1 new-freebsd-hostname
127.0.0.1 new-freebsd-hostname

-EOF-

Predefined macros in compilers(clang, gcc)

To list clang’s pre-defined macros for clang, run:

clang -x c /dev/null -dM -E

To list gcc’s pre-defined macros for gcc, run:

gcc -x c /dev/null -dM -E

The macros are used for checking which OS(platform) is compiled at compiling time:

Linux and Linux-derived __linux__
Darwin (Mac OS X and iOS) __APPLE__
FreeBSD __FreeBSD__

Ref Guide to predefined macros in C++ compilers (gcc, clang, msvc etc.)