Archive for the ‘Uncategorized’ Category

Random Rumblings

Saturday, July 11th, 2009

Was reading through my mailing lists and found this one in the Drizzle mailing list when talking about code styling for c++, pretty interesting read “Join Strike Air Fighter Vehicle C++ Coding Standards”

http://www.research.att.com/~bs/JSF-AV-rules.pdf

Another random musing when I was working on a rails project:
Even if your using the default environment for a cron job, you need to put RAILS_ENV=env /path/to/ruby etc…. in the command line for it to work (at least on CentOS)

Free Server Monitoring

Tuesday, April 14th, 2009

Do you want free server monitoring with only one simple script to run via cron Tired of all the hassle of settings up other systems….

I’m launching a new website soon that does all this, if you would like to be invited to try it out shoot me an email at josh [ at ] bluescripts [dot] net

Preview:

Rails remote IP address from behind a proxy

Tuesday, March 31st, 2009

Since I have a cluster of 3 mongrels running behind lighttpd the usualy request.env['REMOTE_ADDR'] wasn’t working …

what ended up working was request.env['HTTP_X_FORWARDED_FOR'] to get the users IP

Random Ruby Rumblings

Tuesday, March 3rd, 2009

I’m going to keep updating this post as I make some more findings about Rails that I think are pretty good assumptions a newbie should learn about:

Case 2, forms:
I made an array using split(“,”) in the controller, then in the view I was looping through and could puts them out fine, however the ultimate goal was to use them in a form. Basically I needed it to be name=”order[field_name]” name=”order[field_name_2]”

GOOD Code to do this:
<% for c in @customize_this %>
<%= form.check_box :"#{c}" %>
<% end %>

However I had originally gotten name=”order[c]” name=”order[c]” – basically the same thing for all items in the list…
The BAD code was this:
<% for c in @customize_this %>
<%= form.check_box :c %>
<% end %>

Best place to read more about it: http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html

Case 1, links:
Good: <%= link_to "#{item.name}", :action => “customize”, :id => item.id %>
Bad: <%= link_to "#{item.name}", :action => “customize/#{item.id}” %>

Ruby & Ruby on Rails

Monday, March 2nd, 2009

I’ve decided to finally tackle learning rails by developing my next project in it.

However I was setting up Ruby/Rails when trying to run gem install rails returned this error:

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require’: no such file to load — zlib (LoadError)

After I ran yum install zlib* and hit yes to the devel libraries, went back to ruby source, did make clean, ./configure, make, make install then switched to the ruby gem source and ran ruby setup.rb and then gem install rails worked fine.

Firefox Tunnel + MAC & Panera’s Fail

Sunday, February 22nd, 2009

ssh -ND 9999 user@host.com

Open firefox, network preferences under the Advanced tab, SOCKS proxy and set host to 127.0.0.1 and port 9999 close preferences and you’re all set to go.

– Addendum:

I was actually at Panera’s doing some work while I ate breakfast with a friend when I did this… I had planned on staying longer but apparently Panera’s doesn’t like customers buying lunch… I had planned on staying an additional bit past 12 to eat some lunch there but was promptly disconnected from the internet after 30 minutes of use (between 11:30AM and 1:30PM they block you after 30 minutes of WiFi).

Panera’s you’ve lost my business.

Follow me on Twitter!

Wednesday, February 18th, 2009

Thought I’d share this here…. anyone can follow me on Twitter:
http://twitter.com/Blue_Josh

WOW. No pun intended.

Sunday, February 8th, 2009

I honestly can’t believe this was allowed to air:
http://www.youtube.com/watchv=l-cy6dbeCPA

I feel like I just lost half my brain at the sheer stupidity of the reporter/report/insight.

BlueBug Features – Integration

Thursday, January 29th, 2009

I’m working on some new features for BlueBug and one of them is a bit of integration, for instance to link to a ClientExec support ticket you just do [ce]1234[/ce] where 1234 is the ticket ID. Each project can have it’s own CE URL. I’ve also done the same with GitHub so [git]commitID[/git] will open up the page for the commit.

Would anyone like to see more If so what program (if its commercial please give me an example URL).

BlueSocket Wifi Auto Login

Wednesday, January 28th, 2009

On campus they use BlueSocket as a WIFI manager…. I got tired of waiting for the browser to load their nasty redirect page to login so I wrote a simple python script to automatically log me in, just execute and your good! (only tested on MAC)

© 2008 Josh Rendek.