### Add a printer on the command line – cups-pdf example

Posted by & filed under Linux.

Suppose you need to add a printer to a computer on the command line, e.g., a server that you access via a terminal. This post outlines how to use some basic commands from the CUPS system. I will illustrate with commands for a network-connected printer and cups-pdf for printing to PDF files (~/PDF/): sudo lpadmin… Read more »

### LPR printing on command line

Posted by & filed under Linux.

These days, with Linux distros such as Ubuntu, printing is quite easy. You can add and remove printers and print files just as easily (or even more so) compared to Windows or Mac. Sometimes I might just want to print from the command line. To do so, I make use of the lpr command. To… Read more »

### Split, cut, or sample a video file on the command line

Posted by & filed under Linux.

There are many reasons to cut or split a video file. For example, one may want to cut a long video into multiple parts to upload to YouTube. I first ran into this and this, which suggests: ffmpeg -ss 00:00:00 -t 00:01:00 -vcodec copy -acodec copy -i in.avi out.avi ## -ss: start position ## -t:… Read more »

### Burn dvd from the command line

Posted by & filed under Linux.

I recently had to back files from my Ubuntu-based NAS. I initially used xfburn, a medium-weight burning software. It does a pretty good job. However, I decided to burn via the command line to refrain from pointing and clicking. I found dvd+rw-tools. Some simple examples are found here; the full filename solution was found here…. Read more »

### (Batch) Amplify audio files from the command line

Posted by & filed under Linux.

Audacity is great, but it’s a GUI and sometimes I just want to do basic things like amplify the sound of some mp3 files. Discovered mp3gain from this thread and wrote this script to batch amplify the files: #! /bin/bash ## http://boards.straightdope.com/sdmb/archive/index.php/t-339352.html gainval=10 for file in “$@” do mp3gain -g$gainval \$file done Note that… Read more »

Posted by & filed under Linux.

### Wi-Fi on the command line

Posted by & filed under Linux, Networking.

I depend on the GUI applet that comes with Ubuntu for wireless connections. However, if I ever am on a Linux laptop without X, I can follow this guide.

### how to set up sending mail from the command line

Posted by & filed under Linux, Networking.

Often times I want to send emails to myself when a job is done or when something happens on the computer/server. Using the command line is the most portable and obvious as most software I run (eg, R) can execute from it. This site shows how to use mail and mutt to send emails from… Read more »

### Accessing MS SQL Server from command line in Mac OS X and Linux/Unix

Posted by & filed under Mac OS X, Networking.

Unfortunately in my current line of work, I’ve been pulling data from MS SQL Server. My current workflow involves remotely logging into a windows machine, and from there, using the sql server software (MS SQL Server Management Studio) to issue queries and save data. This especially sucked in that I couldn’t write in the query… Read more »