AddThis

Thursday, September 20, 2012

Cygwin and Ruby

When developing on Windows, I don't truly feel at home until I install cygwin.  I don't know how I'd live without the great command line tools like grep, less, vi, find, wc, diff, the list goes on and on.  Sure I could find Windows equivalent and dl them all, but cygwin gives it all to me right away in one place.

So when developing in Ruby, I wanted something compatible with cygwin.  I had previously installed Ruby in Windows and relied on cygwin finding the Ruby executable when I ran my Ruby code.  This is fine for just using Ruby, but when I wanted gem and irb, I was SOL.  I had to install from source.  Luckily, this was super easy:

  1. Using the cygwin setup, install make, gcc, libiconv, openssl, libyaml-devel, zlib, zlib_devel and wget.
  2. Then navigate to http://ruby-lang.org/ and grab the url for the source of ruby that you want to install and wget it.
    1. wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
  3. Then untar it and cd into the ruby* directory
  4. Run ./configure
  5. Run ./make
  6. Run ./make install
  7. Then test it!  
    1. which ruby and it should be something like /usr/local/bin/ruby
Now you have ruby, gem, irb and all the rest.


Tuesday, August 21, 2012

Heroku Weirdness


I love Heroku.  I love the ease and simplicity.  But today, as in right now at 4am, I have been dealing with this horrible issue for HOURS.  I was having tons of problems with any heroku db tasks that I was trying to execute.  I couldn't migrate nor could I check the version.  And everytime I ran those commands, the console would hang.  It made no sense!  I tried all sorts of random things that I don't even want to get into.  Finally out of desperation, I upgraded my heroku cli.  And not from the friendly heroku update (which wasn't working for me), but from actually installing it from https://toolbelt.heroku.com/.

FINALLY that worked.  The problem was that the heroku command was out of date and whatever magic incantation it was issuing, was different between my version (2.26.0) and the latest (2.30.3).  ARG!!!  I guess I would have expected a message like, "Your version of the heroku cli is out of date, please update it."

So I'm posting this in hopes that if someone out there encounters this, they'll save hours of banging their head on the desk.

Alright before I go quick review of heroku commands:


DB
-----
Migrate:          heroku run rake db:migrate
Reset:            heroku pg:reset
Check Version:    heroku run rake db:version


Check Status
------
ps:               heroku ps
logs:             heroku logs
scale (2 web and 1 worker): heroku ps:scale web=2 worker=1


Restart
-------
Restart app:      heroku restart
Restart worker 1: heroku restart worker.1


There are a bunch more but those are the ones I use more often so hopefully it'll help you out as a quick reference.

Friday, August 17, 2012

Eclipse Aspectj Classpath

Just ran into this, the aspectj maven dependency was being ignored and not added to the classpath in eclipse after I ran: mvn eclipse:eclipse Silly problem with an easy solution: http://robbypelssers.blogspot.com/2010/02/aspectj-dependencies-are-skipped-by.html maven-eclipse-plugin 2.7 none

Tuesday, August 7, 2012

Console2

Not sure if I mentioned this post, but I always find myself going back to it to reconfigure Console2. http://www.hanselman.com/blog/Console2ABetterWindowsCommandPrompt.aspx

Monday, July 2, 2012

On Second Thought

After much consideration, my Thought of the Days will stay on gchat and twitter. My random musings are quick and often too brief to deserve an entire post. As such, make sure to check out @jonnyman9 on the twitter!

Thursday, June 28, 2012

Thought of the Day Thoughts

I used to post daily "Thought of the Day" back when AIM was still popular. I would then archive them so I could read them later and chuckle. I've since lost them all and with AIM not as popular, I've have stopped posting. But recently I've decided to try and get back in it on my gchat status and to archive them, I'll save them here in the form of posts. So hopefully this is the first in a series of them. Thought of the Day: Courtesy of Cheryl, actually the girl in the article actually reminds me of Cheryl. The article really makes you think though. How often does jog by groping really occur? Is this a real problem? Or is this just one of those crazy Canadian things? Something to think aboot. http://www.torontosun.com/2012/06/23/woman-gives-gropers-a-kung-fu-beatdown

Wednesday, June 13, 2012

Random Stuff With Tomcat and Applets

Lately I've just been blogging about random things that I learned or use that I think others would find helpful. I'll try and have more insightful things up later, but for today, here's more random crap I used today!

Tomcat Server

Use more debuggery.  Should be easy with Tomcat7 right?  Shocker, it is.
1.  cd $CATALINA_HOME #that's the tomcat home
2.  vi bin/startup.sh
On the first line (after their comments) just drop in

export JPDA_ADDRESS=8787
export JPDA_TRANSPORT=dt_socket

Now at the bottom, comment out

#exec "$PRGDIR"/"$EXECUTABLE" start "$@"
and add in 
exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"

Terrific, are we done?  Yes.

Linux Distro

I was also using a random linux server today and couldn't figure out what distro it was.  A quick:
cat /etc/issue 
solved that one real quick for me.
Red Hat Enterprise Linux Server

Applet JVM Args

Gah, applets.  Can't believe I'm working with them.  How the hell do you pass jvm args into these damn things??  Turns out you have to set a system env variable

_JPI_VM_OPTIONS='-Xdebug -Xrunjdwp:transport=dt_socket,address=8788,server=y,suspend=y'


You gotta restart your browser though.  But now, when my applet runs, it'll sit and wait for me to connect my debugger to it (b/c of the suspend=y).



*I hope you never ever have to do applet development and never have to use this