More servicesWindows Live
HomeHotmailSpacesOneCare
 
MSN
Sign in
 
 
Spaces home  freezing the flashProfileFriendsBlogMore Tools Explore the Spaces community

freezing the flash

spuriosity killed the cat; truthfulness brought it back
August 04

[cygwin/kde] WARNING: Problem deleting stale lockfile

Yes, you read that right, kde does run on windows, via cygwin. you can get it here:

http://webdev.cegit.de/snapshots/kde-cygwin/kde/kde3.4/

if you follow the instructions, you'll have created your ~/startkde quick start script. but alas!

WARNING: Problem deleting stale lockfile /opt/kde3.4/home/share/config/kpersonalizerrc.lock

You got that right, yet another security descriptor (SD) issue: if you're running cygwin on a non-NTFS (eg. FAT32, FAT16) partition, there aren't any permissions for you to chmod.

You don't have to re-format your partition to NTFS, simply shift the kde home directory to somewhere else where you already have ntfs, eg. %TEMP%:

export KDEHOME="%TEMP%/.kde/home"

be sure to chmod the folder appropriately!

(note: some windows environment variables may not be appropriately escaped (C:\WINDOWS --> /cygdrive/c/windows), please check before using them.)

SDs/ACL on xp home

Recently i played around with my cygwin config, and changed the /etc/group and /etc/passwd in the hope of giving my current user account more power in setting permissions (using chmod).

at the next reboot, here's what i got:

Event Type:    Error
Event Source:    Userenv
Event Category:    None
Event ID:    1505
Date:        8/4/2008
Time:        9:15:47 AM
User:        NT AUTHORITY\SYSTEM
Computer:    YOUR-******
Description:
Windows cannot load the user's profile but has logged you on with the default profile for the system.

 DETAIL - Incorrect function.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


It was in a little box with a countdown timer, and my left and right mouse buttons were switched around. Hmm, i must have been left-handed in the past...

Anyway, this obviously has something to do with permissions. But wait! In XP Home, there's no "Security" tab. But we all know, NTFS partitions have security features built-in to them. The security tab is just hidden.

There's a fiesty tool, called FilePermsBox, that let's you use the ACL editor that ships with windows, which you can't access if you're on xp home. You might also wish to check out SetACL, a command-line utility.

I prefer SetACL, cos it shows you what it's doing, whereas FilePermsBox simply hangs there while working on large operations (eg. lots of children like files and dirs).

To fix this, i cleared all the dacls on the profile, as well as the children (so that perms get inherited):

> setacl -on "C:\Documents and Settings\myself" -ot file -actn clear -clr dacl
> setacl -on "C:\Documents and Settings\myself" -ot file -actn rstchldrn -rst dacl

Then i added back trustess to two people: the account itself, and the SYSTEM account (which handles the login):

> setacl -on "C:\Documents and Settings\myself" -ot file -actn ace -ace \
"n:myself;p:full"
> setacl -on "C:\Documents and Settings\myself" -ot file -actn ace -ace \
"n:SYSTEM;p:full"

(if the account you're using in an admin account, you could also add the Administrators group.)

you're now good to go.
August 03

[git] [svn] [perl] Permission denied: Can't open (...) Permission denied at /usr/bin/git-svn line 2339

stumbled across Git while on the web and decided to have a go at it. i've been using subversion for some time now, but it's branching model wasn't very appealing. however, Git has very flexible branching, allowing you to preserve history from branches when merging. it's also distributed.

those are only some of Git's features, of course. yum.

i tried migrating an exisiting svn database over, but met a terrible bug (environment details below):

(i'm using a dummy database with only 2 revisions, you can get the dump file here.)

$ git-svn clone file:///F:/test/svn-native-repo/
Initialized empty Git repository in /cygdrive/F/test/git/svn-native-repo/.git/
        A       sitemap.html
        A       funcs.js
        A       index.html
        A       styles.css
r1 = d112a5b470fd4387c7bbb7199d0d7a065754b127 (git-svn)
Permission denied: Can't open '/cygdrive/c/DOCUME~1/myself/LOCALS~1/Temp/report.tmp': Permission denied at /usr/bin/git-svn line 2339

horrible. git svn actually maps to git-svn, a Perl script that uses the bindings provided by Git.pm (/vendor_perl/5.xx/Git.pm).

after doing some investigating, we find that Git.pm marshalls functionality into command-line executions; that is, it pipes info over from the git set of programs, eg. git-hash-object, git-update-index (my count: 139). the thing is, those programs don't die out, and hold on to temp files, making them inaccessible.

(i think that's pretty dumb, couldn't you just switch to another temp file?)

one might think, to fix this, one could simply issue calls to ::_repository->_close_hash_and_insert_object and ::_repository->_close_cat_blob, which have been already defined. after all, they close file handles and kill processes.

but wait! turns out that there's a lot of nulls being passed around. let's look at the code in one of those routines:

877:  my @vars = map { 'cat_blob_' . $_ } qw(pid in out ctx);
878: 
879:  command_close_bidi_pipe($self->{@vars});
880:  delete $self->{@vars};

i couldn't find any mention of using arrays on the right of dereferences in the manual or online, but perl didn't complain either. hmm.

i replaced that portion with more cumbersome but working stuff, so the close helper methods now work.

to summarize:
- fix close helper methods syntactically
- call close helper methods every time it's created

after fixing those, it now works:

$ rm -rf *
$ git-svn clone file:///F:/test/svn-native-repo/
Initialized empty Git repository in /cygdrive/F/test/git/svn-native-repo/.git/
        A       sitemap.html
        A       funcs.js
        A       index.html
        A       styles.css
r1 = d112a5b470fd4387c7bbb7199d0d7a065754b127 (git-svn)
        M       index.html
r2 = 02241150fa90ffc4c4d57d23fe7286afce122409 (git-svn)
Checked out HEAD:
  file:///F:/test/svn-native-repo r2

wonderful!

environment details:
- win xp home sp2
- Cygwin: 1.5.25-15 (latest)
- Git: 1.5.6.4-1 (latest)
- subversion-perl: 1.4.6-3 (latest)
- Perl: 5.10.0-5 (latest)
and all related dependencies, obtained with cygwin's setup.exe.



July 20

aws ec2: not so cheap after all

let's see how this works out for one-instance.

1 hour: $0.10
1 day: $2.40
1 month: $72

i'm spooked!

svn/tortoisesvn, ssh/putty [, svnserve]

svn comes with a nice tool, svnserve, that runs out of the box, without DAV.

so, you've got read-access to svn, but now want a secure method to access your remote repository.

here's a quick way of doing it, using ssh to setup the tunnel, and leaving the rest to svnserve.

(you don't have to run svnserve in daemon/service mode, cos it's started on-demand through ssh.)

in your local/client machine:
1. generate your ssh keypair. for windows, you need to generate a ppk file as well for putty.

2. find your subversion configuration file, usually the per-user one. (see here to find yours.)

under [tunnels] (you might need to uncomment this), add

myprojectssh = ssh -i /path/to/key user@remotehost.com

for windows, this might read

myprojectssh = plink -i /path/to/key.ppk user@remotehost.com

(if you have pageant running and already added your key, you can omit the -i part.)

what this does is provide svn with the command and arguments to initialize the tunnel.

first, let's assume you have a repo located at /var/repos/myrepo/.

for the remote host:
1. add the private key of your generate keypair to ~/.ssh/authorized_keys:

command="svnserve -t -r /var/repos/ --listen-port 3690" <type> <key> <comment>

replace <type> <key> <comment> with the contents of the public key file.

what this does is ignore whatever command ssh sends, and runs svnserve -t -r ... . actually, without the command="" prefix, it should work, but i keep getting a "Connection closed unexpectedly" error message. hmpf.

you're all set! try it out with something like

svn list svn+myprojectssh://remotehost.com:3690/myrepo

(if you hadn't added the command="" prefix, then it should read

svn list svn+myprojectssh://remotehost.com:3690/var/repos/myrepo

)


View more entries
 
latest server location