Forgot your password?
typodupeerror
User Journal

Journal: GIT ideas

Journal by bilgebag

Ideas for git:

1) partial checkouts

Start with a non-checked-out repository (i.e. .git subdirectory only, -n)

find the correct sha1 for the last revision of file x (???)

What would be very useful is to get a list of files which differ between branch 'b' and the master.

git diff --name-only -r yellow navy

then use git-cat-file blob x to get a copy of the file(s) you want and place them into the correct place (creating necessary directories as you go)

This saves rewriting git-checkout-index which is a native/builtin

git-status and git-commit must be taught to ignore 'missing' files if the working copy is a partial one (git config setting), is it a great loss if it's not possible to remove a file in a partially checked-out repository? I think not

Additional config option for weird source/buildpath based languages (DataFlex, PfxPlus) where position in the repository hierarchy is not significant for building, which would hard-link the partially checked-out files into the current directory.

2) preserving multiple uncommitted working copies across branches

When switching branches and unindexed modifications exist,
    git-branch -D ${current-branch}.working
    git-branch ${current-branch}.working
    git-checkout ${current-branch}.working
    git-commit -a -m 'temporary preservation commit'

    then switch to the other branch

when switching to a branch, check if there is a ${new-branch}.working branch, check it out, then checkout the requested branch (which will leave the modifications in place) and then git-branch -D ${new-branch}.working

3) if there is nothing to commit and -q is passed, there should be no action and no output (at least not on stdout)

4) manual corrections: fewer for less (where again?) and check path for patch typos.

User Journal

Journal: MPEG motion vectors (reuse of)

Journal by bilgebag

From Richard Russell @ rtforum.co.uk

MPEG2 achieves much of its bit-rate reduction by 'predicting' what the next frame will be and transmitting only the differences between the true frame and this prediction; the better the prediction the less data needs to be sent.

The simplest form of prediction is to assume that the new frame is the same as the previous one. However when objects in the picture are moving, or when the camera itself moves (e.g. a pan) such a prediction is likely to be poor. Therefore the prediction process is helped by transmitting a set of 'motion vectors' to the decoder. Basically these tell the decoder that the best prediction for each pixel in the frame is not (necessarily) the *same* pixel in the previous frame, but a pixel displaced from it vertically and/or horizontally by a specified offset.

The important point in the context of this thread is that the offset which gives the best prediction of the pixel value may not necessarily correspond to the true motion in the picture. To take an example, suppose part of the picture contains a periodic structure such as a fence, ladder or wheel. It's entirely possible that the best prediction of a pixel will come not from the same post/rung/spoke in the previous frame, but from another post/rung/spoke that happens to be similar.

The way the 'motion vectors' are usually generated is to search all (or at least a subset) of the possible offsets and transmit whichever gives the smallest error for that block. That gives optimum compression performance, but if the 'vectors' are then used to predict the positions of objects part way between one frame and the next the results can be poor.

Finally, since the offsets are sent only to the nearest pixel, even if they do correspond to the true motion they aren't really accurate enough to predict a slow-moving object's position part way through a frame.

So using MPEG2 'motion vectors' to assist frame-rate conversion is fraught with problems. How well it works may depend on detailed characteristics of the encoder which otherwise aren't relevant (for example it's likely to work better with an encoder that uses Phase Correlation than with one that uses Block Matching). When it goes wrong, it can go so badly wrong as to make the end result far worse than not doing the motion compensation at all!

User Journal

Journal: Survivors restoration

Journal by bilgebag

Transform decoded from the BBC's D3 digital copies of the quads to Digibeta. DVNR cleanup and some manual work on bad dropouts etc afterwards. There was no telecine work, I doubt the original films still exist. (Steve Roberts)

User Journal

Journal: Accessing existing files in a chroot jail

Journal by bilgebag

Cut and pasted from LWN:

  how can you have an app that runs in the chroot jail access files that are in more normal locations?

    Debian on AMD64
(Posted Dec 2, 2004 9:16 UTC (Thu) by subscriber gevaerts) (Post reply)

mount /etc/passwd /chroot/etc/passwd -o bind
mount /etc/shadow /chroot/etc/shadow -o bind
mount /etc/group /chroot/etc/group -o bind
mount /home /chroot/home -o bind

should do the trick. Of course, using ldap authentication the first three are not needed.

User Journal

Journal: Vsftp to provide ftp/s

Journal by bilgebag

Generation of private key:

openssl genrsa -out vsftpd_key.pem 1024

Generation of Cert:

openssl req -new -x509 -key vsftpd_key.pem -out vsftpd_cert.pem

Combining: cat vsftpd_key.pem >> vsftpd_cert.pem

And this is pointed to in vsftpd.conf: rsa_cert_file=/path/to/cert/vsftpd_cert.pem

Alternatively:

openssl req -x509 -nodes -newkey rsa:1024 -keyout /etc/ssl/private/vsftpd.pem -out etc/ssl/private/vsftpd.pem

User Journal

Journal: Perwill / Screener applications OpenLook and WindowManagers

Journal by bilgebag

Finally fixed a long-standing problem in that Perwill (and presumably anything else built with the 'Screener' cross-platform toolkit) wouldn't work with any window manager other than MWM or Enlightenment, because it used the OpenLook UI if available, and the menu bar was inaccessible.

A bit of strings & grepping and some luck resulted in:

export SCLOOK=motif

Which works at least with the new multiwm in Cygwin/X x-org

User Journal

Journal: VNC & Nedit

Journal by bilgebag
To prevent unrecognised keysym errors when running nedit under vncserver, add this to .xmodmap

keycode any = KP_Enter

User Journal

Journal: What if your firewall blocks realmedia?

Journal by bilgebag

Yesterday, I wanted to view a real-media stream off the web. At work, our firewall blocks Real streams...

Eventually I found a neat way round it. Head over to workspot.com, click on the 10-minute no-signup demo, launch mozilla, go to real, download the realplayer8 plugin, fire up a shell and install.

Go the stream URL and open with the newly installed realplayer application. No sound, but job's a goodun - even over the VNC link.

Apart from a font glitch, went pretty smoothly.

What other funky things could you do in 10 minutes ?

User Journal

Journal: Magic incantations for Windows:

Journal by bilgebag
To register an arbitrary DLL:

regsvr32 blah.dll

To re-register Office components to stop them complaining on document-opening:

msexcel /unregserver | /regserver

winword /unregserver | /regserver

Weekends were made for programming. - Karl Lehenbauer

Working...