LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-18-2010, 01:56 AM   #1
dudeman41465
Member
 
Registered: Jun 2005
Location: Kentucky
Distribution: Debian
Posts: 794

Rep: Reputation: 56
A Few Scripts I Use A Lot


I know there's probably software out there that does some of this, but I just thought I would share a couple of python scripts I've written to automate a few things. I wrote these while teaching myself python(the only language other than html I'm familiar with) and they've worked out pretty good for me. Also keep in mind that none of these have GUIs so you need to run them in the command line with "python filename.py".

1) OGG to AVI Video Converter
This is just a script that I wrote to avoid typing an annoyingly long string every time I wanted to convert videos. I marked the line that actually does the conversion with a comment so you can modify it to change the input and output formats to fit your needs. This script requires mencoder. (Since mencoder is available for Windows, this script could probably be easily modified to work in Windows)
Here is the source-code

2) DVD to ISO Converter
Most newer distributions allow you to to just "Right click, Copy to, Image" and you can back up your DVDs. For some reason though I've had this script succeed on occasions that Brasero or K3b failed. Also might be handy if you're in a CLI only environment.
Here's the source-code

3) MountISO
I wrote this one way back in the day before I discovered gmount-iso. I know that nowadays Gnome supports mounting ISOs with Nautilus but I still prefer this script because for some reason the path Gnome mounts ISOs to is not readable by VLC(It's really long and has weird characters). This was my first attempt at packaging a program and linking multiple scripts to one another to accomplish a task. I even made a little bash installer and everything that just copies the files in the archive to a location on your hard drive(/opt/mountiso). The software is totally usable without running the installer, just run the "mountiso.py" file with python. All the files in the archive are in their original text format so feel free to take a look at the source code.
Here's the source-code

Last edited by dudeman41465; 04-18-2010 at 02:06 AM.
 
Old 04-19-2010, 11:39 AM   #2
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Rep: Reputation: 120Reputation: 120
Thanks for sharing. Just had a quick glance at them - my only comments would be that I would tend to create the scripts to allow command line arguments rather than interactive prompts (perhaps make interactive by the passing of a -i flag?). It is far quicker executing a script in a single command and it also lets you re-use them in other scripts and automated processes.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need scripts to create a lot of accounts in ICQ? DoME69 Programming 3 06-26-2008 01:13 PM
VPN: Debian Scripts -> Mandriva 2006 Scripts Undefined Mandriva 0 11-30-2005 12:10 PM
Need a lot of Help- Several Questions Sleepy_Sentry Linux - Wireless Networking 6 05-16-2005 08:18 AM
a lot of problems kryckan Linux - Hardware 4 10-04-2003 07:37 AM
Thanks a Lot! XPediTioN Slackware 0 07-11-2003 04:51 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:42 PM.

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