Stellar spectroscopy in ground-based ultraviolet. I: Observational technique