Category Archives: Programming - Page 2

MTS to MP4 converter

Following my previous post about iMovie and MTS I always had random trouble with my converter failing/hanging with some  MTS files. And when repeated for the same file – no problems. This way I couldn’t just set the converter to work with tens of files and go for a coffee – I always had to look for hangs and stop the process only to restart it again.

And after I had problems with QuickTime refusing to open the new .mov files and iMovie having no sound, I thought it to be prime time to revisit the script.
Read more »

xdebug with XAMPP on Mac OS X

Xdebug logoI just upgraded my XAMPP to latest release and found myself trapped with no memory of how to install xdebug on a Mac with XAMPP.

Read more »

Git reset –merge

Or how to reset a merge commit?

If just after a merge commit you recognized that it was actually “git rebase” that you wanted to do, then your friend is:

git reset –merge 14c1d90c3e

where the target commit is the one preceding the merge.

But when reset is not an option?

But if you found the faulty merge after several other commits (or after pushing to remotes), resetting is not so good idea or won’t work at all. In that case refer to How to Revert Faulty Merge in the HowTo.

Ruby lambda

I stumbled upon a problem with one of my scripts: how do you split a yielded block between two different callers while conforming to the DRY principe? The answer is lambda method.

Read more »

FFmpeg steals input

I had a shell wrapper script to convert MTS files with FFmpeg, but somehow, when running on multiple files, only the very first one got converted.

Turns out that FFmpeg swallows the stdin from the bash script when it is run and therefore nothing remains in the stdin for the next iterations. To remedy this, I had to fake input to ffmpeg:

while read movie
do
echo "" | ffmpeg -i "$movie" -vcodec copy -acodec copy "$movie".mov
done

Without the echo command this would’ve ended after first iteration, regardless of the number of files in the input.

BTW, the above command is useful for turning MTS files into MOV files, while preserving the audio-video streams, for software that does not support MTS.

Building iPhone apps with Rake

Building and releasing iPhone apps and at the same time versioning them easily can be a bit tedious. Several posts (like this or this) show how to use agvtool for automated versioning. But for me this is still not automated enough.

Read more »

bash SMTP

There might arise situations, where a monitoring script is in dire need to send an e-mail. But how do you send mail when for some reason the mail system itself is dysfunctional?  Bash to the rescue.

Read more »

SVN vs Orwell

Not long ago I had to change history in GIT. Now I happened to commit to Subversion a revision, but forgot to limit the files to only relevant to the log entry and thus committed all changed files. Nothing really bad, but the entry was minor, compared to all the changes and I did not want those to go unnoticed in the log. I did not think one can take back files from an already committed revision, so I searched out for a solution to change the log entry. It turns out this is relatively simple, as the Subversion FAQ points out. Read more »

iPhone SDK private API

Today I got my Rivals.app rejected from AppStore because it used private API calls. Fortunately nowadays Apple lists the calls in the reject message to make it easier to remove them. I was unfortunate to be using:

  • addTextFieldWithValue:label:
  • textFieldAtIndex:

For anybody wondering about their app prior to submitting to AppStore here is a collection of popular private APIs:
http://www.drobnik.com/touch/2009/11/forbidden-fruit-apple-apis/

iPhone AdHoc distribution

All the docs at Apple indicate that AdHoc provisioning is as simple as rebuilding your project with new distribution profile. But unfortunately it is not that simple. Read more »