Download your favorite Linux distribution at LQ ISO.
Go Back > Blogs > Snark1994
User Name


Uncategorized Entries with no category

File conversion script

Posted 12-29-2012 at 11:04 AM by Snark1994
Updated 12-29-2012 at 11:10 AM by Snark1994

A handy script I put together to automatically convert between file formats based on file extension, in an easily extensible manner:

#!/usr/bin/env bash

#Conversion rules:
# commands["extension_from extension_to"]="convert_command"
# INFILE and OUTFILE in the conversion command are replaced
# with the appropriate filenames

declare -A commands
commands["wav mp3"]="ffmpeg -i INFILE OUTFILE"
Senior Member
Posted in Uncategorized
Views 592 Comments 0 Snark1994 is offline

Python - check if in IDLE

Posted 10-01-2011 at 06:28 AM by Snark1994

Another useful thing which I didn't realise before:

How do you get your python programme to check if it's running in IDLE or in the terminal? I tend to use the IDLE in Windows for debugging, and run programmes by double clicking so they open in the terminal.

There's not much difference between the two, but 'print'ing is slower in IDLE, and you can't use '\r' to overwrite things already printed.

Luckily, there's an easy way to check.

Senior Member
Posted in Uncategorized
Views 561 Comments 0 Snark1994 is offline

Opera Middle-Click Functionality

Posted 09-20-2011 at 04:56 PM by Snark1994
Updated 12-29-2012 at 11:07 AM by Snark1994

Just a handy hint to fix something which has bugged me for ages - if you middle click in Opera under Arch linux (and probably other distros), rather than scrolling, it tries to paste text and seems to end up searching for whatever's in your clipboard.

Luckily, this can be changed. Strangely, it's completely non-obvious.

Shift+Middle Click brings up a dialog which allows you to change your middle-click settings.
Senior Member
Posted in Uncategorized
Views 1018 Comments 1 Snark1994 is offline


All times are GMT -5. The time now is 03:44 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration