Author Topic: Simplicity of Linux  (Read 16994 times)

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Simplicity of Linux
« on: April 25, 2011, 05:34:13 PM »
One of the things I like about using Linux is you're able to do many things quickly and easily that would typically require you to purchase a software tool on another OS.  The purpose of this thread is to capture some of these for others to benefit from and to serve as a reminder to myself.  They're not terribly sophisticated, but they work.  Feel free to add any you find useful.  Use at your own risk.

Make an ISO image from VOB files:
Code: [Select]
mkisofs -dvd-video -udf -o <target_filename_here.iso> /path.to.parent.folder.for.AUDIO_TS.and.VIDEO_TS
Mount a folder located on another device on your network using NFS:
sudo mount target.machine.ip.address:/path_to_nfs_share /path.to.mountpoint.on.local.pc e.g.
Code: [Select]
sudo mount 192.168.168.252:/diskpool/d5 /media/diskpool/d5
Traverse a directory tree and embed folder.jpg to all FLAC files:
Code: [Select]
find . -name "*.flac" -type f -execdir metaflac --import-picture-from="folder.jpg" --show-tag="Title" {} \;
Traverse a directory tree, remove any embedded artwork from FLAC files and subsequently embed folder.jpg to all FLAC files:
Code: [Select]
find . -name "*.flac" -type f -execdir metaflac --remove --block-type=PICTURE {} \; && find . -name "*.flac" -type f -execdir metaflac --import-picture-from="folder.jpg" --show-tag="Title" {} \;
Transcode M4A to WAV or FLAC:
Code: [Select]
for f in *.m4a; do ffmpeg -i "$f" "${f%.m4a}.wav"; done change.wav to .flac if you'd prefer that flac files are generated rather than wav.

Split a WAV, FLAC, APE or WAVPACK file into discrete FLAC tracks using a cuesheet:
Code: [Select]
cuebreakpoints <filename>.cue | shnsplit -i wav -o flac <source_filename.ext> && cuetag <filename>.cue split-track*.flac
« Last Edit: July 13, 2014, 06:13:24 PM by Johnny Rotten »
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline LAV

  • Trade Count: (+6)
  • AVForums Veteran
  • *****
  • Posts: 2,708
Re: Simplicity of Linux
« Reply #1 on: April 26, 2011, 08:42:07 AM »
Linux and other Unix flavours are cool and ultra-stable, but...

The biggest problem is usually software vendor support. Try as I might, some of the tools and toys I use simply don't exist for Linux. Very limited amateur radio / ham radio software support. Have not seen many camera mnfrs. supply their camera's software tools for anything but Meneer Gates's OS.

I've also played with a few flavours of Linux, but unfortunately for some uses, Mr. Gates has the edge. Dual-boot is possible but definitely not convenient.
Vaal Triangle (Southern Gauteng)

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Re: Simplicity of Linux
« Reply #2 on: April 26, 2011, 09:01:06 AM »
How did a thread covering some HOWTOs for Linux turn into a Linux vs Windows debate  :)

File permissions always has me scratching my head (don't get enough practice), particularly affecting changes throughout a directory tree, so here are a few I've figured out the hard way:

To work only on directories, do the following:
Code: [Select]
find . -type d -execdir <insert_command_here> {} \; e.g. to set R/W permissions for the user that owns a directory (incl. child directories) and all other members of the directory's group you'd use
Code: [Select]
find . -type d -execdir chmod ug+rw {} \;

Similarly, to act on specified files only:
Code: [Select]
find . -name "<insert_filespec_here>" -type f -execdir <insert_command_here> {} \; e.g. to grant R/W file permissions to all members of a file's group for all files ending in .txt you'd use:
Code: [Select]
find . -name "*.txt" -type f -execdir chmod g+rw {} \;
« Last Edit: April 26, 2011, 09:10:41 AM by audiomuze »
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline GearSlave

  • Peacekeeper Extraordinaire
  • Trade Count: (+3)
  • AVForums Veteran
  • *****
  • Posts: 8,796
  • Ohm's Law has no business in Audio
    • Studio B
Re: Simplicity of Linux
« Reply #3 on: April 26, 2011, 09:08:42 AM »
to set R/W permissions for the user that owns a directory (incl. child directories) and all other members of the directory's group you'd use
Code: [Select]
find . -type d -execdir chmod ug+rw {} \;

That is useful!
Resistance is not futile; it is voltage divided by current (R=V/I)

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Re: Simplicity of Linux
« Reply #4 on: April 26, 2011, 09:23:55 AM »
That is useful!
Borne of necessity whilst consolidating my music library and finding rsync had issues accessing some folders & files.  ;)
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Re: Simplicity of Linux
« Reply #5 on: May 24, 2011, 04:05:03 PM »
List all folders and their children starting at current directory (and traverse symbolic links)
Code: [Select]
find -L . -name "*" -type d -exec echo {} >> ~/dirlist \;Lose the -L to ignore symbolic links.
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Re: Simplicity of Linux
« Reply #6 on: May 25, 2011, 07:50:04 AM »
When adding another internal or external drive to your PC Linux will autodetect the drive and it's then up to you to partition & format (if it's not already done) and mount it in order to write data to it.  In order to write to the disk you need to have the appropriate permissions and this is where we frequently get stuck.  In Ubuntu, any USB or eSATA drives are typically mounted as /media/<volumename> where volumename is the name provided for the drive when it was formatted.  By default Ubuntu will mount the device as user ROOT, meaning you won't have write permisson unless you run a root session.  You can get around this my changing the owner of the mountpoint folder by opening a terminal window and typing the following:
Code: [Select]
sudo chown <yourusername>:<yourusername> /media/<volumename>  Now, whenever the partition is mounted you'll have write permissions and Bob's your uncle.
« Last Edit: February 08, 2013, 07:35:58 PM by audiomuze »
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline BWS

  • Administrator
  • Trade Count: (+1)
  • *****
  • Posts: 15,607
Re: Simplicity of Linux
« Reply #7 on: May 25, 2011, 07:53:11 AM »
Dual-boot is possible but definitely not convenient.

VMWare is your friend  ;)
Whoever originally coined the word 'Lisp' and put an 'S' in it's spelling, is a Douchebag !!

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Re: Simplicity of Linux
« Reply #8 on: May 25, 2011, 08:10:33 AM »
VMWare is your friend  ;)
Yep, whilst I don't use widows at home anymore, there's something deeply satisfying about minimising a Windows instance just like you'd do with any other application.
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Re: Simplicity of Linux
« Reply #9 on: May 25, 2011, 10:08:23 PM »
How to Set JAVA_HOME / PATH variables Under Linux Bash Profile:
My perennial favourite - this one pisses me off everytime I've got to get it done because I can never remember it.  From a terminal window:
Code: [Select]
export JAVA_HOME=$( dirname $( dirname $( readlink -e /usr/bin/java ) ) )
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline kay

  • Site Owner
  • Administrator
  • Trade Count: (0)
  • *****
  • Posts: 1,203
  • Computer geek
    • My Blog
Re: Simplicity of Linux
« Reply #10 on: May 26, 2011, 07:45:15 AM »
When adding another internal or external drive to your PC Linux will autodetect the drive and it's then up to you to partition & format (if it's not already done) and mount it in order to write data to it.  In order to write to the disk you need to have the appropriate permissions and this is where we frequently get stuck.  In Ununtu, any USB or eSATA drives are typically mounted as /media/<volumename> where volumename is the name provided for the drive when it was formatted.  By default Ubuntu will mount the device as user ROOT, meaning you won't have write permisson unless you run a root session.  You can get around this my changing the owner of the mountpoint folder by opening a terminal window and typing the following:
Code: [Select]
sudo chown <yourusername>:<yourusername> /media/<volumename>  Now, whenever the partition is mounted you'll have write permissions and Bob's your uncle.

It's probably better to specify this in fstab - most distros will typically have a group such as "disk" which will have rights to removable media. (Too lazy to look it up now.) The point is, you don't have to chown every time you mount something.

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Re: Simplicity of Linux
« Reply #11 on: May 26, 2011, 07:50:35 AM »
It's probably better to specify this in fstab - most distros will typically have a group such as "disk" which will have rights to removable media. (Too lazy to look it up now.) The point is, you don't have to chown every time you mount something.
You're probably right (I'm definitely no full bottle on Linux), but if you're just mounting something as a one-off this is a quick way to guarantee write access.  Ubuntu also remembers the permissions so next time you plug the device it fires up with the permissions you need.  The same logic applies to anything you mount via NFS.
« Last Edit: May 26, 2011, 07:53:00 AM by audiomuze »
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Re: Simplicity of Linux
« Reply #12 on: June 04, 2011, 07:49:21 AM »
Updating your PC's BIOS
Now this one has always been a real PITA for me for a number of reasons: Many motherboards still require a DOS environment from which to do the updating, stiffy drives (apologies to any Aussies reading this) are mostly a thing of the past, today's BIOS' often exceed the stiffy's storage capacity and rolling your own DOS/Windows boot ISO inc. your BIOS update can be a tedious affair.  I found an easy solution last night:

  • Burn the FreeDos.org "fdfullcd" ISO onto a CD
  • Copy your BIOS update and its flashing utility to a memory stick
  • Leave the memory stick plugged in whilst rebooting the PC from the CD
  • Start the Live CD (not the Freedos installation routine)
  • your memory stick should be drive c: - (cycle through the drive letters if necessary)
  • once the memory stick is the working directory, run the flash update
  • reboot
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline Rotten Johnny

  • ROONed for life.
  • Administrator
  • Trade Count: (+30)
  • *****
  • Posts: 14,345
Re: Simplicity of Linux
« Reply #13 on: August 23, 2011, 08:47:12 PM »
Installing and configuring Java 6
Code: [Select]
sudo apt-get update
sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-plugin
sudo update-alternatives --config java
java -version
Audiophile: There is almost no other group that prides themselves more on wasting good money on utterly worthless ****, and then trying to furiously blow smoke up their own ass to justify it.

Free your mind...and your ass will follow.

Offline Family_Dog

  • Administrator
  • Trade Count: (+18)
  • *****
  • Posts: 7,500
  • STEEL & GLASS - Everlasting Beauty!
    • Repcom 2-way Radios
Re: Simplicity of Linux
« Reply #14 on: August 23, 2011, 09:34:21 PM »
I could not get this java update to download in Ubuntu, and sadly just gave up. Maybe I will give it another bash, forgotten what error I kept getting but did post my trials & tribulations somewhere here.


-F_D



-Eric

That Guy in South Africa...
*************************************
http://groups.yahoo.com/group/vintage_tube/
*************************************