arch detail

arch detail
Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, June 04, 2008

output of Unix/Linux/*nix time (/usr/bin/time) into a file

I've encountered this problem before:

$ time somecommand arguments 2>&1 >> some_file.txt

real 0m0.001s
user 0m0.001s
sys 0m0.000s


And it drives me crazy. Why doesn't the program 'time' write its output to the, erm, 'normal' stdout or stderr, the ones I'm redirecting? Supposedly, you can use

 time -o outfile.txt somecommand arguments 
(or -a for append) to get the desired effect, but only on GNU time. And inexplicably, this doesn't work on most systems I've used.

Of course, if you Google for anything along the lines of 'time redirect i/o' you'll get a million matches to shell script tutorials saying "this time, we'll use I/O redirection..."

Eventually, I realized that Googling for "/usr/bin/time I/O redirect" got some useful results.

Well, if you're using non-GNU time, and you're using bash or sh (who knows, maybe even csh works this way?), you can do this:

$ ( time command arguments ) 2>> time.out > command.out


Which is a big ol' ugly hack, but it works.





UPDATE:


So the venerable aaron has informed me that I wasn't getting /usr/bin/time, I was getting the bash builtin command 'time' - hence

$env time
/usr/bin/time


and yet the command 'time' does not behave as expected. I should have seen that one coming. The obvious workaround is to explicitly call /usr/bin/time instead of time.

This strikes me as particularly frustrating as bash is a GNU project, and yet it's builtin 'time' does not behave like the 'real' GNU time, but ah well.

Thursday, March 08, 2007

OpenBox is Great

I've grown disenfranchised with FluxBox. I'd been loyal, but I had some very strange issues with X/FluxBox going into a nasty freeze and the FB community was less-than-helpful.

I've tried Blackbox, and I have to say, it's too damned ugly. Admittedly, I never tried very hard at fixing that.

So today I tried OpenBox. It is a breath of fresh air. It is beautiful. It gets all my fonts right. And the more I learn about it, the better it seems. I think my first feeling of excitement came from reading the OpenBox "about" page:

Openbox works with your applications, and makes your desktop easier to manage. This is because the approach to its development was the opposite of what seems to be the general case for window managers. Openbox was written first to comply with standards and to work properly. Only when that was in place did the team turn to the visual interface.
Finally, a WM with it's head on straight.

The behavior is way more configurable than any WM I've seen before, because anything you can imagine is specifiable through an XML configuration file. While the difficulty of setting up a simple menu with XML is not easily overlooked, tools like denu greatly simplify the process.

One of the things that most impressed me was that they made a point of complying with freedesktop.org standards. If the post-fd.o world is really this well-done, the Free world will finally be a wonderful thing.

Tuesday, February 27, 2007

The Usable Linux Softsynth Roundup

I've recently been blown away by the incredible sound expressiveness of this open-source synthesizer, zynaddsubfx. I've always known it had some really great sound possibilities, but I recently started actually studying its inner workings, and I'm completely amazed. If anyone here is interested in learning about making beautiful noises, definitely check it out.

The biggest deal for me is that the creator has invented something that appears to be a (as far as I know) new type of sound synthesis. He calls it PADSynth, and there's even a complete description of the algorithm, albeit in broken English, on the website. The brilliance of it is that it takes advantage of the fact that an inverse FFT always generates an effectively "windowed" sample, which for audio purposes means completely seamless, click-free looping.

The results are sounds that are simultaneously warm and rich, but with the possibility for bizarre, inorganic harmonics that when transport the listener to a bizarre alien landscape. I seriously lost several hours just listening to chords built from sawtooth waves and missed my Aikido class.

The only problem is that because you have to design the sample, then generate a gargantuan array with an inverse FFT, it's not entirely possible to hear your edits in realtime. I think that a reasonable imitation could be made if a low-priority thread simply recomputed a new sample every time the user made an edit and applied it whenever it was finished, though this might introduce an impossibly large CPU overhead on slower machines. It would make a nice optional feature for us SMP users, though.

I've also been examining a few other open-source synths, but none have impressed me that much.

Bristol has a terrible installer (no autotools, just a script!) and the sounds are somewhat lacking imitations of analog synths of yore.

Ceres3 does spectral modeling, has a dinky install environment, was built for IRIX, seems to be slowly joining the Linux world by way of PPC(!), and has no intent of being more than an educational tool. Worst of all, they even note that the source was "written in Vim." Ick.

Mammut is a similar spectral modeling tool just like Ceres3, but not a real-time synthesizer, per se, and also lacks a maintainer, requires absurd libraries I've never heard of, and uses goofy install tools.

ATS is a better-looking spectral modeler, but no JACK support. D'oh.

RTSynth is nothing but a toy - it for some reason tries to replace JACK and LADSPA with its own incompatible and limited solutions. Also a terrible installer.

Tuesday, September 12, 2006

strace: A Great Tool I Never Noticed

I ran across this article completely accidentally, and now I'm gawking at myself and wondering why I didn't really know about this stuff. Make your life easier, Linux folksen:
All about Linux: strace - A very powerful troubleshooting tool for all Linux users