24 May, 2010

WindowsXp Search Command Line

I've recently needed to search a suite of Windows Xp machines in search of files with particular extensions. Since I intended on piping the results to a text file for review Windows Explorer wouldn't suit my needs. The 'find' command wasn't the proper tool for the job either as it is used for finding text strings in files.

I found good-ole 'dir' was the man for the job.


c:\ dir c:\ *.exe /s


This command will recursively search from C: for files matching '*.exe'.

That'll do donkey, that'll do.

06 May, 2010

Installing WindowMaker on Debian

Real short, but it took me a bit of searching to find how to replace Gnome as my window manager.

Start by installing the WindowMaker package:

# apt-get install wmaker


Next, as the user that you wish to run WindowMaker as the window manager:

$ echo "exec wmaker" >> ~/.xsession
$ echo "exec wmaker" >> ~/.xinitrc


Log off, then back on for it to take effect.

Cheers.

05 May, 2010

Querying WinXp Process Information

Deep down I've always been a Unix guy. I've grown to love the types of utilities and applications authored for Unix-like systems. Generally, they adopt flexibility that many UI-based operating environments lack. Case in point, the batch command syntax is far superior to any Windoze has or likely will offer and as a result I often struggle to find similar features available when I am working in Windows. I recently learned something I felt was worth sharing.

The 'top' utility offers just about all you would require in monitoring your system performance. While task manager in Windows offers similar information I'd never found a means to pipe the output to a file for parsing and analysis. Today I found such a mechanism.

The 'wmic' utility available on multiple forms of Windows stands for 'Windows Management Instrumentation Command' and can offer similar information (and in some cases more info) than the equivalent use of 'top'. While you can initiate queries beyond processes I'm interested in process and memory utilization at this time.

Initiating the command:

wmic process get WorkingSetSize,Caption /format:csv >> c:\resources.log

Will query the memory utilization and name of all the processes currently running on the system, format into a comma-separated vector and append to the specified file. Wrap this fella in a loop, place in your start-up folder and you've got the makings of monitoring your system through initialization.

Boo-yah.

16 April, 2010

Iso Magic

I find that over the past couple weeks I've had to generate, burn, and examine ISO images to support releasing our software product on external media. I thought it useful to share some useful mechanisms.

If you have a directory structure that you want bundled into a ISO image, issue the command:

mkisofs -o MyImage.iso -J dirName


To burn the image onto a DVD/CDROM use the following command:

cdrecord -v dev=X,X,X MyImage.iso

where X,X,X is determined by issuing the command:

cdrecord --scanbus

and selecting the appropriate device

You can examine the contents of an ISO image by mounting loopback as follows:

mount -o loop MyIsoImage.iso /mnt/iso


Issuing a 'find /mnt/iso' will show the contents of the image.

27 March, 2010

A Duck Of A Different Feather

Microsoft has been known to do things a bit different from the norm. Sometimes for no reason, sometimes to set themselves apart, sometimes because they're simply idiots.

Case in point, Windows Seven now has a "Performance Information and Tools" that'll rate the performance of your system compared to a benchmark. Below is the benchmark for my puny Acer Aspire one:




A scale from 1.0 .. 7.9......WTF?

04 January, 2010

Mplayer + FFMpeg + /dev/video

I've recently published posts for capturing video from a QuickCam Express using FFMpeg. I also posted how to play live video with MPlayer. That covers storing video or playing live video. Playing or storing video with a camera source seems mutually exclusive.

That said, what if you want to store and play live video simultaneously?

Playing live video while storing the incoming video is do-able using these tools and a first-in-first-out (FIFO).

The trick is to recognize that FFMpeg can support converting a single input file into multiple output files. For instance, you can convert a source video file into two output files as follows:


$ ffmpeg -i source.avi /tmp/output.avi /tmp/output.mpg


This command will take the source file source.avi and generate twin output files /tmp/output.avi and /tmp/output.mpg converting them simultaneously.

Similarly, you can use a video device /dev/video rather than an input video file and generate twin output files by using a similar command:


$ ffmpeg -r 15 -s 352x288 -f video4linux -i /dev/video0 /tmp/output.avi /tmp/output.mpg


While cool and closer, attempting to play the file will eventually reach the file end and terminate. Instead, by using a FIFO as an output file and using this FIFO as the input to Mplayer you've accomplished your goal.


$ mkfifo /tmp/vidPipe
$ ffmpeg -y -f video4linux -r 15 -s 352x288 -i /dev/video0 -f avi -vcodec msmpeg4 /tmp/vidPipe /tmp/output.avi


In another terminal window play the fifo with Mplayer using the following command:

$ mplayer /tmp/vidPipe


I love it when a plan comes together.

03 January, 2010

Playing QuickCam Video Stream with Mplayer

I've been toying with developing a Tk UI for multiple video sources, something like a video surveillance or situational awareness console.

I've made some notable progress embedding mplayer into multiple UI frames using precollected video source files and next needed to integration a 'live' video stream. That required determining the 'secret sauce' of arguments to get mplayer to recognize my QuickCam Express webcam....don't laugh, I've had it for years.

For those of you that are interested, the secret sauce is:

$ mplayer -fps 20 -tv driver=v4l:width=352:height=288:device=/dev/video0:outfmt=bgr24 tv://


Cheers.