tag:blogger.com,1999:blog-21362898394858587462009-07-13T23:23:00.277-07:00TektasticElaborations on technology, music, art and life in general, by Konstantin GredeskoulKonstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.comBlogger27125tag:blogger.com,1999:blog-2136289839485858746.post-2815001680970782512009-03-22T21:16:00.001-07:002009-03-22T21:54:45.901-07:00Techtarget's Java ServerSide Symposium 2009 Impressions<p>Just got back from Vegas where between Wednesday and Friday a small-<span class="blsp-spelling-error" id="SPELLING_ERROR_0">ish</span> java conference was taking place. This was my second one, the first being five years ago in 2004. </p><div>
</div><div><p>Of course it's hard not to compare, and I find myself doing it anyway... I can't help but feel that the excitement has left java server software. Remembering one of the very first java conferences in Sydney 1995, when it was still almost academic and less of an industry conference, I feel like we've come to an end of an era.</p></div><div>
</div><div><p>The tedious reality of maintaining enormous enterprise systems built over the the last decade has <span class="blsp-spelling-error" id="SPELLING_ERROR_1">sinked</span> in, and unfortunately there is nothing exciting about it, but everything difficult and complex. Those less fortune whose systems took advantage of <span class="blsp-spelling-error" id="SPELLING_ERROR_2">EJB</span>1 and <span class="blsp-spelling-error" id="SPELLING_ERROR_3">EJB</span>2s will suffer the most, as those are dying technologies and are rapidly being replaced by simpler more component friendly software.</p></div><div>
</div><div><p>The first set of simplification came with frameworks over the last five years - Spring and Hibernate being the most notable. Now the simplifications are being pushed out across language boundaries, because of the need to stay competitive against exploding Ruby on Rails community, and even smaller but still disproportionally more productive frameworks like <span class="blsp-spelling-error" id="SPELLING_ERROR_4">Django</span>, when compared to java.</p></div><div>
</div><div><p>Several talks focused on <span class="blsp-spelling-error" id="SPELLING_ERROR_5">jRuby</span>, and I think this is where the future power lies. Combining the two platforms, Ruby on Rails for web development, and server side java for multi-threaded, asynchronous, transactional behavior seems like a fantastic opportunity.</p></div><div>
</div><div><p>However nobody is yet talking about how this all works together in production. What does it mean to run a multi-app server distributed java application, with a <span class="blsp-spelling-error" id="SPELLING_ERROR_6">RoR</span> application hosted inside <span class="blsp-spelling-error" id="SPELLING_ERROR_7">JVM</span> and interacting with the service layer? What if service layer mixes ActiveRecord and Hibernate? Questions like this, while entirely logical in early evaluations of emerging technologies, were simply beyond the depth of <span class="blsp-spelling-error" id="SPELLING_ERROR_8">TSSJS</span>09.</p></div><div>
</div><div><p>But for what it's worth, there was a decent overview of a multitude of scripting languages: javascript, ruby and <span class="blsp-spelling-error" id="SPELLING_ERROR_9">scala</span>, and a very impressive talk on Ruby meta programming.</p></div><div>
</div><div><p>There were several exciting news for me personally, the first having to do with <b><a href="http://www.adobe.com/products/flex/">Flex</a></b> <a href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/">and </a><b><span class="blsp-spelling-error" id="SPELLING_ERROR_10"><a href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/">BlazeDS</a></span></b> integration in<b> <a href="http://www.springsource.org/">Spring 3.0</a></b>. Basically what this means is that it's now possible to build a typically modular and well understood server-side <span class="blsp-spelling-error" id="SPELLING_ERROR_11">backend architecture</span> in Spring, the client side in Flex, and have them directly converse over binary <span class="blsp-spelling-error" id="SPELLING_ERROR_12">AMF</span> protocol, which is highly compressed and optimized to send data back and force. I believe the entire stack is free, except Flex Builder Eclipse-based tool that's not free. My exposure to Flex is minimal, but I love the ability to build beautiful application <span class="blsp-spelling-error" id="SPELLING_ERROR_13">UIs</span> that run consistently within the browser, and expose your <span class="blsp-spelling-error" id="SPELLING_ERROR_14">backend</span> in a way of clearly defined REST/XML <span class="blsp-spelling-error" id="SPELLING_ERROR_15">api</span>. And the load time in demos appeared significantly faster compared to java <span class="blsp-spelling-error" id="SPELLING_ERROR_16">RMI</span> applications I've had experience working with.</p></div><div>
</div><div><p>I'll add part II in a couple of days.</p></div><div>
</div><div>
</div><div>
</div><div>
</div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-281500168097078251?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0tag:blogger.com,1999:blog-2136289839485858746.post-84470726470380190032009-02-06T14:46:00.000-08:002009-02-06T14:51:59.062-08:00Binary PostgreSQL installer broken when used on RedHat EL5.3 / Dell PowerEdge 2950: Hangs server reboot.This is a very quick post that would hopefully save someone else hours of hitting the head on the wall like I did.
If you are installing <span class="blsp-spelling-error" id="SPELLING_ERROR_0">RedHat</span> Enterprise Server 5.2/5.2 x86_64 on Dell <span class="blsp-spelling-error" id="SPELLING_ERROR_1">PowerEdge</span> server, be aware of the following issue with <a href="http://www.enterprisedb.com/products/pgdownload.do"><span class="blsp-spelling-error" id="SPELLING_ERROR_2">PostgreSQL</span> binary installer offered by <span class="blsp-spelling-error" id="SPELLING_ERROR_3">EnterpriseDB</span></a>.
<blockquote>After installation the server is unable to cleanly shutdown due to the fact that the binary installer does some voodoo with <span style="font-weight: bold;"><span class="blsp-spelling-error" id="SPELLING_ERROR_4">libtermcap</span></span> - basically making this system library be used from inside <span class="blsp-spelling-error" id="SPELLING_ERROR_5">postgres</span> installation folder. Because of this, kernel can not <span class="blsp-spelling-error" id="SPELLING_ERROR_6">umount</span> /<span class="blsp-spelling-error" id="SPELLING_ERROR_7">usr</span> (or whenever your <span class="blsp-spelling-error" id="SPELLING_ERROR_8">PostgreSQL</span> is installed) and hangs the shutdown.
</blockquote>Solution:
<blockquote>Build PostgreSQL from the sources. They are ahead in minor version number anyway.
</blockquote>Thanks.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-8447072647038019003?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com1tag:blogger.com,1999:blog-2136289839485858746.post-1234697263705850882008-08-19T17:28:00.000-07:002008-08-19T17:47:10.381-07:00The Magic of Outdoor Raving<p>The campout happened, and it was an enormous success, everyone seemed to have had particularly special time this year, and I have to join the ranks. Check out just the <a href="http://coil-lighting.com/gallery/fnf_2008/">insanely intricate lighting show</a> put up by the <a href="http://radiantatmospheres.com/">Radiant Atmospheres</a> crew.</p>
<p><a href="http://coil-lighting.com/gallery/fnf_2008/"><img style="display:block; margin: auto 10px;" src="http://polygroovers.com/img/photos/fnf_lighting.jpg" /></a></p>
<p>I was involved in two music sets this year - a Friday evening downtempo set by <a href="http://polygroovers.com">PolyGroovers</a> (with live appearance by <a href="http://vulpinedesign.com">Telene</a> and briefly <a href="http://f2sf.com/">Fabienne</a>), and then Sunday morning solo live set. The PolyGroovers stuff had many new tracks from the upcoming album, so that set won't be available for download, but the morning set is below:</p>
<h2><a href="http://leftctrl.com/audio/leftctrl_live@fnf2008.mp3">LeftCtrl Live at Friends and Family Music Campout XII @ Willits CA</a> (109Mb, 74min)</h2>
<p>The above set has two songs composed together with <a href="http://kemsf.com">Kem</a> (Filip Jach), and one with Joseph Lee of Progress/SF.</p>
<p>Please feel free to download and leave your feedback as comments!</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-123469726370585088?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0tag:blogger.com,1999:blog-2136289839485858746.post-66473595251589729072008-07-24T12:31:00.000-07:002008-07-24T12:41:53.070-07:00PolyGroovers are back!<p>Tonight we are packing up and going camping for the weekend, to a music campout in Willits, where we'll be performing live on Friday night. A full mixed set will be published here next week. Very exciting stuff, and as a bonus I've got a new song to share...</p>
<ul>
<li><a href="http://polygroovers.com/audio/2008_trips_and_ticks/Funk%20In%20A%20Pond.mp3">Funk In A Pond</a> (11Mb, 8mins)</li>
</ul>
<p>This is an extended mix, which is why it's 8 minutes long, and meant to be played live. The album version will be much shortened.</p>
<p>Please feel free to leave comments with your feedback. Much appreciated!</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-6647359525158972907?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0tag:blogger.com,1999:blog-2136289839485858746.post-49365761406863556522008-07-17T12:26:00.001-07:002008-07-17T12:29:57.051-07:00Tell Your Mana About Obama, and Obama Car Art<h2>Obama's Potential Presidency</h2>
<p>There is plenty of excitement around Barack Obama's potential presidency, and I think there's a lot to be excited about. There's is an overwhelming feeling among people I talked to in San Francsisco, how Obama is "Our President" — not a poster boy for old money or a powerful family. The fact that the Internet fund-raising helped Obama to compete and win against the Clinton clan is a testament to the truly new era, a more democratic one, where if someone can fire up a lot of people they can rally up quckly and effectively. This efficiency is something to look forward to, if and when Obama becomes a President.</p>
<p>Whether or not all the people behind Obama will continue to support him, is another question. People tend to idealize their heroes way to quickly, and that's also dangerous. The recent backlash of liberal bloggers about Obama's compromise vote — is a great example. Politics is still politics, and nobody ever gets their way all the time. Everyone must compromise at some point.</p>
<p>But enough said, I think that overall Obama is a great candidate, and will hopefully bring a new fresh perspective into the Washington. So, how do we get there? Well, donating money is, for once, a very easy thing to do thanks to <a href="http://barackobama.com">http://barackobama.com</a>. But now there are other ways.</p>
<h2>Car Art Contest</h2>
<p><a href="http://infectious.com/">Infectious.com</a> (the company I work for) is running an open contest for Car Art Submissions around Obama. There are some restrictions - some specific words can not be used, but it's an amazing opportunity for artists around United States to create Obama Car Art that can be seen by thousands of people commuting daily in the next few months before the election. This is as <em>grass roots</em> as it gets.</p>
<p>
<a href="http://www.infectious.com/obama" target="_new"><img style="border-width: 0px;" src="http://www.infectious.com/images/v3/badges/infectious-obama-170x200.gif" title="Obama Car Art Contest @ Infectious.com"></a>
</p>
<p>If you know any artists that may be interested please send them to Infectious. Or you can grab the banner above and put it up on your blog. Either way - thank you!</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-4936576140686355652?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0tag:blogger.com,1999:blog-2136289839485858746.post-42078698327392715312008-06-17T11:25:00.000-07:002008-06-17T12:27:20.372-07:00Firefox3 PR Backfires?<p>
After announcing to the world that Firefox 3 will be available at 10am PDT today, June 17th, amidst apparent publicity stunt to generate the record number of downloads per day (has anyone been really keeping a tally?) the web site http://getfirefox.com/ returns the pathetic</p>
<blockquote>Http/1.1 Service Unavailable</blockquote>
<p>Firefox is certainly a decent browser, but it's stability seems to have gone reversely proportional to the self-professed greatness and the size of their publicity stunts.</p>
<p><a href="http://www.apple.com/safari/">Safari</a> is now by far the best looking, and fastest browser for Windows, and it has been that way for mac for a while.</p>
<p>Good luck Fifefox 3 (when we see you), but I for one, am not buying it.</p>
<h2>Update @ 12:23pm</h2>
<p>OK, so finally FF3 is available for download, and I have it installed and running. The first thing is that not all plugins are compatible, and if you are using FireBug for web development, you must install the 1.1 version <a href="http://getfirebug.com/releases/firebug/1.1/firebug-1.1.0b11.xpi">available here.</a></p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-4207869832739271531?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com2tag:blogger.com,1999:blog-2136289839485858746.post-76770344962239055012008-06-11T16:39:00.000-07:002008-06-11T16:52:49.919-07:00Infectious.com launches!<p>It finally happened :) I've been working for Infectious.com since about July last year, and it's been a really fun run building a brand new product, from a mere conception to this moment - full public launch.</p>
<p>
<a href="http://infectious.com"><img title="Click to go to Infectios.com" alt="Click to go to Infectios.com" src="http://www.crunchbase.com/assets/images/resized/0001/9193/19193v1-max-450x450.png"></a>
</p>
<p>Of course some people may have caught the glimpse of this from <a href="http://techcrunch.com">TechCrunch</a> article a few <a href="http://www.techcrunch.com/2008/05/22/infectious-to-bring-custom-car-art-to-the-masses/">weeks ago</a>. Nevertheless, here it is - <a href="http://infectious.com">Car Art For the Masses</a> - available to you from a spanking new website, designed and developed by the Team Infectious and yours truly.</p>
<p>The idea of course is simple - everyone's car looks the same! OK, so some are dirtier than others, some stink more, all of this is certainly true, but from an aesthetic point of view, if you and your neighbor accidentally buy the same model of a car, you are screwed! Well, not really, and especially not anymore.</p>
<p>Stop wasting time and go get some cool art for your car, make it look like nobody else, even if you drive a stinky dirty '74 Datsun. I'm seriously.</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-7677034496223905501?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com3tag:blogger.com,1999:blog-2136289839485858746.post-72021882934938929842008-04-22T22:23:00.000-07:002008-04-23T07:20:10.216-07:00Aptana - Please Don't Suck Any Harder<!--
<p>I rarely rant about software. Reliable software is hard to make, and I know this because that's what I do for living myself. But once in a while I come across such ignorance that a rant is really all I have left.
<p>I've been coding in Ruby on Rails for over two years now, and have been using RadRails standalone, Eclipse with RadRails plugin, TextMate, IntelliJ IDEA and just good old plain Vim. But for the most part, I found myself very comfortable with RadRails because I liked the integrated environment for automated testing, outline views, project views, and all the goodies that are so nice in Eclipse, or IntelliJ IDEA if you work with Java.
<p>Well, sometime back RadRails was abandoned by it's young developers, who received a comfortable package from IBM, and the whole RadRails thingy somehow was inherited by Aptana, of which at that point nobody I talked to ever heard of.
<p>What the heck is Aptana trying to do now, I still don't quite truly understand, but I went along with the plan and switched. Instead of Eclipse, I had Aptana Studio, and for some time (while I assume Aptana's contribution was merely the new name) things went well, and we all got along.
<p>Well not anymore.
<p>Aptana stopped being useful altogether with their most recent release, but things have been slowly creeping in even before that. The software now routinely spins at 100% cpu, the log file shows nothing useful, and a couple of versions back they broke Apple-Shift-R (although a later update fixed it), the command to pull up a resource by name after selecting a resource the whole thing would just crash.
<p>So today I was like, "heck, let me reinstall the whole thing, maybe it's my problem"? Huh. Not so fast.
<p>Sure, I can download and install Aptana OK, but none of their bundled sweet plugins install at all. And what meaningful error message do I get when I try to install SubClipse? "Problem with your configuration". And this is on a brand spanking new downloaded DMG. Sweet! Useful as a brick.
<p>I am sorry, but the ignorance of Aptana Corp, who are now a proper company in San Mateo, trying to sell "Pro Version" as a worthwhile add-on while they can't get their s**t together with the free community edition, just stinks to me of the worst kind of amateurism.
<p>Thanks for ruining RadRails for me, Aptana Corp. At least it took a while to add enough of YOUR code to make things really break.
-->
<blockquote>I wrote this post after hours of frustration, trying to fix my broken environment, and losing valuable time on a project that was falling behind.
<br><br>I now realize that the post was overly emotional, and probably not entirely fair to the Aptana team. I'll post updates here as I work through the issues to get my RadRails working again.</blockquote><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-7202188293493892984?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com3tag:blogger.com,1999:blog-2136289839485858746.post-33133813894447038022008-03-13T16:42:00.000-07:002009-04-20T14:25:11.723-07:00Car or Auto Make-Model-Year Database : For Breakfast<h2>Make Model What?</h2>
<p>If you like me were tasked with loading a database of recent car makes/models/years, you would start by looking on the web and seeing if someone else just has it out there, readily available, hopefully for free, but perhaps for a tiny nominal fee.?</p>
<blockquote>If only it was that simple... </blockquote>
<p>I looked and looked, and couldn't find anything that would fit the above requirements. So I thought, who would know about US car models better than Kelly Blue Book? So I went on their site, and sure enough they have a javascript file that lists all known to them makes and models of used cars. Since the file is public, I figured it's not really "evil" if I scrape and parse it for my own benefit. Disagree? Have a better source? Then leave a comment.</p>
<p>Anyway, to cut the long story short, I'm hoping to save a day or so to someone else who may, like me, be looking for this information. The ruby module shown below retrieves and parses the javascript from KBB site into a Ruby data structure of the following form - basically a hash, keyed on make, then on model with list of years as a value:</p>
<pre>
>> Constants::Auto::DB.keys.sort[0..5]
=> ["AMC", "Acura", "Alfa Romeo", "Audi", "BMW", "Bertone"]
>> Constants::Auto::DB["Subaru"].keys.sort[0..5]
=> ["B9 Tribeca", "Baja", "DL", "Forester", "GL", "GL-10"]
>> Constants::Auto::DB["Audi"]["A4"]
=> ["1999", "2007", "1998", "2006", "2005", "1996", "2004", "2003", "2002", "1997", "2001", "2000"]
>> Constants::Auto::DB["BMW"]["X5"]
=> ["2003", "2002", "2001", "2000", "2005", "2007", "2006", "2004"]
</pre>
<p>The idea is that you could load the initial hash:
<code> @models = KBB::Parser.new.to_hash</code>
and then save the output of @models.inspect in your local constants file - hence me using Constants::Auto::DB (I actually have a Rake task for doing this -- let me know if I should post it too). Then you would just re-run this every time you think new car models are added/changed on KBB. Realize, that hitting their site every time you need the data is clearly evil. So use this class to load the data initially, save the result of inspect() call into a ruby file, and use that cached version in your app. Re-run the load every time you want to update your database.</p>
<p>Please let me know if you find this code useful, or if you find a better/cleaner/more comprehensive way of maintaining car make/model/year database.</p>
<pre>
#
# author: Konstantin Gredeskoul © 2008
# license: public domain
#
require 'net/http'
require 'uri'
module KBB
MODELS_URL = "http://scripts.kbb.com/kbb/ymmData.axd?VehicleClass=UsedCar"
class Models
def initialize(js)
@models = {}
@makes = {}
n = /ymUsed_\[\d{4}\]\s*=\s*'([^']+)'/
m = /ymmUsed_\["(\d+)~(\d+)"\]\s*=\s*"([^"]+)"/
js.split(/\n/).each do |line|
next if line.strip.blank?
if matched = n.match(line)
matched[1].split(/,/).each do |token|
id, name = token.split('|')
@makes[id.to_i] = name
end
end
if matched = m.match(line)
year, make_id, models = matched[1], matched[2], matched[3]
models.split(/,/).each do |t|
id, model_name = t.split('|')
make_name = @makes[make_id.to_i]
@models[make_name] ||= {}
@models[make_name][model_name] ||= []
@models[make_name][model_name] << year
end
end
end
end
def to_hash
@models
end
end
class Parser
def initialize
@m = Models.new(Net::HTTP.get(URI.parse(MODELS_URL)))
end
def to_hash
@m.to_hash
end
end
end
</pre><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-3313381389444703802?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com34tag:blogger.com,1999:blog-2136289839485858746.post-58555385263200355452007-12-04T01:47:00.000-08:002008-01-29T11:10:48.531-08:00Beaches, Aussies and Christmas<img src="http://leftctrl.com/img/gold_coast.jpg" style="float: right; margin-left: 20px;">
<p>
It's been a little quiet here, as things were a little busy towards the end of November, and now I am away on a short trip to Australia visiting my family, relaxing and sun-bathing on fantastic beaches of Queensland, while sipping overpriced Jameson whiskey :)
</p>
<p>
Australian Christmas is in full effect, with enormous pines towering over hot beaches fully decorated in typical X-Mas crap, while in the former hippie town Byron Bay pines are dressed with shiny <a href="http://en.wikipedia.org/wiki/Peace_sign">peace signs</a>. </p>
<p>
Australians just had an election, where labor party (a weak parallel of US Democratic party) have won -- a welcome change of government after 11 years of Liberals and John Howard (smart, but creepy suck-up to George Bush). The new power has immediately ratified Kyoto protocol in their first week "at the wheel". It's refreshing to see reusable green bags at the supermarkets here, just as they are becoming a norm in San Francisco.
</p>
<p>
A weird fact discovered today -- capitalism does not mean the demand is satisfied with supply. Beach mats are not heard of in Byron Bay - a beach town with $50 beach towels. There's a few things Australia can learn from third world Thailand, where beach mats were everywhere.
</p>
<p>
Signing off for now, but stay tuned, as I'm planning a PostgreSQL performance tuning post in a few weeks. This seems like a subject not well covered widely, not sure why.
</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-5855538526320035545?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0tag:blogger.com,1999:blog-2136289839485858746.post-42701430908402463952007-11-12T10:59:00.000-08:002007-11-12T19:20:41.488-08:00Domain Registration MayhemI don't think it's a secret that the domain registration business is kinda whack. Just look at all the domain parking companies out there which take "shady business" to the whole new meaning. What I don't understand is the rationale behind some of the rules that govern domain business. For instance...</p>
<blockquote>How does NetworkSolutions Inc gets away with charging $34.99 a year?</blockquote>
<p>Seriously... WTF? I am hosting my domains with <a href="http://www.1and1.com">1&1 Hosting</a>, which charges $6.99 a year. This seems like a reasonable price, but here's the main reason the guys like NetworkSolutions are still in business:</p>
<blockquote>You can not transfer your domain 2-3 weeks prior, and two months after the date of your domain renewal.</blockquote>
<p>This dead simple, but annoying rule guarantees that everyone who WANTs to transfer their domain, but is trying to wait till last minute and/or forgets till last minute, CAN NOT move their domain to a more competitive provider. Please give me one good explanation on how this rule protects consumers...</p>
See also: <a href="http://www.networksolutions.com/domain-transfer/transfer-guide.jsp">Network Solutions rules of domain transfer. </a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-4270143090840246395?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0tag:blogger.com,1999:blog-2136289839485858746.post-16466338845735520092007-11-11T18:51:00.001-08:002007-11-12T17:33:47.099-08:00More music is on its way...<p>Telene and I have been taking advantage of the crappy weather and doing recording sessions of the tracks for the new album. In addition, this morning the lovely Amber Johnston dropped by our studio and recorded a take or two.. The result - two new awesome songs, with a very different feel. Can't wait to get the album out, but realizing that patience is a virtue.</p>
<p>There are at this moment eight tracks in a near completion stage, for the total of about 45 minutes brand spanking new <a href="http://www.polygroovers.com">PolyGroovers</a>. </p>
<p>Sorry, but we don't want to put the tracks up until the whole album is complete, although this one - <a href="http://polygroovers.com/audio/2008_ticks_and_trips/Spin%20Cycle%20for%20Delicates%20and%20Romantics.mp3">Spin Cycle for Delicates and Romantics</a> has been available for download for some time now... instrumental only, this is a good massage for the bone behind the ears :)
</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-1646633884573552009?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0tag:blogger.com,1999:blog-2136289839485858746.post-18734238532772517372007-11-10T21:42:00.000-08:002007-11-12T17:34:22.553-08:00Oh no, I am Back!<p>Yay, blog move is finally complete, and here we are -- with a shiny new dedicated blog domain name, and a Blogger/Google-based account. Blogger has gone a long way since I moved to WordPress from my original blogger account.</p>
<p>My main reason for this renewed love is the flexibility with CSS/HTML template, domain name support and ability to add javascript to your blog is also pretty sweet. In general, it just feels like they trust you more with your own blog here at Blogger. WordPress ends up being ruled by a pretty draconian law, and breeds rather annoyingly hawkish forum users.</p>
<p>Without too much product-bashing, I'm just happy to be done with the move, which unfortunately had to be manual. </p>
Keep an eye out for a set of new posts about drop down menues and REST.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-1873423853277251737?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0tag:blogger.com,1999:blog-2136289839485858746.post-64234501528276750082007-10-31T16:59:00.000-07:002007-11-12T17:35:34.828-08:00Upgrading to Mac OS-X 10.5 "Leopard"<p>Last night I upgraded to Leopard. I was a little frightened, because you know, things don't always go as planned. Especially if you consider that I use my MacBook Pro for music production, in addition to software development in two languages (java and ruby).</p>
<h4>So how did it go?</h4>
<p>I opted for an "Upgrade" option because the thought of re-installing 200Gb of Native Instruments plug-ins and sample libraries was not very appealing as you might imagine. NI web site suggested not to upgrade until they verify all applications by December, but I decided to bite the bullet and go for it anyway. Someone's gotta do it :)</p>
<p>So far - I must admit, I haven't seen a single hitch. Upgrade took about an hour (even though Installer at first reported it will take 4!!), and things seem to be running smoothly.</p>
Here's a list of applications I have verified to work on my system:
<ul>
<li>Eclipse IDE, Aptana IDE, IntelliJ IDEA (7.0.1 and 6.0.5), TextMate
<li>Fetch, PostgreSQL, Resin 3
<li>ruby 1.8.6 (my previous installation in /usr/local/ruby-1.8.6), ruby 1.8.6 (installed with Leopard in /usr/bin/ruby)
<li>Photoshop CS, Acrobat Reader, Omni Graffle, MS Office 2004
<li>Audium, Twitterific, iChat
<li>Firefox, Safari (obviously), Opera
<li>QuickTime, iPhoto, iPhotoLibrary, AddresBook, Toast 8
<li>Logic Pro 7, Live Lite 6, Reason 3.0.5
<li>Native Instruments Komplete 4 (Kontakt, Reaktor, Absynth, FM8)
</ul>
My hardware:
<ul>
<li>MacBook Pro (Intel) 2.4Ghz with 2Gb of RAM</li>
</ul>
<p>I'll add more to the list as I am going through and discovering things, but so far I am pretty pleased with how smooth this upgrade was.</p>
<p>What was your experience - especially if you did an upgrade?</p>
<h4>Update, November 10th 2007</h4>
<p>I've been using Leopard since the upgrade, everything is running smoothly, even my Native Instruments and Waves plugins. All of my Logic projects opened up as they did before. Yay!</p>
<p>I love the <a href="http://www.apple.com/macosx/features/desktop.html">Stacks</a> feature, which actually is a really nice way to unclutter your Desktop. I've been long waiting for a clean way to access folders efficiently from the Dock, and this totally hits the bill. I drag folders containing other folders, and it turns into a nice little menu.</p>
<p><a href="http://www.apple.com/macosx/features/spaces.html">Spaces</a> seems cool, but I never remember to use it. Maybe once I get used to it...</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-6423450152827675008?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com2tag:blogger.com,1999:blog-2136289839485858746.post-45148964915070775742007-10-16T16:57:00.000-07:002007-11-12T17:41:13.824-08:00Ruby on Rails Hosting: From HostingRails to RailsMachine in a shake of a tail<p>
Rails hosting is a hot subject, and with everyone asking everyone else about their experience, I thought its only fair to share my own experience, even though it is relatively limited.
</p>
<h4>Introduction</h4>
<p>
I started with a shared "professional" hosting plan from <a href="http://www.hostingrails.com/">HostingRails</a>. It was around $30/month, and included non-root SSH access to a shared server, and additional 150Mb of RAM for total of 200Mb (although that's actually quite misleading, see below). I stayed on this plan for about 3-4 months, and then decided to switch to a virtual hosting plan from <a href="http://www.railsmachine.com/">RailsMachine</a> - their single server plan, for about $100/month (that includes dedicated 384Mb of RAM and a root access to my virtual server). This post describes the reasons behind switching, and compares pros and cons of each hosting plan. Our needs included the following setup:
</p>
<ul>
<li>One application running in two instances (one production, and one test)
</li>
<li>Two-mongrel instances per application (so total of 4 mongrels)
</li>
<li>Capistrano based deployment / upgrades / restarts of the servers
</li>
<li>Apache 2+
</li>
<li>PostgreSQL 8.2
</li>
<li>Trac (+ MySQL) served over https
</li>
<li>Subversion repository served over https
</li>
<li>Subversion post-commit hook linked to a build environment, for continuous integration
</li>
<li>Automated remote daily backup of the entire environment
</li>
</ul>
<p>
To be fair, the plans described here compare sort of like apples and oranges, so the review has to be taken with a grain of salt. Main differences are, of course, in the fact that one is a shared plan and the other one virtual hosting. People on smaller budget and without tight performance requirements will probably prefer the shared plan, while those with a bit more room in the budget and some UNIX know-how will most likely be much happier with virtual hosting. My hope is that perhaps this review will help someone make the right call for their environment based on their needs, budget and experience.
</p>
<h4>
Detailed Comparison
</h4>
<p>
<strong>1. HostingRails</strong>
</p>
<ul>
<li>Pros
<ul>
<li>Cheap, only $30/mo for 4 mongrel instances (200Mb)</li>
<li>Easy Trac/SVN install </li>
<li>Rudimentary backup can be run from web UI </li>
<li>Friendly support staff </li>
<li>Timely support, usually within an hour or two </li>
<li>Lots of info on forums </li>
</ul>
</li>
<li>Cons
<ul>
<li>[Update: please see comments section for HostingRails response]. Slow, slow, and slow. We were sharing a server with 4Gb of RAM with another 50+ mongrel instances run by as many users. The server used over 1Gb of swap space and often showed load averages over 30. We were promised numerous upgrades, which did not materialize while we were using the service. Our sites and Trac at times took over 30 seconds to load the first page, probably while the corresponding process was getting un-swapped.
</li>
<li>Have to email support for any changes to top-level apache configuration, such as adding domain aliases. This applies to setting up Trac, svn and mongrel apps.
</li>
<li>Provided backup facility does not backup PostgreSQL/mysql DB, had to write our own script (but forums had a good starting point)
</li>
<li>Our mongrels clearly were not allocated any amount of "reserved" RAM. Looks like buying extra 150Mb in reality means you can run three more mongrel instances, but has nothing to do with how much RAM you actually get, as was witnessed by swap usage stats.
</li>
<li>As we decided to move because of performance issues, HostingRails refused to refund us the unused portion of the yearly fee we paid ahead as we were past first 30 days.
</li>
<li>Locked in their choice of Ruby version, gems, PostgreSQL, MySQL, Trac - can not upgrade these individually, as each is shared among many clients.
</li>
</ul>
</li>
</ul>
<blockquote>
Overall, I think that HostingRails has to fix performance issues and not pack as many clients on a single server if they want to be a viable solution for any business. Until they fix performance issues I would NOT recommend this service to anyone. If the performance is fixed, I would recommend this plan to less experienced engineers, who may not know how to use root on a UNIX system, or setup Apache, but have some basic understanding of Rails deployment. I would also recommend this plan on those with a really tight budget.
</blockquote>
<p>
<strong>RailsMachine</strong><br/><br/>
RailsMachine provides virtual hosting, meaning you get your own dedicated server with root access. The server, OS and pre-installed software details can be found on <a href="http://railsmachine.com/hosting">RailsMachine website</a>. Because you are sort of expected to use root access, some basic UNIX system administration skills are necessary to take advantage of this plan. However, the flexibility and power that come with this solution by far outweigh the additional $60/month we are paying for our own box. Note that we could pay only $75/month for 256Mb of RAM, but considering the list of applications we wanted to run, I chose to upgrade our plan to at least 384Mb.
</p>
<ul>
<li>Pros
<ul>
<li>Much, much, much, faster. When using command line, sometimes you see server "hanging" momentarily while presumably other virtual machines are being processed, but the overall performance improvements are quite dramatic. Pages (trac/mongrel) load within 1-2 seconds consistently.
</li>
<li>Fantastic provided Apache configuration, comes with plenty of dynamically compiled modules, template config files and modular structure. Our single apache server is providing umbrella access to both mongrel apps, SVN over https and Trac over https (using mod_wsgi, not CGI).
</li>
<li>RailsMachine gem allows seamless initial capistrano deployment and subsequent installations
</li>
<li>Apparently each virtual server is backed up automatically (but we do our remote backups anyway)
</li>
<li>CentOS Linux provides convenient yum utility for installing pre-built packages. Sometimes it takes a few minutes to find the right package using "yum search" but once found, installation is a breeze.
</li>
<li>Root access allows installing what you need for your environment, eg - latest PostgreSQL, latest Trac, etc. Was able to install <em>mod_wsgi</em> module to enable much faster Trac access than using traditional CGI access.
</li>
<li>Our entire setup described above takes up 180Mb of RAM, with another 180Mb left for file system caching. Pre-installed MySQL and Apache are built with multi-threading enabled, so the processes manage their shared RAM very effectively. This means we have room to add another 2-3 mongrel instances to the setup without affecting pricing of our plan.
</li>
<li>Responsive, knowledgeable support, although just the nature of the setup means you have to ask a lot LESS questions if you know what you are doing, since you can get most of the things installed yourself without bugging them.
</li>
</ul>
</li>
<li>Cons
<ul>
<li>[Update: this has been fixed, see comments section] The server came installed with broken permissions on /etc/resolv.conf and /etc/hosts file. This broke host/domain name resolution from the host itself, until the permissions were set to allow read access to the above files.
</li>
<li>Slightly more expensive.
</li>
<li>Occasionally (but mostly rarely), shell access has a latency that appears to be CPU bound by the physical server and not the network.
</li>
</ul>
</li>
</ul>
<blockquote>
Overall, I would absolutely recommend <a href="http://railsmachine.com/">RailsMachine</a> to a technically savvy engineers, who want freedom of their own box at a very affordable price. Ability to grow the size of the virtual box dynamically is also great - it's very nice to know that when you need extra 1Gb of RAM, it's there waiting for you (and your wallet).
</blockquote>
<h4>
Install Notes
</h4>
<p>
A quick note about SVN/Apache configuration with authorization turned on. This has been mentioned on many SVN forums, but if you are setting it up, please be aware that <em>mod_dav_svn</em> contains memory leak that makes apache seg-fault during checkouts of a large repository tree (we are using authorization as well as authentication). I had to add the following clause to apache config for SVN directory to resolve to issue: <code>SVNPathAuthz off</code> This is what our SVN configuraiton looks like in case someone is looking for a complete config:
</p>
<pre><VirtualHost *:443>
ServerName svn.YOURDOMAIN.com
SSLEngine On
SSLCertificateFile /etc/httpd/sslcert/server.crt
SSLCertificateKeyFile /etc/httpd/sslcert/server.key
<Location />
DAV svn
SVNPath /var/lib/subversion
AuthzSVNAccessFile /var/lib/subversion/conf/authz
SVNPathAuthz off
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /var/lib/subversion/conf/passwd
Require valid-user
</Location>
</VirtualHost>
</pre>
<h4>
References
</h4>
<ol>
<li>
<a href="http://www.svnforum.org/2017/viewtopic.php?p=12332">Memory Leak in mod_dav_svn</a>
</li>
</ol>
<h4>
Closing Notes
</h4>
<p>
Here are the responses I got from HostingRails and RailsMachine - thanks guys...
</p>
<blockquote>
Hi Konstantin, The issue with broken permissions on hosts/resolv/others has been fixed. It was due to a small (and short-lived) bug in our provisioning system. Thanks for mentioning us! -Rob at Rails Machine
</blockquote>
<blockquote>
Hi Konstantin, there’s a couple things I’d like to point out that I hope you’d be willing to correct in your review. I understand that you had a bad experience with us and respect your right to voice it.
<ol> <li>Running a cluster of 4 Mongrels will only cost $22/mo on our professional plan, and $26, $32/mo on our business and platinum plans, respectively.
<li>On our site we outline that we’re selling (physical + virtual) memory in blocks of 50MB on shared servers — when Mongrels or Static FastCGI instances are fired up they consume (’reserve’) these resources persistently.
</ol>
Overall, and I suppose you’d have to take my word for it, your server ran into an unfortunate resource situation with a number of users who are now either suspended due to malicious behavior or upgraded to dedicated environments due to extraordinary growth of their apps. Most of our clients are having good hosting experiences with us and we’re working hard to maintain fast and reliable shared servers for Rails deployment at the lowest possible price. All the best, ~William at HostingRails
</blockquote>
<p>
-- William, thank you for your corrections and I appreciate that it must not be easy to maintain quality service at such a competitive price. I’ve updated the pricing I mention and added a reference to your comment. I am willing to believe that our server may have been exception rather than a rule, and I hope that in the future you have a way to move clients off loaded machines quickly.
</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-4514896491507077574?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com5tag:blogger.com,1999:blog-2136289839485858746.post-90580625978893922702007-09-25T16:56:00.000-07:002007-11-12T19:09:26.145-08:00On Ruby on Rails with PostgreSQL, and Acts as Paranoid<p>
Back a few years ago I was researching differences between PostgreSQL and MySQL databases, and chose PostgreSQL because at the time it supported foreign key constraints and many other fantastic SQL extensions that make developer's life a lot easier. Today I am sure MySQL is just as functional as PostgreSQL, and it does appear to be a more popular choice as the Rails DB than MySQL. I still prefer PostgreSQL, it just feels more natural to me coming out of Oracle background, so I am probably biased (who isn't?) Anyway, in the last year and a half or so, I've been writing Rails apps that use PG-based databases and found a few random tricks I'd love to share here. Opinions differ here, but just like accountants like the ancient double entry accounting system, I personally prefer a double validation system - where Rails validates my objects before/after updates, but the database double checks this using proper constraints. Rail's validation system is very robust and extensive, and it is its power. However nobody is protected from human error, and it's pretty easy to forget certain validations, some validations may be performed conditionally, and in general rails validations are at a higher level. I've certainly missed a validation or two in the past myself, or had a bug in my condition. So as a rule, I specifically like to use in all of my migrations:
</p>
<ul>
<li>Foreign key constraints, with "ON DELETE CASCADE" to allow tests to drop/remove fixture data
<li>Check constraints to verify values satisfy certain conditions. Use these to validate finite value columns, such as state/status, gender, inheritance discriminator column, or polymorphic table's type discriminator. Use it to validate pattern based columns, eg if you decide to store SSN as a string of the form XXX-XX-XXXX, a check constraint can ensure it really is.
</ul>
<h4>Foreign Key Constraints</h4>
<p>
Let's start with foreign key constraints. They are extremely useful in ensuring your relationships work and do not point to non-existing rows. It is even more important if you bypass ActiveRecord and use direct SQL in certain cases to insert data (as this may be the case with some batched or high-volume data loads). I use foreign keys on ALL of my tables, and haven't had much trouble with that. The only issue to watch out for, is the order in which your fixtures are loaded. Basically you'd want to load your independent tables first, such as countries/states - those that do not depend on anything, and then load fixtures that depend on them in the order of dependence.
</p>
<blockquote>
Please see the <a href="http://www.caboo.se/articles/2006/5/1/are-foreign-keys-worth-your-time">following post</a> for an opposite opinion, and note that I don't agree with author's suggestion not to use foreign keys - read first comment, I too was saved on multiple occasions by having them, especially in the development (since that's where you'll be finding most bugs in the first place).
</blockquote>
<p>Here's how to add a foreign key constraint in your migration:</p>
<pre>create_table :profiles do |t|
t.column :user_id, :integer, :null => false
end
execute "ALTER TABLE profiles
ADD CONSTRAINT profiles_fk_user_id
FOREIGN KEY (user_id)
REFERENCES users (id)
ON DELETE CASCADE"
</pre>
<p>Notice how all constraints are named. This is very important, because you want to be able to change/update constraints in the future (especially the check constraints - see below). Not giving a constraint a name explicitly forces DB to come up with an auto-generated name, which is not very useful. Any future migration that needs to change this constraint would be at loss as to how to reference it reliably. Using a proper naming convention is also a good idea: <em>table_fk_field</em> is common naming practice for foreign key constraints.</p>
<h4>Check Constraints</h4>
<p>Check constraints verify that values in a column satisfy provided conditions. They are extremely useful in ensuring you don't get "^%$$$" as your gender value for user Bob, or "Frak!" as a status for your order. Database can be manipulated in many ways, and in my experience unless you protect your columns some weird stuff always ends up in there, whatever the greatest validation framework sits in front of it. In this hypothetical example, we need to ensure that the gender column on our frogs table only allows "M", "F" or "T" as possible gender values (I live in San Francisco, yo!). So in the migration file, specify check constraint similar to how we did this for foreign key constraints:</p>
<pre>create_table :frogs do |t|
t.column :name, :string
t.column :gender, :string, :limit => 1, :null => false
end
execute "ALTER TABLE frogs
ADD CONSTRAINT frogs_check_gender
CHECK (gender IN ('M', 'F', 'T'))"
</pre>
<p>Please see the following link for more information on PostgreSQL powerful constraints syntax:
<a href="http://www.postgresql.org/docs/current/static/ddl-constraints.html">PostgreSQL Constraints</a>
</p>
<h4>Partial Indexes, and Acts as Paranoid</h4>
<p>If you had to install <a href="http://rubyforge.org/projects/ar-paranoid">acts_as_paranoid</a> plugin, you'd notice that it adds <em>deleted_at</em> column which is going to be NULL for all values that are active in your database. Calling <em>destroy</em> will not physically delete the record, but would merely set <em>deleted_at</em> to the current time stamp. By declaring a model as "acts_as_paranoid" it will also add the following to all queries: <code>and (deleted_at is NULL or deleted_at > ?)</code> First of all, the "deleted_at > ?" clause is meant for allowing models to expire in the future, but I haven't met a single person who uses this feature. So the first thing I do when I install this plugin is I modify it's source to remove this comparison. I want my find statements generate the following: <code>and (deleted_at is NULL)</code> Ok, so things are great now, but suddenly I realize that my favorite index on users table and email field, does not really work as well! But of course... I am now querying on both "email = ? and deleted_at is null". So how do you add deleted_at to the index? Here's how:
</p>
<pre>execute "CREATE INDEX users_idx_email
ON users (email, deleted_at)
WHERE deleted_at IS NULL"
</pre>
<p>
This uses a cool feature of PostgreSQL called <a href="http://www.postgresql.org/docs/current/static/indexes-partial.html">partial index</a> to create an index on subset of values. </p>
<p>Comments and thoughts/suggestions are always welcome! References:</p>
<ol>
<li>
<a href="http://www.oreillynet.com/ruby/blog/2005/11/migrating_to_ruby_on_rails_and.html">http://www.oreillynet.com/ruby/blog/2005/11/migrating_to_ruby_on_rails_and.html</a>
</li>
<li>
<a href="http://www.postgresql.org/docs/current/static/index.html">http://www.postgresql.org/docs/current/static/index.html</a>
</li>
</ol><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-9058062597889392270?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com2tag:blogger.com,1999:blog-2136289839485858746.post-1317182570033052352007-09-07T16:54:00.000-07:002007-11-12T19:16:01.608-08:00Ruby on Rails: Reducing clutter in actions by placing common code in filters<p>This is a tiny but useful tip, that saved many lines of repeated code in my controllers, hence why not share it :) </p>
<h4>Do Not Repeat Thyself?</h4>
<p>If you've looked at the controller code that's generated by scaffolding, you'll find something like this:</p>
<pre>
def show
@user = User.find(params[:id])
end
def new
@user = User.new
end
def destroy
User.find(params[:id]).destroy
end
</pre>
<p>
Sure, in this case all we are doing repeatedly is instantiating the user by a potentially available parameter value. What if instead we placed these common fetches in a controller filter, which would simply set an instance variable for us? Hell, we could even handle exceptions (such as invalid ID) in only one place this way! What not to like.</p>
<p>When dealing with a more complicated route that has been defined, this instantiation may become quite a bit more elaborate, and the case for a filter is even more justified. </p>
<p>Consider the case of building a collaboration system where you have projects and individual contributions under that project, as well as a producer of the project. We might want to support all project operations under a URL that looks kind of like this:</p>
<code>/user/kigster/projects/MyVacation/contribution/view/34</code>
with a corresponding route in the <em>config/routes.rb</em> file:
<pre>
# project management route
map.connect '/user/:username/project/:project_name/contribution/:action/:id',
:controller => "contribution"
</pre>
<p>Based on the route defined, Rails would create params[:username], params[:project_name] and params[:id] for contribution id, in addition to the standard action/controller pair.</p>
<p>Now imagine that the controller we are writing has many actions, such as add, edit, view, list, append, preview, post, comment, etc. All of them could use a handle on the project, it's producer and contribution instances. Ideally - in @project, @producer_user and @contribution respectively.</p>
<p>If we followed the scaffolding example, we'd simply add appropriate lookups at the beginning of each action. But that's a lot of repeated code! </p>
<p>So let's use filters instead, to get our common lookups under control.</p>
<pre>class ContributeController < ApplicationController
before_filter :setup_project
def home
# do stuff
end
private
def setup_project
@producer_user =
User.find_by_username(params[:username])
@project =
@producer_user.produced_projects.detect do |p|
p.name.downcase.eql?(params[:project_name].downcase)
end
@contribution =
@project.contributions.find_by_id(params[:id])
return true
rescue Exception => e
logger.info "can't show project:", e
flash[:error] = e.message if e
redirect_to :controller => "home" and return
end
end
</pre>
<p>This is short and elegant, and now every action in this controller (which is not excluded for setup_project filter) will have access to our instance variables. Groovy!</p>
<h4>Issues</h4>
<p>Of course nothing is free, and in this case we are potentially loosing performance. Perhaps some actions don't need to know the @producer_user. We'll be fetching it all the time, which saves time for us - developers. If performance problems occur because of extra unused fetches the filter can be broken up or optimized. Until then - it sure saves me a headache.</p>
<p>That's it!</p>
Thoughts, comments?<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-131718257003305235?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com3tag:blogger.com,1999:blog-2136289839485858746.post-28442430263383865852007-08-27T16:52:00.000-07:002007-11-12T17:45:19.672-08:00Mac OS-X tips: How to run SSHD on an alternative port<p>
This tip falls into one of those "I had to spend more than 10 minutes looking for an answer" category, so it's a worthwhile subject for a quick blog post.
</p>
<h4>
Why Run SSH?
</h4>
<p>
Running SSH on Mac OS-X allows you to login to your machine remotely, and also copy file securely via SCP command to and from your Mac OS-X host. </p>
<p>
<strong>But I am behind my own $50 router/firewall. Can I still connect to my computer from outiside?</strong>
</p>
<p>Yes. Most off the shelf routers and firewalls will allow you to do two things that are needed for this:
</p>
<ol>
<li>Assign a permanent IP address to your Mac on a local network (see your router documentation for more details)
</li>
<li>Create a port forwarding rule on your router. Eg - any request to port 22 on your external IP (provided by your router) can be routed to the specific IP address of your Mac. Exact specifics on this configuration are once again available in your router documentation. Most off the shelf routers support this, including basic Netgear and D-Link.
</li>
</ol>
<p>
So let's assume you've set this whole thing up and you are now able to connect from outside to port 22 of your external IP address on your firewall, which is then routed to your Mac port 22. This is great, since now you copy files via SCP from the internet to your computer, connect to it from your work office, etc, etc.</p>
<p><strong>But why would you want to run SSH on alternative port, and not 22?</strong></p>
<p>Simple answer is that port 22 is probably the most obvious port to "probe" from outside. Hackers typically run automated port scans of publicly visible IP addresses, but running it for all 64K ports takes a long time, so typically those scans are just for a small subset of ports. Port 22 is a clear indication of a server system which makes it a likely candidate for an attack. Turn of port 22 and to the outside world your system appears a lot more boring. Boring is good. So I still want to use my SSH connection, but would rather not do it on the default port. More expensive firewalls and routers will allow you to route eg. port 33333 from the outside to port 22 on the inside. But none of the cheap off-the-shelf routers I've seen allow you to do that. They just take input port, and destination IP which means the outside port and inside port must be the same. That's a silly limitation and a small bummer. So to make this work with my cheap a$$ router I have to change the listening port on my Mac. Frankly, this isn't a bad idea either, since whenever you connect your laptop to a public wi-fi network anyone can directly connect to your Mac and probe the open ports. So keeping port 22 open on your Mac is not that great of an idea. So. In order to change the port on Mac OS-X for your SSH daemon, follow the following steps:
</p>
<ol>
<li>Open Terminal and as edit the file /etc/services (as root)
</li>
<li>Add a line at the bottom: <code>secret-ssh 43539/tcp # secret SSH port</code>
</li>
<li>Edit file <code>/System/Library/LaunchDaemons/ssh.plist</code> and replace the code:
<pre><key>SockServiceName </key>
<string>ssh </string>
</pre>with
<pre><key>SockServiceName </key>
<string>secret-ssh </string>
</pre>
</li>
<li>Change your port forwarding configuration on your firewall to route port 43539 instead
</li>
<li>Open "Sharing" control panel and ensure that "Remote Login" is checked off (if not uncheck it). Then check it again to start with the new configuration.
</li>
</ol>
<p>
Now you should be able to run SSH command to your external IP as follows: <code>ssh -p 43539 ip_address_of_your_server -l username</code> To copy files from remote hosts to your Mac desktop, run the following command:
</p>
<pre>scp -P 43539 local_file.txt username@ip_address_of_your_server:~/Desktop</pre>
<p>
Note that "scp" command requires an upper case "P", while regular "ssh" wants a lower case "p" to declare remote server's port. That's it, hope it helps! :)
</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-2844243026338386585?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com9tag:blogger.com,1999:blog-2136289839485858746.post-55621739756494903202007-07-02T16:50:00.000-07:002007-11-11T00:58:40.490-08:00New laptop and it's a showoff: G5 vs IntelAs I left my most recent permanent job for a private gig, I had to get myself my own new laptop. Of course the machine had to be a Mac, but which one? A laptop? Desktop? I decided on laptop since it's so much more portable and I do contracting. But then - 17" or 15" and what specs, and should I shell out for a brand new model, or get the older one cheaper?
To cut the long story short I went for the top of the line, most recently upgraded model of 17" MacBook Pro, with 2.4Ghz Intel Core Duo processor, 7200RPM 160Gb drive, 2Gb of RAM and a hi-resolution 1920x1200 screen. This machine on Apple store costs $3800 (with tax and apple care), but I managed to save more than a third by buying it from a dude on Craigslist.
My first impression - wow! The screen is so incredible, there are so many pixels that a window dragged when onto my older SyncMaster 23" screen looks twice as large! That's because 23" screen has only 1600x1200 resolution, but the laptop packs 1920x1200 in a 17" screen. Even upgrading to 1920 pixel wide screen would still not be adequate since each pixel would be larger than on a macbook. Gotta get used to this zooming effect :)
That minor inconvenience aside, I decided to run some basic tests on my older PowerMac Dual 2Hgz G5, with 1.5Gb of RAM and thought it'd be fun to share it here:
Test #1: Compile ruby interpreter from scratch:
<ul>
<li><b>17" MacBook Pro 2.4Ghz Intel Core Duo:</b><pre>real 1m3.398s
user 0m45.229s
sys 0m15.373s</pre>
<li><b>PowerMac Dual 2Ghz G5:</b><pre>real 2m0.422s
user 1m28.266s
sys 0m29.412s</pre></ul>
I'll add more tests as I run them, but to see an almost 2x difference between 2 year old PowerMac and a new MacBook is simply amazing. Can't wait to start using the laptop for music!
Meanwhile, PowerMac is available for sale for $1000 :)
Laterz!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-5562173975649490320?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0tag:blogger.com,1999:blog-2136289839485858746.post-69621846439847825172007-04-24T16:46:00.000-07:002007-11-12T17:47:25.428-08:00Half moon, Black moon, 14.5%-something moon "Pah Tee"...<p>
My blog has been silent for a while now for no better reason than me being on a much anticipated and needed vacation. Telene and I managed to sneak out for a whole month of April, and spend a few days in Tokyo doing typical touristy things, before venturing off to our final destination - Thailand.
</p>
<p>
We haven't really had too much planned out, but one thing we knew is that we wanted rest - beach, sun, water, lots of sleep and massage. As our vacation is nearing the end (and I am writing this from Thailand), I can assure that all of those things we have thus far successfully achieved. And much more.
</p>
<p>
Most of our trip we ended up spending on the island of Ko Phangan - where the <a href="http://www.fullmoon.phangan.info/">famous monthly full moon party</a> happens on the beach. We are missing the full moon party, but this is not a big deal because every other phase of the moon is celebrated here with just as much fervor and scale, if perhaps by a smaller crowd. Which is actually a good thing, considering that full moon party gets up to 30,000 people (I don't believe these numbers, I'd say it's probably around 10,000 - there's just not a lot of space here for 30,000 people, it's a pretty small island!).
</p>
<p>
Tonight we are going to check out Half Moon party - it happens in a particular spot in the jungle that's specially outfitted for these parties: there are supposedly two "rooms", cheap massages, multiple bars, even a "chill space" of sorts. There's definitely no shortage of understanding how to professionally throw a party here, but what is lacking is the community feel of a true party scene I am so used to in the Bay Area and Europe. The parties are thrown and organized mostly by local Thais, and attract mostly tourist crowd (although many locals that work at our hotel promise to come too to have fun). The result is that it is a tourist version of rave culture, just as local restaurants serve Italian pizza, they also serve Goa trance - it's mostly the same, but not quite. On the platter, for 300 baht per person, with all amenities and one drink included. But something is also seriously lacking, judging from the three parties we went so far - black moon, the other half moon on Ko Samui, and out-of-moon-phase party in some new location which kind-of tanked, with only 50 people attending at best.
</p>
<p>
One problem is the attendance - there are just too many "out-of-place" british dudes in shorts that you would never see at any similar event elsewhere. They come to Ko Phangan as the party place to be, which is cheap and you can score (in more ways than one). As the parties happen, they go where the chics go and inevitably end up at the party. You can spot them because they are wearing all white and baseball caps, standing with beer or buckets in the middle of the dance floor and loudly (very loudly) talking over the music about some British soccer crap.
</p>
<p>
Another problem is the music itself. What could really spice up local party scene is more diversity in genres: we've heard predominantly psy trance here at the parties, some of it pretty good, but also some really outdated. Tonight's party promises house and breaks in the first few hours on the flyer and we are seriously looking forward to that. We've heard some house tunes here in local bars, and with the exception of one particularly good DJ we met from the UK (Dj Silver), locals really don't get house as much as they <strong>get</strong> psy-trance. It must be the hot climate, and it's indian / goa influences and origin that appeal here, much more than Latin or Caribbean house tunes. It could also be that Thailand happens to be one of the most popular destinations for Israelis, and everyone knows that Israelis pretty much only love goa. But enough on the party subject...
</p>
<p>
<a href='http://tektastic.files.wordpress.com/2007/04/beach_fuck_off.jpg' title='On The Subject Of Bad Tattoos'><img src='http://tektastic.files.wordpress.com/2007/04/beach_fuck_off.jpg' alt='On The Subject Of Bad Tattoos'></a>
</p>
<p>
Besides being entertained by really stupid tattoos that belong to British, Scandinavians and Israelis, we indulged in a very comfortable living on a luxury resort with a beach-front pool and a bar, attending to local mini parties in the jungle and on the beach, riding mini dirt bikes around the island and exploring it's attractions (one of my favorites was archery - turns out I can actually shoot with a bow and arrow! My young undying love of Robin Hood has finally grown into something that's not going to pointlessly raise eyebrows in the Castro :). We also did some elephant trekking, snorkeling, socializing, reading and even power yoga (which at air temperatures in mid-30's Celcius is not far from Bikram yoga). If the goal of a good vacation is to slow the time down, then we are definitely on the right track.
</p>
<p>
There will be plenty more blog entries about stuff we've seen and pictures we took, but for now this will do. Once thing for certain, is that no matter how great the place is we always seem happy to go back home. We just can't help but love San Francisco. And what's there not to love? :)
</p>
<p>
Adios until the next post, Konstantin from Ko Phangan.
</p><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-6962184643984782517?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0tag:blogger.com,1999:blog-2136289839485858746.post-89986553459017132832007-02-20T16:45:00.000-08:002007-11-10T16:45:49.641-08:00The KORE arrivesIn a quest to bring my soft synths up to date, I took up Native Instruments offer to upgrade my entire NI Complete collection to their latest and greatest, for free - after I buy the <a href="http://www.native-instruments.com/index.php?id=kore_us">KORE</a> - their midi/audio hardware interface and controller.
The KORE arrived today, and I played with it a little using my old synths, but I couldn't take full advantage of the KORE without using their preset library (which apparently contains 10,000+ sounds). I couldn't use the presets just yet, because they are all for the upgraded versions of the instruments, which I don't have until the DVDs arrive with KOMPLETE 4 I can't do much with this beautiful piece of gear.
Stay tuned for a proper review. Can't wait till it's all here and working.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-8998655345901713283?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0tag:blogger.com,1999:blog-2136289839485858746.post-71780810524925051402007-01-24T16:43:00.000-08:002007-11-10T16:44:32.400-08:00We been representin'!So recently I had a really fun experience working at the <a href="http://www.blurb.com/">Blurb</a> (the company I work for) booth at <a href="http://macworldexpo.com/">MacWorld</a>, where the booth was bombarded with non-stop attention. We felt sorry for the booths next to us, some of which had a hard time luring people in, while for us the problem was that of survival - how to you survive five+ hours of talking about your product, with tiny water and bathroom breaks in between, and many eager visitors waiting for your attention.
<img src='http://tektastic.wordpress.com/files/2007/01/kig_macvoices.jpg' alt='Talking about Blurb at MacWorld, San Francisco, 2007' style="float:right;margin-left:15px;"> Of course it is awesome to see your company and product be so timely and successful, and so many people excited about the possibilities it offers. As a software engineer you don't often get to talk to the users, witness their pain or glory, you just get to hear about it from a distrgruntled customer service rep who gets all the blame, or a from a marketing person who gets all the glory. So this was certainly refreshing and energizing experience.
At some point in the day I was approached by someone with a request to take a quick podcast interview, and as it recently went up live, here is the link where you can listen to yours truly talk about Blurb offering - <a href="http://www.macvoices.com/wordpress/macvoices-721-macvoices-at-expo-blurb-delivers-personal-book-publishing-options/">MacVoices PodCast Interview</a>.
If you are interested in self-publishing business, make sure to scan through Blurb's own blog - <a href="http://www.blurberatiblog.com">Blurberati</a>.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-7178081052492505140?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0tag:blogger.com,1999:blog-2136289839485858746.post-81738501540683203682007-01-13T16:42:00.000-08:002007-11-12T18:06:25.210-08:00Oh Firefox, why aren't thou working?Oh Firefox, why aren't thou working?<br>
Once in a while, you stop responding.<br>
My keyboard types, my fingers stomping...<br>
But you're ignoring our bonding.<br><br>
We've had so many joyful years<br>
Together - sharing laughter, tears<br>
Despise for impotent Explorer<br>
The fear, the weakness and the horror.<br><br>
And now look at what you've done<br>
You've turned yourself into a pun<br>
A joke on browsers and alike<br>
I can't go on with this last strike.<br><br>
And so I am leaving for another<br>
Her name's Safari, and she'd rather<br>
Be there, when I need her most.<br>
I am sorry. Our love is lost.<br><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-8173850154068320368?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0tag:blogger.com,1999:blog-2136289839485858746.post-42863079232051827902006-12-06T16:38:00.000-08:002007-11-12T17:48:22.026-08:00Ruby on Rails: How to load session objects into console<p>This took a little bit of poking around, so I decided to post it here.</p>
<p>Basically I was tracking down a bug, which resulted in a corrupt object (cart) in the web session. So I thought, it would be nice to play with this object in the console to see what's up... But how do I get it in there? </p>
There may be a more elegant way to do this but here is how I got it to load:
<ol>
<li>Look in tmp/sessions and find the most recent file (ls -alrt on UNIX). Let's say the file is called 'tmp/sessions/ruby_sess.8eb9614a7e4e1e3b'
<li>Open console and type:
<pre>
>> session = Marshal.load(File.open('tmp/sessions/ruby_sess.8eb9614a7e4e1e3b'))
=> {"hash"=>{:cart=...
>> cart = session["hash"][:cart]
....
</pre>
In this case I was trying to access a cart object in the session, which was placed in the session with:<code>session[:cart] = Cart.new</code>
</ol>
That's it!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-4286307923205182790?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com2tag:blogger.com,1999:blog-2136289839485858746.post-44730990946849374202006-12-04T16:38:00.000-08:002007-11-10T16:41:27.626-08:00Wanted: 11.3Tb flash drive to move house to a new locationIsn't it just great that these days you do not need a truck to move stuff? As long as the stuff you are moving is digital.
I was thinking that in a pretty near future each house may include a giant mass storage that holds everything we own which can be digitized. Such are the books, photos, personal documents, bills, music, etc. All of those things are already available in a digital form, but what about furniture, kitchen counters, decorations, paintings, or the super-heavy piano for god's sake?
What if... the house of the future is a completely configurable and intelligent hardware device that can reconfigure itself to it's owner's liking and create those items entirely from it's own supply of materials? What if the paintings can be built into walls and show digitized image, books are digital single-page fold-out with downloadable content, furniture can be created from built-in modules...
Then - instead of moving your stuff you just have to download your existing house to the new house - and vola! It looks the same! Wouldn't that make moving easier?
Well, until the house is so intelligent that it can reconstruct itself to fit my personal furniture and layout needs, the digital move is limited to less extravagant things, such as music, documents, books and media. But that's already lots of really important stuff!
Which is why I think that the house of today should come with a built-in storage, that's remotely backed up and fully redundant. A built-in file server, just like a built-in washing machine. That's because just like everyone needs to wash dishes, everyone in this day and age also needs to backup their crap, and there's lots of crap to backup.
Go! - the digital movers revolution, just don't forget you can't microwave your hard drive.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2136289839485858746-4473099094684937420?l=tektastic.com'/></div>Konstantin Gredeskoulhttp://www.blogger.com/profile/15696255549758746527noreply@blogger.com0