How to delete file from Audacious

The ability to delete a music file directly from Audacious can be useful. However, the version of Audacious that ships with latest Ubuntu does not have this feature. Thankfully, it has been implemented as a plugin and ships with Audacious 3.5.2.

To remove your Audacious and install the latest Audacious from PPA:

$ sudo apt-get remove audacious
$ sudo add-apt-repository ppa:nilarimogard/webupd8
$ sudo apt-get update
$ sudo apt-get install audacious

To turn on the feature to delete files, enable Files -> Settings -> Plugins -> General -> Delete Files. Right-click on a file in the playlist and choose Services -> Delete Selected Files. The files will be moved to Trash, so you can recover them later if you want.

Tried with: Audacious 3.5.2 and Ubuntu 14.04

About these ads

How to set color of arrow head in Inkscape

Problem

This is a strange way that Inkscape is designed. Here is how I drew a red line with an arrowhead:

  1. Draw a straight line
  2. Set color of line to red
  3. Add arrow head or tail to the line

The problem is that the arrow head remains in the default black color! It is not set to red.

Solution

Inkscape designers are very well aware of this problem since a clean solution exists and is tucked away in the far recesses of its menus. To set the arrow head or tail to the same color as the line its attached to: go to Extensions -> Modify path -> Color markers to match stroke.

That is it, the color should be changed now. You will need to keep applying this command whenever you change color of the arrow line.

Tried with: Inkscape 0.48.4 and Ubuntu 14.04

How to execute command at shell from Python

There are many operations at the shell that need a bit of looping or automation. You can learn programming in the language of the shell you use to achieve this. Since I know a bit of Python, I prefer to use it for running quick commands at the shell. The call to execute a command at the shell is os.system.

I typically use this call to automate repeated commands that I want to run at the shell. For example, I open a Python interpreter from your shell and type:

import os

for i in range(100, 200):
    s = "montage foo-" + str(i) + ".png bar-" + str(i) + ".png -tile 2x1 foobar-" + str(i) + ".png"
    os.system(s)

This quickly makes pairs from two sets of 100 images I have, puts them together and creates a new set of 100 images. Pretty sweet to automate operating on 100 images with just a few lines of code! :-)

Tried with: Python 2.7.6 and Ubuntu 14.04

How to install FFMPEG on Ubuntu

The FFMPEG project has forked into the LibAV project. Ubuntu ships with the LibAV (libav-tools) package instead of FFMPEG. However, I found that the avconv program from LibAV does not support certain parameters that FFMPEG does. If you find yourself in such a situation, you may want to install FFMPEG on Ubuntu.

  • Uninstall LibAV if you have it installed:
$ sudo apt-get remove libav-tools
  • Add the FFMPEG PPA and install it:
$ sudo add-apt-repository ppa:mc3man/trusty-media
$ sudo apt-get update
$ sudo apt-get install ffmpeg

Tried with: FFMPEG 2.4.3 and Ubuntu 14.04

How to convert images to video using FFMPEG

FFMPEG has forked into the LibAV project and Ubuntu only ships LibAV. However, I found that only FFMPEG worked correctly with filename patterns for me. You can find out how to install FFMPEG on Ubuntu here.

Assume you have 100 image files named foo-005.png to foo-104.png that are to be converted into a movie. Let us assume we want each image to get 3 seconds of time in the video. The FFMPEG invocation to create this movie file:

$ ffmpeg -framerate 1/3 -pattern_type glob -i "foo-*.png" foo.mp4

Tried with: FFMPEG 2.4.3 and Ubuntu 14.04

How to set background color in ImageMagick

PDF, SVG, PNG and many other image formats can have a transparent background. Sometimes, you might want to set the background color in image files. This can be done easily using the -background and -flatten options.

For example, to convert a PDF to JPG file and set the background color in the resulting file to white:

$ convert foo.pdf -background "#FFFFFF" -flatten foo.jpg

Tried with: ImageMagick 6.7.7.10 and Ubuntu 14.04

qProtractor

Much like a screen ruler, I sometimes need to use a protractor on the display to measure some angle. I found this tool named qProtractor that does the job perfectly!

  • qProtractor has packages for some old versions of Ubuntu. For my version of Ubuntu, I had to download the source and compile using make which was successful.

  • On running qProtractor, it displays a full 360 degree protractor which remains always on top. You can move it to anywhere on the display. Right-click to change properties. A few things you can do is to rotate it so that the zero degrees begins whereever you want and to scale the protractor up and down to fit your needs.

Tried with: QProtractor 0.0.1 and Ubuntu 14.04