Printing via Sunfire for NUS SoC Students
Skip the needless masochism of waddling over the official documentation of adding an SoC printer to your computer
TLDR Cheatsheet
I’m not saying the documentation is bad. On the contrary, I’m saying it’s terrible. Adding an SoC printer to your computer requires many contrived steps and failing to follow any will lead to inexplicable errors and an impending sense of doom.
“You’re a computing student right? You should know what to do what!”
I kid you not, this was the exact response I got from the SoC helpdesk when I asked for help regarding printing via Sunfire. Well if you do take a look at the official documentation, this seems to be the recurring theme here: that computing students are somehow expected to figure out what to do (otherwise, why are we studying computing eh?).
To make things clear, you can still add printers to your Windows/MacOS laptop, and you probably should since it will be less cumbersome (in the long run) than printing via Sunfire. But if, like me, you are using Linux and can’t be bothered with the lack of Linux documentation for adding SoC printers, printing via Sunfire is a great alternative.
For the remainder of this article, I assume that the reader uses Linux. Code blocks with bold sections means that that section can/should be changed.
Sunfire
Logging In
Firstly, make sure you can access and SSH into your Sunfire account. If you have never used Sunfire before, head to mysoc to create an account. After creating one, you should be able to SSH into your account like so using your terminal:
ssh e0123456@sunfire.comp.nus.edu.sgReplace the NUSNET id with yours. Take note that this id, and generally everything in UNIX, is case sensitive.
While logged in, enter pwd to get the root directory of your account. It should look something like /home/e/e0123456 (except with your NUSNET id). Remember this remote directory for the next step.
Copying Files
To copy files from your computer to Sunfire, use the scp command. Make sure you are logged out of Sunfire by entering exit and then go to the correct local directory with the files you want to copy over. For example, to copy a file named some_file.txt over to your Sunfire root directory:
scp some_file.txt e0123456@sunfire.comp.nus.edu.sg:/home/e/e0123456/To copy over a local directory and all its files, use the -r flag:
scp -r ./some_directory e0123456@sunfire.comp.nus.edu.sg:/home/e/e0123456/Printing
Converting PDF to PostScript File
Sunfire only accepts PostScript (.ps) files when printing. Trying to print PDF files will probably cause Sunfire to throw an error. Fortunately there is an easy way to convert PDF to PS files by using the pdftops command:
pdftops print_this.pdfThis should output a print_this.ps file in the same directory. Alternatively, there are also many websites that does this for free.
Print via Sunfire
Now all you have to do is copy this file over to Sunfire, log in to Sunfire, and run the lpr command:
lpr -Ppstsb print_this.psThe flag -P[printer name] allows you to choose which printer to print from. Yes, there are no spaces between the P and the printer name. The initial login to Sunfire will list the available printer names under the “Announcements” segment. Note that these names are case sensitive. The above command will print the print_this.ps file using the pstsb printer.
Print Multiple Pages per Sheet
If you want to print multiple pages per sheet, convert the PS file itself to have multiple pages using the psnup command:
psnup -2up input.ps output.psThis will take the input file input.ps and convert it to the output file output.ps with 2 pages per sheet. Then, simply print the output.ps file instead.
