https://github.com/memowe/uptime-dick
Uptime days visualization tool
https://github.com/memowe/uptime-dick
command-line-tool haskell reporting system-info
Last synced: 6 months ago
JSON representation
Uptime days visualization tool
- Host: GitHub
- URL: https://github.com/memowe/uptime-dick
- Owner: memowe
- License: mit
- Created: 2025-05-02T09:43:37.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-07-04T11:10:38.000Z (7 months ago)
- Last Synced: 2025-07-04T11:25:35.508Z (7 months ago)
- Topics: command-line-tool, haskell, reporting, system-info
- Language: Haskell
- Homepage: http://mirko.westermeier.de/uptime-dick/
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Uptime days visualization tool
This tool is a standard cabal package with an executable named `ud` and can be built and installed using standard cabal procedures:
## Preparations
Build dependencies:
```bash
$ cabal update
$ cabal build --enable-tests --only-dependencies
```
Build everything:
```bash
$ cabal build --enable-tests
```
Test the library (including property tests):
```bash
$ cabal test --test-show-details=direct
Running 1 test suites...
Test suite uptime-dick-tests: RUNNING...
Dick conversion
Simple int example [✔]
Universal properties of dick
Always starts with balls [✔]
+++ OK, passed 100 tests.
...
```
Directly run the executable:
```bash
$ cabal run ud
8======D
```
## Install and run the executable as a command
```bash
$ cabal install
$ ud
8===========D
```
## About
This project may seem slightly over-engineered, and indeed it is. This minimalist approach, directly executable, would also suffice:
```haskell
#!/usr/bin/env cabal
{- cabal:
build-depends: base, sysinfo
-}
import System.SysInfo
main :: IO ()
main = do
uts <- either (const 42) uptime <$> sysInfo
let utd = fromIntegral $ uts `div` (60*60*24)
putStrLn $ "8" ++ replicate utd '=' ++ "D"
```
However, this project also provides a comprehensive template for a Haskell library and executable, complete with automated builds and property tests.
## Author and License
(c) 2025 Mirko Westermeier.
Released under the MIT license. See [LICENSE](LICENSE) for details.