Skip to content

Instantly share code, notes, and snippets.

@obar1
Created September 27, 2025 11:30
Show Gist options
  • Save obar1/bf699cd15e4fcbe1c2d8484d62debf7d to your computer and use it in GitHub Desktop.
Save obar1/bf699cd15e4fcbe1c2d8484d62debf7d to your computer and use it in GitHub Desktop.

Revisions

  1. obar1 created this gist Sep 27, 2025.
    14 changes: 14 additions & 0 deletions ka.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/bin/bash

    # Interval in seconds (e.g., 300 = 5 minutes)
    INTERVAL=300

    echo "Keeping Codespace alive. Press [CTRL+C] to stop."

    while true; do
    echo "Ping at $(date)" > /tmp/keepalive.txt
    sleep $INTERVAL
    done

    # use ad
    # nohup ./ka.sh &