Deprecated in favour of https://github.com/WiegerWolf/clock_v3_cpp
sudo apt update
sudo apt install -y git ssh
git clone git@github.com:WiegerWolf/clock_v2_cpp.gitsudo apt install -y cmake gcc make g++ libsdl2-dev \
libsdl2-image-dev libsdl2-ttf-dev libcurl4-openssl-dev \
libssl-devAdd .env file to the root of the project with the following content:
CEREBRAS_API_KEY='your_api_key'Then run the following command:
./build.shMake sure you have the following structure:
/home/n
├── digital_clock
├── assets/fonts/*.ttfYou get the ./digital_clock file from the build step.
You get the assets folder (with fonts included) from the git clone step.
sudo nano /etc/systemd/system/digital-clock.servicedigital-clock.service:
[Unit]
Description=Digital Clock Service
After=network.target
[Service]
Type=simple
User=n
WorkingDirectory=/home/n
ExecStart=/home/n/digital_clock
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
sudo systemctl enable digital-clock.service
sudo systemctl start digital-clock.serviceThe application logs to stdout/stderr, which are automatically captured by systemd. Use journalctl to view logs:
# Follow live logs (like tail -f)
sudo journalctl -u digital-clock.service -f
# View last 100 lines
sudo journalctl -u digital-clock.service -n 100
# View logs with priority/colors
sudo journalctl -u digital-clock.service -f --output=short-precise
# Filter by log level (errors and above)
sudo journalctl -u digital-clock.service -p err
# View logs from specific time
sudo journalctl -u digital-clock.service --since "1 hour ago"
sudo journalctl -u digital-clock.service --since "2025-01-15 12:00:00"
# Search for specific text
sudo journalctl -u digital-clock.service | grep "Background"
# View logs from today
sudo journalctl -u digital-clock.service --since today
# Export logs to file
sudo journalctl -u digital-clock.service > clock_logs.txtLog Levels:
DEBUG- Detailed debugging informationINFO- General informational messagesWARNING- Warning messagesERROR- Error messages (output to stderr)CRITICAL- Critical errors (output to stderr)
