From b874b1b172bbb1de137a333331b98834aaa974c7 Mon Sep 17 00:00:00 2001 From: QU35T-code Date: Sun, 20 Oct 2024 10:56:15 +0200 Subject: [PATCH] Update faketime tip with examples --- source/getting-started/tips-and-tricks.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/getting-started/tips-and-tricks.rst b/source/getting-started/tips-and-tricks.rst index 08cf606..17c680b 100644 --- a/source/getting-started/tips-and-tricks.rst +++ b/source/getting-started/tips-and-tricks.rst @@ -19,6 +19,16 @@ Faketime manipulates the system time for a given child command. For example with faketime 'YYYY-MM-DD hh:mm:ss' zsh +The following examples automate the synchronization of a remote domain controller's clock to initiate a corresponding zsh session. + +.. code-block:: bash + + faketime "$(rdate -n $DC_IP -p | awk '{print $2, $3, $4}' | date -f - "+%Y-%m-%d %H:%M:%S")" zsh + +.. code-block:: bash + + faketime "$(date +'%Y-%m-%d') $(net time -S $DC_IP | awk '{print $4}')" + .. note:: Here is an example of how ``faketime`` can be used.