astrails-safe 0.2.7
January 21st, 2010
There is a new (0.2.7) version of Astrails-Safe.
New features since 0.2.5:
- default options for gpg now include '--no-use-agent'
- support for 'command' option for gpg
- quote values in mysql password file
- add 'lib' to $:
- [EXPERIMENTAL] Rackspace Cloud Files support
There is no magic, indeed.
January 14th, 2010
I’ve just read ”Do You Believe In Magic?” and the following quote resonated particularly well:
“It’s not magic. There is no magic involved. It’s just, if you never learnt Lisp, then you never learned to program, and Ruby’s power is exposing a deficiency in your skills.”
I find it to be very true, and I suppose one of the reasons I’m so happy about Ruby is that I learned Lisp and Scheme before.
Even though I didn’t use Lisp for any sizable project. I tried, but I found it to be quite unfriendly and ‘hairy’ in setup, environment and library support. Ruby solved all that for me w/o sacrificing almost anything power vise.
JobTheJob starts the startup
December 16th, 2009
The opportunity: 120 happy dreamers cooking for 54 hours of pure startup joy, well-fed and ready to work. Of course, I’m talking here about Startup Weekend Israel.
The challenge: Come up with an idea that can be implemented in a couple of days, yet is so cool, so innovative, and so useful that I could attract the best of the best.
Read the rest at blogtheblog.jobthejob.com
P.S Now we have some pictures too there, you should check it out
Job the Job
December 16th, 2009
If you follow us on twitter (@astrails if you wondering) you already know that we are at the Startup Weekend Israel right now.
Which is going amazing by the way, thanks for asking, lots and lots of nice people, very creative and energetic atmosphere, food and beer.
Turns out our idea attracted a great team of developers, designers and business developers.
Read the rest of this entryStartup Weekend Comes to Israel
November 22nd, 2009
Startup Weekend comes to Israel.
The event will take place at IBM offices in Petch Tikva from Dec-16 to Dec-18. We are going to participate and also sponsor the event.
Startup weekends are known to be a good place to network with all those startup people, like enterpreneurs, VCs, lawyers, developers and designers.
Israeli event seems to be kosher, so it’s not exactly a weekend: Wed - Fri :-) Grab your discounted ticket using discount code swearlybird, and as they say you should bring “laptop, good attitude, and creative energy” there.
Follow Startup Weekend Israel tweets to stay updated.
We will tweet our impressions and blog about them here.
Looking forward to have some geek fun.
Read the rest of this entryCassandra on OSX
November 12th, 2009
We just started a project for a client that involves Cassandra.
If you’ve been living under a rock and don’t know what Cassandra is let me tell you :)
Cassandra is a “second-generation distributed database” that was built for web scale. Its is one of the many distributed nosql databases that appear everywhere lately like mushrooms after a heavy rain :).
What sets Cassandra apart is that it comes from a recognizable entity - Facebook.
But I digress. This is not meant to be a Cassandra introduction, there are enough of those on the net. I Just created a new nosql section on this blog where I’m going to post various tidbits of information about cassandra (and probably others) as I learn them while working on this new project.
Here is the first one:
Cassandra gem is just an installer
If you are on Mac OSX and interested in Cassandra you probably know that its just a gem installation away (almost):
gem install cassandra
First thing to note though is that this will not install Cassandra. It will install cassandra installer! I got bitten by this when I took my laptop with me to my doughter’s dancing class. You see, parents are not allowed “in the room” to not interfere with the process :), so I have 45 minutes to find myself something to do each time. I installed cassandra gem at home and intended to play with Cassandra while there. Not so fast. When I run cassandra_helper cassandra which is supposed to start a test cassandra instance it went to connect to a github repository to download and install the actual database. Duh!
and the 2nd one:
Use java preferences
When I got back and finally built Cassandra I got the following message when starting it for the first time:
~ > cassandra_helper cassandra
Set the CASSANDRA_INCLUDE environment variable to use a non-default cassandra.in.sh and friends.
(in /Library/Ruby/Gems/1.8/gems/cassandra-0.5.6.2)
You need to configure your environment for Java 1.6.
If you're on OS X, just export the following environment variables:
JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home"
PATH="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin:$PATH"
First thing to note is that just typing JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home" in the terminal wont help.
You need to export it:
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home"
PATH="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin:$PATH"
No need to export PATH as its already exported.
But there is a better and simpler way!
Start “Java Preferences” (find it in /Applications/Utilities, or just use spotlight):

Then reorder the entries in the bottom “Java Applications” section so that Java 6 will be the 1st:

Now cassandra starts right away w/o any exports:
~ > cassandra_helper cassandra
Set the CASSANDRA_INCLUDE environment variable to use a non-default cassandra.in.sh and friends.
(in /Library/Ruby/Gems/1.8/gems/cassandra-0.5.6.2)
CASSANDRA_HOME: /Users/vitaly/cassandra/server
CASSANDRA_CONF: /Library/Ruby/Gems/1.8/gems/cassandra-0.5.6.2/conf
Listening for transport dt_socket at address: 8888
...
Cool, now go write your killer application!
Let my controller go or useful impurity in software design.
October 27th, 2009
Yeah, I know, MVC is the “Only True Way”. But sometimes, just sometimes, you need your link_to or html helpers working in the model.
For example, sometimes the cleanest way to implement something is to have to_html in the model (widgets anyone?).
Doing this will most probably require generating some urls, and you need a controller for that.
Usually I solved this by passing controller to the to_html function, but it always felt wrong.
astrails-safe 0.2.5
October 21st, 2009
Just released a new 0.2.5 version of astrails-safe.
“astrails-safe” is our very simple to use backup script for mysql, postgres, filesystem, and subversion. It can store your backups locally, on Amazon s3 or on a remote SFTP server. Optional GnuPG enctyption completes the picture.
Changes in this version
Thanks to Fedor Kocherga for spotting that astrails-safe would happily overwrite existing config settings if you used same configuration keyword more then once. For example if you used 2 exclude lines in your backup config the 2nd one would overwrite the 1st. Fedor’s fix was merged and now astrails-safe will either merge the configs for files, exclude, and skip_tables keywords and will stop with an error for the rest of the keywords.
New version is available in source form on GitHub and as a ready to install gem on Gemcutter.
astrails-safe-0.2.4 - dry run fix, move to gemcutter
October 9th, 2009
Since Github stopped to build gems we are moving to the gemcutter.
Changes in 0.2.4 since 0.2.2:
- fixed couple of README errors (thanks Bobby Wilson)
- changed name from ‘safe’ to ‘astrails-safe’ due to the move to gemcutter
- added missing net-sftp dependency to the gemspec.
- fixed bug where it would crash in a dry-run since local storage didn’t update some internal variables.
To install the latest version:
gem install astrails-safe --source http://gemcutter.org
astrails-safe-0.2.2 - sftp, timing + another rotation bugfix
October 9th, 2009
Damn, I just found this unpublished article in the blog admin…
How come it evaded my attention for 3 months??!!
Anyway, releasing it now thought this is all quite old news, going to announce 0.2.4 in a moment :)
There is a new 0.2.2 version of astrails-safe on github.
If you don’t know it yet astrails-safe is an easy to use backup solution for Unix like operating systems. It supports filesystem, mysql, postgresql, subversion backups to local filesytem, Amazon S3 and remote SFTP.
Read the rest of this entryHow to fix a hosed /etc/sudoers file on Mac OSX
September 29th, 2009
I just did something pretty stupid. I edited /etc/sudoers file directly from within my non-root user account.
I did
sudo vim /etc/sudoers
and added the following to it:
Cmnd_Alias GEM_INSTALL = /usr/bin/gem install *
Cmnd_Alias GEM_UNINSTALL = /usr/bin/gem uninstall *
vitaly ALL=NOPASSWD GEM_INSTALL
vitaly ALL=NOPASSWD GEM_UNINSTALL
The intention was to grant myself permissions to install gems w/o entering password. I know its insecure, but this is security-vs-convinience kind of thing and I only intended to leave it there for a couple of hours while I do some heavy gem development.
Anyway, experienced unix users might have spotted the syntax error in my sudoers edits. I forgot the “:” just after the NOPASSWD. But the problem is even more basic then that. I shouldn’t have beed editing the file directly. I should have known better. And now I’m paying the price:
$ sudo
>>> sudoers file: syntax error, line 36 <<<
>>> sudoers file: syntax error, line 37 <<<
sudo: parse error in /private/etc/sudoers near line 36
$ sudo vim /etc/sudoers
>>> sudoers file: syntax error, line 36 <<<
>>> sudoers file: syntax error, line 37 <<<
sudo: parse error in /private/etc/sudoers near line 36
OOPS!
Now the sudoers file is broken and I can’t even fix it since I was using sudo to edit it! Never do that! :) Use the visudo command. it will check the file syntax before ‘commiting’ it.
Now what?
I looked at the net and the general consensus is that you need to boot into a single-user mode to fix it. I really really didn’t want to do it. I have 4G of RAM and so I’m usually running dozens of programs and its a pain to close and reopen them all after boot. I’m lazy :)
Then I thought there might be a better way.
First I checked the permissions on the sudoers file:
$ ls -l /etc/sudoers
-r--r-----+ 1 root wheel 1302 Sep 28 17:20 /etc/sudoers
and only ‘root’ is in the group wheel, so no luck here.
I also couldn’t ‘su root’ since my root user doesn’t have a password. duh!
But then it appeared to me that I might be able to circumvent this protection by leveraging my OS X ‘admin’ status. After all it ought to count for something :).
I opened “/etc” folder in finder (“Go” -> “Go to Folder…”), then opened sudoers file properties. Opening the lock there doesn’t require to be a root. Its enough to be an Admin and my Admin user does have a password! So I was easily able to grant myself permission to edit the file:


after that I just edited the file with vim again to comment the edits
vim /etc/sudoers
Then I did what I was supposed to do from the beginning, I used the ‘visudo’ at last:
sudo visudo
Last thing was to restore original permissions on the file in finder.
DONE
Javascript Widgets. Part 1. Popup/Popin Widgets.
July 28th, 2009
This is going to be the first part of a blog post series about javascript widgets.
First type I’m going to cover is Popup Widget. Sometimes it’s called Popin Widget because there is no actually new window that pops up, instead the content is shown IN-side a current page. The idea is quite simple: you provide some html/js snippet to other sites. They put it into relevant place, and you have some functionality of your site running there.
I’m going to explain how exactly it works, what should be done to achieve this, and what common mistakes i see once and again.
At the end of the blog post you will get a link to complete javascript library, grab it, play with it, and use it for fun or profit.
Read the rest of this entryClicktale + Rails = Better Usability
June 3rd, 2009
Clicktale is a service that allows you to record and later playback behavior of your users while they are using your site. And Rails is Rails, you know. And those two are getting along just fine, until the user logs in. After that clicktale service is cut out of the html pages this user gets and can’t record the session. But it just started to get interesting…
This plugin brings back the connection between Clicktale and Rails even for those closed pages. You’re going to get your better usability after all.
Read the rest of this entryAstrails-safe: 0.1.9 - BUGFIX release
May 22nd, 2009
I just pushed new version 0.1.9 of astrails-safe to github.
The main difference is a fix to an embarrassing bug in the S3 backup rotation code. Thanks to Thuvarakan Tharmalingam for reporting.
Again, the reason it escaped was the fact that we don't yet have full test coverage. We are getting there though....
It looks like our astrails-safe gem is quite popular :). People started to contribute new features:
- Mark Mansour contributed PostgreSQL backup support
- Richard Luther contributed Subversion repository dump support
I just released new version 0.1.8 on the github.
In addition to postgre/svn support this release also includes a long overdue test suite.
Read the rest of this entry