Oren Eini

CEO of RavenDB

a NoSQL Open Source Document Database

Get in touch with me:

oren@ravendb.net +972 52-548-6969

Posts: 7,591
|
Comments: 51,223
Privacy Policy · Terms
filter by tags archive
time to read 1 min | 163 words

I turned on the monitor a few moments ago and discovered a huge red warning dialog about viruses in MSN Search's directories. I couldn't understand what was happenning until I checked my junk mail, and then I saw several files that most propaply contain viruses. (You know, those email with a "re:" as a subject and a .cpl file).

I'm getting quite a bunch of those, but Outlook is very nice and just block them, and my filters automatically flag them and throw them in the junk. But MSN Search found it and copied the files to its temp directory, where my anti virus found it.

Any ideas how to solve it?

"Dreams are free, but you get soaked on the connect time." -- Tech Support Slogan

"You think Mercedes Lackey should be a cultural icon." -- Unknown

[Listening to: Prince - Vanessa Carlton - Be Not Nobody(04:10)]
time to read 7 min | 1328 words

Recently I decided that I want to move to Subversion 1.1, and have a central repository that manages all my code. The main reason for this was that I got myself a laptop, so having a file-based repository1 that I can access from my laptop.
Being security minded person, I want to tunnel this through SSH, so nobody could look at my valuable code - I'm currently implementing bogo-sort, no less :-)
There are many easy way to do this, but I wanted to use the most direct way, which is a

Sadly, I'm not a *nix guy, so my server is going to be a WinXp Pro machine, but I could find no resource whatsoever that support it without installing Apache2 on my computer. As I mention previously, I don't like to install more than what is absolutely necessary. I want to use svnserve with SSH. It's easy to get a detailed guide on how to do it on *nix, but on windows? Compelete silence.
TortoiseSVN mentions that this is possible, but leave it as an excerise for the reader.

Here are the steps needed:

SSH Server for windows - Checked, I got OpenSSH for Windows

  • Comes with an installer.
  • Install client tools (or can install only them).
  • Run as a service.
  • Has readable quick start guide that actually works (not so sommon in software from sourceforge :-) )

Install it on the server ( as administrator)
Go to the installation directory and run the following commands (covered in the quick start guide):
Make sure to run those commands as administrator, otherwise you may get weird failures.
This assumes that you want local users & groups, for domain user & groups, run those same commands, but the "-d" paramter

  • mkgroup -l >> ..\etc\group
  • mkpasswd -l >> ..\etc\passwd

Run net start opensshd (again, as admin)
Be aware that the ssh server is not automatically started, so you may want to change that on services.msc

Verify that you can connect to the ssh server by issuing the following command "ssh localhost". You should get a disclaimer about accessing the system and a password prompt. Enter your password and verify that you can log in.

Now, open <OpenSSH installation directory>\etc\banner.txt in notepad and delete all the text, save and exit notepad.
The reason for this is that subversion expect only the password prompt and when it encounter the banner's content it chokes.

The next step is to issue this command "ssh localhost svnserve -t"
You should get a password prompt and a response similar to this:
( success ( 1 2 ( ANONYMOUS EXTERNAL ) ( edit-pipeline ) ) )
This means that you can connect to the repository over ssh, now all that remains is to make subversion itself talk to the ssh server.

Here we have a problem, the problem will happen in one of two cases:

  • Your repository is located on a different drive then the SSH Server.
  • You don't want to use paths like svn+ssh://server/path/to/repos/

So, what need to be done? svnserve (the process that implement the remote connection) accept a -r parameter that allows it to spesify a root for the repository.
The problem is that you cannot specify the -r paramter in the client, because that is hard coded. The docs say that you need to create a wrapper script around it that would set the proper parameters, The problem is that such a method doesn't work on windows, probably because of the way the SSH server attempts to run the command.
There are many ways to solve this, here is a(n incomplete) list:

  1. Edit $HOME/.ssh/autorized_keys2 so that whenever you log with a spesific key the SSH server will call svnserve -r x:\path\to\repos instead of the usual shell.
  2. Edit C:\Program Files\OpenSSH\etc\passwd so that whenever a spesific user(s) log in, they will get svnserve -r x:\path\to\repos
  3. Create an executable that will call svnserve properly.

I didn't go with the first option because it seems too much for me. The second option forces me to only use subversion or to use some sort of a switcher executable.

This third option took me some time to get right3, but the short version is that you can download the result here.
Download the file, extract it and put it in Subversion bin directory (default: C:\Program Files\Subverion\bin\).
Rename svnserve.exe svnserve2.exe
Rename svnproxy.exe svnserve.exe
Create a file named redirect.inf in the same directory and in it put the following:
svnserve2 -r x:\path\to\repos
Now you should've everything that you need in order to use svn client to connect to your repository over ssh.

Verify that you can use svn+ssh by issuing the following command:
svn list svn+ssh://localhost/

You should see the familiar listing of your versioned files.

Additional things you might need to do are:

  • Setup a firewall rule allowing transfer from port 22 (I set it up to allow only my own subnet, but it is okay to expose it to everyone.
  • You might want to add your SSH server key to the list of known keys on all the machines that you'll use to access the repository, it's not technically needed, but it would avoid getting that pesky warning about an unknown key and may avoid man-in-the-middle attacks later on.
  • Set OpenSSH as an automatic server (in case you reboot and then can't find the server, that is because the SSH server is not on, you would need to manually start it using: net start opensshd

1I keep getting confused between 'repository' and 'respitory' (or is it 'respiratory') :-)
2$HOME in windows points to C:\Documents And Settings\<User Name>\
3For a full disclosure of how I solved this, go here

time to read 2 min | 230 words

The first time that I learned (rather than absorb) to program was in C++, and I liked it. I loved C++ with all its warts, the exception-aware programming, the resource allocation issues, the memory overflows, the leaks, etc. When I got .Net, I jumped on C# and didn't look back (much), I've no programmed in C++ in roughly four years.

Recently I needed to do a small application in C++, total final size 43 lines, and it took me nearly half a day. I had to unlearn a lot of stuff about .Net and relearn how to program in C++.

It took me nearly an hour to properly read from a text file, mainly because I kept trying to find the ReadLine() and ReadToEnd() and because of horrendous tool support (no ReSharper for C++, yuck!).

Anyway, I recall reading Effective C++ & More Effective C++ for fun, and Stroustrup was for bedtime reading.
I read C++ code with no problems, but I don't think that I can call myself a C++ programmer anymore, too many .Net insticts.
I'll need a refresher before I could honestly call myself a C++ programmer.

time to read 4 min | 797 words

Had you ever had to explain some technicality about the inner working of your computer to a non-technical person?
Did you manage to make the other person grok what is actually happenning?
I'm trying to educate my little brother on how computers work, this is the result:

[Warning: The following conversation was taken while driving to a movie late at night, and in a different lanauge.]

Brother: What is Virtual Memory and why is it low {refering to an error message he got earlier}? I've a lot of memory in my computer. You just installed another 10GB!

Ayende: No, I installed a HD, not memory.

Brother: What is the difference?

Ayende: Well, it's like having a whiteboard and a dossier. You can write anything on the whiteboard, and you can see everything at one, but eventually you'll run out of room. With a dossier, you can put as much information as you want {at least until the dossier cracks} but it takes a lot of time to search for something. The difference is how much time it takes to read or write something, and how much information it can hold.

Borther: So, which is which?

Ayende: Your computer memory is is like a whiteboard, very easy to write or read, but limited in space. And can be deleted very easily. A HD is much larger, and it takes more time to read and write to it, just like a dossier.

Borther: So what is virtual memory? A divider in the dossier?

[Now it gets interesting]
Ayende: Well, no. The problem is that... that... {A this point I give up and decide to personify the computer}. The computer is like a bank clerk, and any program that you run is a client. The bank don't have a lot of money available, most of it is invested elsewhere. But when a program wants more memory {a client walks to the cashier and ask to withdraw} the computer gives it the memory. The problem is when there are too many request and the money run out.

Brother: What happens then? Does the computer tell it to come tomorrow?

Ayende: The computer is too nice a person to tell you to "Go away, we don't have any more memory! Sue us!"

Brother: But what actually happens?

Ayende: Well, the computer lies. It tells you, no problem, here is the check, just cash it in when you need. You see, it hopes that you want cash it in until some other customer make a deposit {a program releases memory}.

Brother: And what happens when you do use it before it has enough?

Ayende: Well, then it cheats. First, it looks into other accounts and find what funds {places in memory} are not likely to be used soon, then it embezzle the memory away and give it to the application that wants it.

Brother: And when the embezzled application wants that memory?

Ayende: Well, the computers lies again, it again find some place unlikely to be used soon, and give the application that place.

Brother: Sound like it would get caught sometime, because what if a lot of application suddenly wants their memory back at the same time? It would have to tell some of them that it doesn't have any.

Ayende: No, that would be rude. It just politely ask them to stand in line, and steals from any of them to satisfy the requests that they need.

Brother: And won't any of them notice that they were robbed?

Ayende: No, applications don't have wallets, so the only way to can get the money is through the cashier, and he is lying through his teeth to convince them that the bank has all the money in the world {or at least about 4 Billions of it}.

Brother: I didn't know that computers lied to each other as well.

Ayende: They do, all the time.

Brother: But it nobody notice that the computer is a liar, why I got this message about low Virtual Memory?

Ayende: Oh, now you are talking about swap...

[To be (hopefully) continued...]

time to read 2 min | 219 words

I've a major problem regarding art, I can't draw a straight line with a ruler and a gun to my head.
Nevertheless, that doesn't stops me from admiring beauty. Naturally, I want my application, web site, desktop etc to be pretty.

More than that, I want them to look professional.
But that seems to be very hard to do, I looked here and thought I'd found some promise, but even Googling didn't help me!

DeviantArt has great resources, but most of the stuff there is copyrighted.
I would've thought, with all the developers donating their time to GPL and OSS, there would be some artists as well.

Anyone familiar with some resource that I can use?

Currently I found Noia Warm KDE set, which are GPLed, but there are limited in their expressiveness.

[Just to clarify, I would love nothing more than to pay enormous ammount of money to strange people for 32x32 icons. I just find myself unable to do so at the moment, at least until I'll start writing software commercially, and not as {not inexpensive} hobby.]

FireFox Cleanup

time to read 3 min | 431 words

I just cleaned up my Firefox setup.
I'd a lot of problems with it (two windows appearing when openning a link from RSS Bandit, frex) and was generally displeased with the way it was operating.
I uninstalled it, removed the %APPDATA%\FireFox and %APPDATA%\Mozilla {Lost my bookmarks in the process, because I forgot to backup, but I rarely use bookmarks anyway.}

I then installed Firefox 1.0 Preview Release and the following extentions {In order of usefulness}:

  • Googlebar - Nothing more needs to be said.
  • Tabbrowser Extensions - Very useful, lots of options. But what buys me is that it removes the "Open Link in new window" when you right click a link. My default behaviour is to right click and choose "Open link in new tab", so it's very conveniant to me to have it as the first item on the context menu. Lots of other, very cool options.
  • All-in-One Gestures Extension - Allows simple {Left, Right, Up, Down} gestures, with a UI that I can understand. I used RadialContext for a time, and that was nice, but I had a lot of mistakes, because it's very small interface.
  • Adblock - My eyes usually remove ads because my mind gets them, but this is nice to have.
  • Linkification - Scan the page for plain text URL and turn them into links, a real time saver.
  • Google pagerank - Nice to have, currently this site doesn't even appear on Google.

One thing that sucks in Firefox is their approach on installing stuff. It {correctly} blocks anything that is not defined {Basically, anything not on update.mozilla.org} but it gives you no option to temporarily allows installations. You've to allow the site to install stuff, install it, and then remove the site manually.

IE's approach since SP2 is much more sensible, "Allow this time only."

FUTURE POSTS

  1. Using Vector Search for Posts Recommendations - about one day from now

There are posts all the way to Jul 24, 2025

RECENT SERIES

  1. RavenDB 7.1 (7):
    11 Jul 2025 - The Gen AI release
  2. Production postmorterm (2):
    11 Jun 2025 - The rookie server's untimely promotion
  3. Webinar (7):
    05 Jun 2025 - Think inside the database
  4. Recording (16):
    29 May 2025 - RavenDB's Upcoming Optimizations Deep Dive
  5. RavenDB News (2):
    02 May 2025 - May 2025
View all series

Syndication

Main feed ... ...
Comments feed   ... ...
}