18 August, 2010

New Phone

Well ladies (and gentlmen),
I've moved into the 21st century and replaced my old cell phone with a smart phone. Really wasn't too much of a question when selecting as my criteria was an Android-based phone. Settled in on the Samsung Galaxy and couldn't be much happier. The only issue I've noticed is the wireless doesn't work for 802.11N and haven't had a chance to get it to connect to our wireless router at home.

Anyway....I figured I'd play with converting videos for the phone, the intent of this post. As always, FFMpeg is our tool:


$ ffmpeg -i ./Tosh-001.mpg -s qcif -vcodec h263 -ac 1 -ar 8000 -r 25 -ab 12.2k -y outputfile.3gp


Mount the phone, copy in the output file, unmount and play through the gallery. Easy-peezy.

16 July, 2010

Easing System Setup with Debian Packages

Seems like every 6 months or so I feel like reinstalling Linux on my workstation. Not because I need to, but more because I want to.

Seems as my interests wander I find the need to install loads of packages for temporary tasks, once accomplished I want to remove them. Unfortunately, I don't keep track of the packages and as a result start a-fresh periodically.

I do it often enough that it doesn't take too much time. Much of it is just the identification and reinstallation of packages I regularly use.

Authoring a system installation package that identifies all my essential packages as a dependency seems as it would minimize this effort dramatically. Since packages can define dependencies and installing it can auto-resolve and install the required dependencies seems like if we authored a faux package with dependencies on the packages I want installed we'd be right on mark.

Let's start;

Start by creating a directory.

$ mkdir ~/myPackage


Next, create the necessary control file which will identify the dependencies.

$ mkdir ~/myPackage/DEBIAN
$ edit ~/myPackage/DEBIAN/control

Populate ~/myPackage/DEBIAN/control with the following:
Package: MyPackage
Version: 1.0
Section: web
Priority: optional
Architecture: all
Essential: no
Depends: gnuplot, tcl
Pre-Depends: gnuplot
Recommends:
Suggests:
Installed-Size: 1024
Maintainer: Joe Brockmeier [jzb@dissociatedpress.net]
Conflicts: wile-e-coyote
Replaces: sam-sheepdog
Provides: acme
Description: The description can contain free-form text
describing the function of the program, what
kind of features it has, and so on.

Pay special attention to the Depends: field, it's populated with tcl and gnuplot. That means, when we install this package we ask that these dependencies are installed as well.

Next, create the package by executing the following command:

$ dpkg -b ~/myPackage /tmp/myPackage.deb


All set, now just install the package as root and you'll achieve an indirect installation of the dependencies.


# gdebi /tmp/myPackage.deb


Cheers.

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?