ASP.net backend implementation of YUI Image Uploader

Tom from mostynwebsolutions.com has created an ASP YUI Image Uploader backend. Direct Download: YuiExample.zip.

The YUI Image Upload posts on this site contain details on implementing the front end and editor if you’re just getting into this.

Thanks Tom.

Posted in Programming | Tagged , , , , , | Comments Off on ASP.net backend implementation of YUI Image Uploader

Handbrake can convert MTS files for Mac

So a while back we purchased a JVC Everio HD camcorder. I’ll skip the commentary on whether or not that is a good idea. For me, the relevant issue is: how am I supposed to copy the MTS (AVCHD H.264) encoded files to my mac and get them in a format that I can import into iMovie and edit.

Here are a few things I discovered on my journey the last few months:

  1. VLC can play MTS files. I wasn’t able to get the stream converter to export them properly to mov files though. Perhaps there is some setting I missed somewhere, but the formats I tried either had messed up audio or Quicktime couldn’t open them.
  2. ffmpeg is probably a good option. I couldn’t get it to work though. I had the same problems with it that I had with VLC. I couldn’t seem to pick correct encodings to get the audio/video to stay in sync.
  3. iMovie can import video directly from the camera. If you plug the camera in and import the movies directly into iMovie, that works but you end up with mov files that are larger on your hard drive. Also, if you copy the camera drive in it’s entirety to a dmg image, and then mount the dmg file, iMovie can pretend like that is a camera too, and still import the files. I didn’t want this though since I didn’t want to make dmg files every time I want to import and I didn’t want to store mov files.
  4. Handbrake does the job nicely. You can queue up a bunch of files and choose a format to convert them too. I found converting to the preset Apple TV settings works pretty well for importing into iMovie.

Hope this helps someone. Skip all those ffmpeg front-end rip off programs that want to charge you money. They are GPL violating programs whose owners are attempting to make a quick buck off something you can (and should be able to) do for free.

Posted in Miscellaneous | Tagged , , , , , , | 13 Comments

git logk

Do you like gitk? I find it almost invaluable in merging, branching, looking at old revisions, diffs, etc. I find it annoying that git log is hard to glean the same information. I searched a round a bit and found that git log is quite configurable as to what it outputs. Here is a simple alias that outputs the log with some of the data you’d find by viewing gitk.

git config alias.logk 'log --graph --pretty=format:"%h %ae: %s" --decorate --abbrev-commit'

You can add –global so you don’t have to make a logk alias for every repository.
You can also read the man page for “git log” and change the format to suite your liking.

Posted in Programming | Tagged , , , , | Comments Off on git logk

Dual Master Git Repositories

One of the nice things about git, is the ability to work in a distributed manor. Instead of having to have a central repository for your source code, you can create a copy of your repository and do work, while sharing the changes, on any number of machines. Often, when a few developers share code, they still use git with a central repository. There isn’t anything wrong with this, but sometimes, I find myself wanting to set something like this when I only want to share code between a couple computers where I am the only developer. In this case, I don’t need 3 copies of the code. I want to be able to push or pull changes between each of the machines without having to push to a 3rd repository.

So, you might try the following steps:

# on the 1st machine
> git init .
> # make some code changes
> git add ...
> git commit
# 2nd machine
> git clone <1st machine ref>
> # make some changes
> git commit
> git push # here is the problem

When you push from the 2nd machine to the 1st, the HEAD on the 1st machine is updated. The problem is that your working copy is NOT updated. To fix this, there are two solutions.

Mediocre, recover from doing the push solution:

# warning, the following will destroy any local changes you had made.
> git reset --hard HEAD

If you had made changes on the 1st machine and forgot to commit them, you’d need to stash them, check out to a branch, or whatever.

Better way, avoid the reset all together

# on the 2nd machine
> git push origin master:refs/heads/tmp_branch_name
# on the 1st machine
> git merge tmp_branch_name
> git branch -d tmp_branch_name

Another solution would be to add a remote on the 1st machine that points to the 2nd machine. Then each machine can just pull from the other rather than doing any pushes at all.
Have fun.

Posted in Programming | Tagged , , | 2 Comments

Upgrading Gentoo 2007.0 to 10.0

So I left all these servers running gentoo a couple years ago. Now, after all this time (and uptime!), I want to install something.

Error:

emerge -av portage

These are the packages that would be merged, in order:

Calculating dependencies |
!!! All ebuilds that could satisfy ">=dev-lang/python-2.5" have been masked.
!!! One of the following masked packages is required to complete your request:
- dev-lang/python-2.5.4-r3 (masked by: required EAPI -1, supported EAPI 0)
- dev-lang/python-2.6.2-r1 (masked by: required EAPI -2, supported EAPI 0)
- dev-lang/python-2.6.2-r2 (masked by: required EAPI -2, supported EAPI 0)
- dev-lang/python-2.6.4 (masked by: required EAPI -2, supported EAPI 0)
- dev-lang/python-3.1.1-r1 (masked by: required EAPI -2, supported EAPI 0)
- dev-lang/python-2.6.3 (masked by: required EAPI -2, supported EAPI 0)

For more information, see MASKED PACKAGES section in the emerge man page or 
refer to the Gentoo Handbook.
(dependency required by "sys-apps/portage-2.1.6.13" [ebuild])

Hm. Yeah, I’m way out of date.

Solution: I found other sites that talked about forcing a python/portage install but I that sounded a little harsh. Instead, I found a snapshot of portage-2008.0 and replaced my /usr/portage with the contents of that.

 cd /usr
 rm -rf portage # or mv portage xxx
 wget http://gentoo.mirrors.tds.net/gentoo/releases/snapshots/2008.0/portage-2008.0.tar.bz2
 tar -xjpf portage-2008.0.tar.bz2
 cd /etc/
 rm make.profile
 ln -s /usr/portage/profiles/default/linux/x86/2008.0 make.profile
 emerge -av portage

That took me to portage-2.1.4.4.

From there, I can now go back to current 10.0 portage and emerge -av portage to get up to the current portage state.

Yeah, I really didn’t want to do a re-install.

Posted in System Administration | Tagged , , , , | 7 Comments

Cleaning up extracted package contents

I hate it when I download a source archive, uncompress it, and find that instead of creating a package directory, with the contents of the archive, the archive was created with a bunch of files at the root directory. Suppose I have a downloads directory with lots of archives. After I uncompress this new archive, I now have a bunch of archive files and a bunch of project specific files all in the same directory. Yuck.

 > cd downloads
 > tar -xzf latestdownload.tar.gz
 > # yuck, stupid package contents in my downloads directory.

Yeah, Yeah, I know I could have listed the package contents (tar -tzf ..) and found that I needed to create a directory first but I’m lazy. So the mess is there. Now to clean it up:

 > tar -tzf latestdownload.tar.gz | xargs rm -rf

There. Files gone. You can do the same thing with unzip -t for zip archives.

Posted in System Administration | Tagged , , | 1 Comment