Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xyproto/cupholder
:tea: Remote CD tray ejection
https://github.com/xyproto/cupholder
cd-tray coffee eject ioctl linux remote-admin-tool tea tray
Last synced: 27 days ago
JSON representation
:tea: Remote CD tray ejection
- Host: GitHub
- URL: https://github.com/xyproto/cupholder
- Owner: xyproto
- License: gpl-2.0
- Created: 2020-02-11T09:47:14.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-08-18T19:07:13.000Z (about 1 year ago)
- Last Synced: 2024-10-05T15:25:10.733Z (about 1 month ago)
- Topics: cd-tray, coffee, eject, ioctl, linux, remote-admin-tool, tea, tray
- Language: Go
- Homepage:
- Size: 1.63 MB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cupholder
[![Build](https://github.com/xyproto/cupholder/actions/workflows/build.yml/badge.svg)](https://github.com/xyproto/cupholder/actions/workflows/build.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/xyproto/cupholder)](https://goreportcard.com/report/github.com/xyproto/cupholder) [![License](https://img.shields.io/badge/License-GPL2-brightgreen)](https://raw.githubusercontent.com/xyproto/cupholder/master/LICENSE)Local or remote CD tray ejection, for Linux.
`cupholder` can be useful:
* If you have a large server room with many computers with CD trays, this can be used for finding a specific server.
* If you need an example for how to call `ioctls` from Go without using C (https://github.com/xyproto/cdrom/blob/main/cd.go).## Usage
cupholder
Or when building a project that takes a while, as a notification utility:
; cupholder
For specifying a specific device:
cupholder /dev/cdrom
All arguments are treated as device filenames.
Use `-s` for silent operation and set the `NO_COLOR` environment variable to disable colors.
## Screenshot
![cupholder in action](img/screenshot.png)
## Web server
`cupholder` includes a web server that can be launched with the `-l` or `--listen` flag, that lets you eject the CD remotely, just by visiting the HTTP page at port 3280 (`3280 = 0x0CD0`).
![webpage](img/httpserver.png)
For ejecting the tray using `curl`, a command like this can then be used:
curl --silent --output /dev/null --write-out '%{http_code}\n' http://localhost:3280/
Replace `localhost` with the hostname or IP address of the server where `cupholder -l` is running.
## Requirements
* Go 1.18 or later
## General info
* Version: 1.2.1
* License: GPL2
* Author: Alexander F. Rødseth <[email protected]>