You are viewing djberg96

Testing 1,2,3... [entries|archive|friends|userinfo]

[ website | Sapphire ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

[Links:| Ruby Home RubyForge RAA comp.lang.ruby Ruby Documentation ]

Getting irb history without readline [May. 17th, 2014|01:46 am]
[Tags|, ]

I built Ruby 2.1.2 from source and got all the desired 3rd party libs installed except readline. A minor nuisance since it mostly only affects irb and history. Except I want irb history so I can use the up arrow key to recall commands.

I tried rb-readline but it was acting weird, with stray characters appearing and general wonkiness that I can't describe. Instead, I installed rawline and modified the irb/completion.rb file so that it requires rawline instead of readline.

Works like a champ.
linkpost comment

Building openssl for Ruby with Visual Studio [May. 11th, 2014|09:02 am]
[Tags|, , ]

Yet another "how to build" post mostly for my own reference, but you may find it useful.

Building the openssl lib for Ruby with Visual Studio is a bit of a pain. First, you'll need to install openssl itself (which you can build from source if you have Perl installed) or use their precompiled stuff. To build openssl itself from source, do this:

  perl Configure VC-WIN32 --prefix=C:\usr\local
  nmake -f ms\nt.mak 
  nmake -f ms\nt.mak install

This assumes a 32-bit build, but you get the idea. Once that's done, you'll need to cd to the ext/openssl directory of wherever your Ruby source code is. Before you begin you will need to hand edit the extconf.rb file and change line 40 from "if $mingw" to "if File::ALT_SEPARATOR". This ensures that the gdi and wsock32 libs are linked properly.

This was reported at

With that done, run "ruby extconf.rb --with-openssl-dir=c:/usr/local", or wherever you installed openssl. Once that's complete you have to pause again and hand edit the generated Makefile because it's missing a declaration for $(top_srcdir). Look near the bottom and you'll see this line:

  ossl.o: $(top_srcdir)/thread_native.h $(top_srcdir)/thread_$(THREAD_MODEL).h

Change that line to this:

  ossl.o: ../../thread_native.h ../../thread_$(THREAD_MODEL).h

This was reported and inexplicably rejected at

Then run "nmake" followed by "nmake install". Once that's done you can test it out by firing up irb and typing 'require "openssl"' to ensure you don't get an error.

That's it!
linkpost comment

The End of RubyForge [Feb. 27th, 2014|09:48 am]

If you haven't heard, RubyForge will be closing down for good on May 15th this year. This is truly the end of an era.

RubyForge began on July 22, 2003. You can see the original announcement here. The kind folks at InfoEther (namely Rich Kilmer and Tom Copeland) had given a nascent Ruby community a place to host projects, not just list them as the old RAA had done.

Based on the GForge code (mostly popularized by SourceForge), it didn't take long for it to catch on in the Ruby community. Not only did it provide hosting, but you could do bug tracking, manage mailing lists, post news announcements, set your own tasks and integrate your version control with it. There were also general areas where you could post code snippets, and you could even see some download statisics. It was fantastic, and soon we had a real competitor for Perl's CPAN.

Some of the most well known libraries in the Ruby community would be started (or soon migrated) there, including rubygems and rake. My own libraries, including the win32utils libraries, would also be hosted there. All hosted there since 2003.

Alas, all good things come to an end. There were several reasons for this, but first and foremost was the rise of git and github. Many people felt RubyForge had become too old school - many of its features often went unused - and they preferred the interface. On top of that it's somewhat difficult to maintain. Being a PHP app meant Ruby programmers couldn't really help with any enhancements or fixes and, although other folks chipped in where they could, that left mostly just Tom to handle issues.

And so, RubyForge will close down this year, having hosted over 9,600 projects with over 100,000 registered users. But more than that, I believe that RubyForge was responsible for helping to popularize a relatively young language and for bringing together Ruby programmers together in the spirit of cooperation. It was, in my opinion, the first "social programming" site for Rubyists around the world.
link1 comment|post comment

Building zlib with Visual Studio [Feb. 27th, 2014|09:17 am]

This is one of those posts I'm making for future reference because I always forget.

If you've built Ruby with Visual Studio (instead of using the mingw32 stuff), you'll need to build zlib from source. You could use the pr-zlib library, but it's slower and you'll need to install it in a non-conventional manner. Anyway, under the zlib-x.y.z/contrib/vstudio directory, look for the subdirectory that matches your version of Visual Studio, e.g. "vc10". You'll see a solution file (.sln) file there. Open that solution in Visual Studio.

You should see several projects in that solution. Remove them all except "zlibvc", as it's the only one you'll need. Before you build it, you'll need to remove the ZLIB_WINAPI preprocessor definition (under Project -> Properties -> Configuration Properties -> C/C++ -> Preprocessor, on Visual Studio 10 anyway). Once that's done, build your solution. It will generate some files in zlib-x.y.z/contrib/vstudio/vc10/x86/zlibdlldebug. Look for the .dll and .lib files, and put them someplace sane, like c:/usr/lib. I also copy all the .h files to c:/usr/include. You may also need to copy the .dll file to the c:/ruby/bin directory.

Once those files are in place, cd back to your Ruby source directory under ruby-x.y.x/ext/zlib, and run "ruby extconf.rb --with-zlib-dir=c:/usr; nmake; nmake install", modifying the dir to wherever you put the files. One caveat here is that the zlib folks seem to like to tinker with the zlib output file names. You can either edit the extconf.rb file to make sure it picks them up, or just rename the .dll and .lib files to "zlib.dll" and "zlib.lib", respectively before trying to build it.

Once that's done fire up irb and do "require 'zlib'" to make sure it works.
linkpost comment

The Joys of Unemployment [Mar. 15th, 2013|05:50 am]
As I approach nearly 18 months of unemployment (save for 1 6-week gig in the middle there), I guess I should write a blog entry. What the hell have I been doing in that time?

After I quit my job in Boulder, I went on a 6-week road trip around the country. Starting in Colorado, I headed east through Kansas, Missouri, down to Tennessee and Alabama, over to Georgia, up the eastern states to Virginia, back west through Ohio, up to Michigan, over to Wisconsin (via the UP), then west through Minnesota, South Dakota, Wyoming and finally back to Colorado.

You can see the whole trip here.

Then I took a long hiatus. I job searched a little, but I never really found anything I liked. My main goal was to find something that did NOT involve Rails, which proved quite difficult. I did have one promising opportunity at Spiceworks, but instead of offering me a job they offered me a 3-month contract. I finished it in 6 weeks (well, I think I did, I got almost no feedback), then they asked me to work on....Rails, exactly what I told them I didn't want to do.

In the meantime I've been developing my next board game called "Hands in the Sea". It's based on a Martin Wallace design, though very different in some ways. Here's the BGG entry. My sister took my photoshopped map and did some professional touch ups. I think it looks good. I've had some interest from publishers, but no one has officially picked it up.

Anyway, it's probably time to finally visit the unemployment office. ;)
linkpost comment

Installing apxs on Windows 7 [Aug. 6th, 2012|01:42 pm]
This is one of those postings I make for future reference where I explain how to install apxs on Windows.

First, assuming you have ActiveState Perl installed, run "ppm install MinGW".

Second, grab the apxs source here and unzip and untar it somewhere. Then cd to the apxs directory where you just unzipped it.

Then run "perl --with-apache2=C:/PROGRA~2/APACHE~1/Apache2.2 --with-apacheprog=httpd.exe".

It choked when I tried to use the long path name, and it also wasn't smart enough to search for httpd.exe instead of Apache.exe, even though the script seems to make some effort to do so, but something's wrong with it.

Anyway, that worked for me.

Lastly, make sure your $APACHE/bin directory is in your $PATH.
linkpost comment

New laptop, no more dual boots [Jul. 25th, 2012|07:07 am]

I bought a new SSD laptop. It's nice. It's light. It's fast. The battery life is awesome. Why? Because my old laptop died. Motherboard is kaput. What happened?

I'm pretty sure it was damaged by severe overheating caused by Ubuntu's poor power management. Basically, the CPU was churning at 100% for a very long period of time, and AMD processors being AMD processors, was running hot as fuck during that time. It started acting squirrelly a few days before it died so I managed to backup most everything I wanted beforehand, so that was good.

Anyway, no more dual booting on the laptop.
link1 comment|post comment

Subtleties of the "current user" on Windows [Jul. 12th, 2012|01:23 pm]
[Current Location |Home]
[mood |calmcalm]

There are some interesting subtleties between the "current user" on Windows, depending on whether you're talking about threads or processes. On Windows a thread can essentially run as a user different from the process it's created in. From MSDN:

"Prior to Windows NT, it could be assumed that a thread was running under the account of the interactively logged on user. Windows NT, however, allows threads to run under multiple security contexts, potentially representing multiple users. For instance, in a client/server application, a thread in the server might impersonate a client through the ImpersonateNamedPipeClient function. In this case, it runs under the user context of the client. Another example of a thread running in a different security context is a service thread, which has a domain name of NT AUTHORITY and a user name of SYSTEM, assuming that the service is running in the local system account."

The GetUserName function returns the *process* owner. To get the *thread* owner we have to resort to using tokens and sid lookup. Intawesting.
linkpost comment

Kickstarter failure and observations [Jul. 9th, 2012|11:30 pm]
[Tags|, ]

Well, my Kickstarter project failed. It's a shame but perhaps it's for the best. It definitely let me know that the market for Ruby on Windows isn't anywhere near what I thought it was. It also taught me a few other things. You may not like this.

First, it taught me who my real friends are, and who's motivated by ego driven development. I won't bother to mention the names of the turds who backstabbed me because they felt I was a threat to their little domaine.

Second, it taught me that most OSS developers suffer from an over-exaggerated sense of entitlement. Yes, free shit is nice. No, you aren't -entitled- to free shit. No, I'm not a hypocrite on this subject. I pay for software I think is worthwhile. I've got a paid x-chat license for Windows, I've donated to OOO and PostgreSQL, and I buy professional licenses for MS operating systems because I develop on them. Have you? I doubt it, but you're only too happy to buy overpriced, slave-labor-produced Apple products with closed API's. Those of you who fall into that category sicken me. Puke.

Third, it taught me that most people in the OSS community think that $50k is "a lot of money". Seriously, how do you think most businesses get started? Most happen via VC funding or bank loans. Extremely few happen "organically" as they would like to believe. Yet, if your business idea doesn't happen and grow "organically" then your project is "a waste of time". Nevermind that $50k is probably about half a year's salary for most of these self same people. When it comes to business, most people in the OSS community seriously need to grow the fuck up.

Lastly, I'm glad I went the Kickstarter route instead of the bank loan route. If I had done taken a bank loan I would be in serious trouble right now.
link3 comments|post comment

Kickstarter [Apr. 30th, 2012|03:54 am]
[Tags|, ]

I've decided to try to turn my Ruby on Windows expertise into a business via Kickstarter:

Wish me luck!
link2 comments|post comment

[ viewing | most recent entries ]
[ go | earlier ]