Use SED to print Windows path, split with line feeds

December 17, 2011

Yea, this is easy, IF you use SED much.

With cygwin installed, SED, the stream editor is available. In a command shell, execute:

set path | sed s_;_;\n_g

Explanation

  1. set path will print the Windows path. File path entries are separated by “;”.
  2. sed will invoke the cygwin installed linux SED command. Cygwin\bin is part of the executable path.
  3. “s” indicates the substitute command
  4. “_”, the underscore is used as the delimiter to each part of the substitution.
  5. “;” is the regular expression to use for a match.
  6. “;\n” is the string to substitute with.
  7. “g” is the substitute flag, global replacement

No doubt there are more direct ways of doing this. Using PowerShell would be the most appropriate if it is available.

Example
If your path is: C:\fee;d:\fi;c:\foo;\fum

The result would be:
C:\fee;
d:\fi;
c:\foo;
\fum

References
GNU sed
Sed – An Introduction and Tutorial by Bruce Barnett
SED, stream editor

 


David Darling – Cycle One: Namaste!


Ubuntu 10.10 update in VirtualBox, no gui.

October 11, 2010

I’ve been running Ubuntu Linux 10.03 on a VirtualBox VM with the Windows 7 host PC. Works fine. Updated to Ubuntu 10.10 – the Maverick Meekat, restarted the system, and now it comes up in console mode and asks for a user/pass. I give it what I have, and it doesn’t accept it. Hosed. Gee ain’t Linux grand.

Hmmm. Let me try again. Ah, it accepted another username/password, which is not the one in my Keepass database, now that needs maintenance.

GUI

But, now how do I get the Ubuntu gui back. Tried to reinstall the Guest Additions. Nope, even though I do the Devices->Install Guest Additions, I don’t see the CD in /media/cdrom folder.

At the end of this blog post the author has:

The Unixmen’s site has a workaround to the X Window issue. Run the following commands:

sudo apt-get update

sudo apt-get install build-essential linux-headers-$(uname -r)

sudo apt-get install virtualbox-ose-guest-x11

I was prompted whether or not I wanted to keep my current configuration file or replace it, I chose to keep it.

Once the last command finishes reboot the virtual machine. The display can then be resized.

It works! Ubuntu is back to normal.

Incidentally, I also had to remove etckeeper. Its been giving some trouble for a while now.

Update:
11Oct10: Oracle just released VirtualBox 3.2.10, that probably fixes this issue.


Rhythmbox on Ubuntu 10.04 won’t play mp3 on NAS

June 5, 2010

Ah the complexity of computing, no wonder most people only just play games on FaceBook.

Below I describe a problem playing MP3s on a network resource.  I don’t have a solution yet.  And have not at this time (4/24/2010) investigated further.

I installed Ubuntu 10.04 LTS Lucid Lynx in VirtualBox 3.2.2 hosted on Windows 7 Professional 64bit. Rythmbox (the default music software) ver 0.12.8 will play mp3 on the VM’s local file system. However, it won’t play mp3s that are stored on my Networked Attached Storage (NAS), an ancient ReadyNAS (now NetGear) X6 model.

Some observations:

  • If I copy an mp3 from the NAS to the file system, it plays.
  • I can play the same mp3 on the NAS using the Totem Movie Player 2.30.2.

What it could be?

  • Not an access control, since the movie player can play them.
  • Rythmbox has the correct plug-ins, since it can play mp3.
  • It is buggy or some subtle configuration is incorrect when accessing mp3 via network?

Some links
Re: Ubuntu 10.04 – Rhythmbox not working: http://ubuntuforums.org/showthread.php?p=9311110


Follow

Get every new post delivered to your Inbox.