Monday, December 10, 2012
Monday, December 3, 2012
Sunday, December 2, 2012
Taken from http://neophob.com/2007/04/gnu-screen-cheat-sheet/
Basics: –ctrl a c -> create new window –ctrl a A -> set window name –ctrl a w -> show all window –ctrl a 1|2|3|… -> switch to window n –ctrl a ” -> choose window –ctrl a ctrl a -> switch between window –ctrl a d -> detach window –ctrl a ? -> help –ctrl a [ -> start copy, move cursor to the copy location, press ENTER, select the chars, press ENTER to copy the selected characters to the buffer –ctrl a ] -> paste from buffer How to start screen: –screen –DR -> list of detached screen –screen –r PID -> attach detached screen session –screen –dmS MySession -> start a detached screen session –screen –r MySession -> attach screen session with name MySession Advanced: –ctrl a S -> create split screen –ctrl a TAB -> switch between split screens If you created a new split screen, the current window is empty. either select an existing window (ctrl a ”) or create a new split screen (ctrl a n). –ctrl a Q -> Kill all regions but the current one. –ctrl a X -> remove active window from split screen –ctrl a O -> logout active window (disable output) –ctrl a I -> login active window (enable output)
Thursday, November 29, 2012
$ rake ts:start Failed to start searchd daemon. Check ../log/searchd.log. Failed to start searchd daemon. Check ../log/searchd.log Be sure to run thinking_sphinx:index before thinking_sphinx:startAlmost always is the case for me that searchd is already running / orphaned and needs to be killed. Run
$ps -ax | grep searchdshows that its already running
49630 ttys000 0:00.06 searchd --pidfile --config ../config/development.sphinx.conf 49644 ttys001 0:00.00 perl /usr/local/bin/grep searchdand kill it
$kill -9 49630Voila!
Friday, November 2, 2012
Is there a way through which I see which mysql queries are fired from ActiveRecord in rails console?
Yes, this can be achieved through redirecting rails log to standard output. Write these at your console prompt: ActiveRecord::Base.logger = Logger.new(STDOUT) ActiveRecord::Base.connection_pool.clear_reloadable_connections! Furthermore, you can put these lines in ~/.irbrc file, so that each time you don't need to manually write these 2 lines: require 'rubygems' if ENV.include?('RAILS_ENV') && ENV["RAILS_ENV"] == 'development' ActiveRecord::Base.logger = Logger.new(STDOUT) ActiveRecord::Base.connection_pool.clear_reloadable_connections! end
Wednesday, August 22, 2012
Tuesday, August 14, 2012
Friday, August 10, 2012
Sunday, May 20, 2012
Wednesday, May 9, 2012
If you're crashing on the splash screen right after it the RMI initialization message try passing the -noRmi flag to mimo.exe. In the start menu right click on Mimo, select properties, and add the flag to the target. Mine looks like this:
"C:\Program Files (x86)\Mimo\Mimo.exe" -noRmiYou should see an "RMI Disabled" message on the splash screen.
As of this writing the x64 version of the Oracle Instant Client do NOT work with OSX Lion. I got everything working like so:
Install Oracle Instant ClientInstall the 32 bit version of the Oracle Instant Client. Download and install the following packages to /usr/local/oracle/instantclient_10_2
Install the 32-bit version of Ruby
brew install libyaml
rvm install 1.9.3 -n i386 --with-arch=i386
rvm use ruby-1.9.3-p194-i386
BashAdd the following to your .bash_profile
export DYLD_LIBRARY_PATH="/usr/local/oracle/instantclient_10_2" export TNS_ADMIN="/usr/local/oracle/network/admin/" export SQLPATH="/usr/local/oracle/instantclient_10_2" export ORACLE_HOME="/usr/local/oracle/instantclient_10_2" export NLS_LANG="AMERICAN_AMERICA.UTF8" export PATH="$PATH:/usr/local/bin/" export PATH="$PATH:/usr/local/oracle/instantclient_10_2"Open and use a new terminal going forward.
tnsnames.oraCreate a tnsnames.ora file here:
/usr/local/oracle/network/admin/tnsnames.oraMine looks like this:
staging_db = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 123.456.789.1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = FOO) ) )
ruby -rubygems -e "require 'oci8'; OCI8.new('username','password','staging_db').exec('select * from users where rownum < 2') do |c| puts c.join(','); end;"
Thursday, April 26, 2012
At the time of this post ruby-debug isn't available on rubygems.org for 1.9.3. I can't code ruby without it, well I can but I wont. If not everyone on the team wants to do this ruby-debug-on-ruby-193 to get it working you can conditionally load the gem like so:
# for all you ruby-debug haters out there begin if (Gem::Specification::find_by_name "ruby-debug-base19", ">= 0.11.26") gem 'linecache19', '>= 0.5.13' gem 'ruby-debug-base19', '>= 0.11.26' gem 'ruby-debug19' end rescue Gem::LoadError puts "no debug for you" end
Monday, April 23, 2012
xcode-select: Error: No Xcode folder is set. Run xcode-select -switch
to set the path to the Xcode folder.
This fixed it
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
At least for me I couldn't get gem install mysql or gem install mysql2 to compile. Kept bitching about missing header files and the like. Instead use this .dmg http://dev.mysql.com/downloads/mysql/
If you installed MySQL 5.5 using Homebrew and you're getting this when trying to execute mysqld you probably just need to run mysql_install_db from your /usr/local directory.
From the instal directory run scripts/mysql_install_db
From the instal directory run scripts/mysql_install_db
Install Synergy on both the guest and host. Stand back and watch it work.
Friday, April 20, 2012
Tuesday, April 17, 2012
Thursday, March 1, 2012
VMWare Workstation uses ctrl + alt as it's default hot keys which conflicts with the Ubuntu's default of ctrl + alt to begin the workspace switcher. In preferences change your VMWare hot keys to something else, I've been using alt+win which seems to work ok.
Sunday, February 26, 2012
Taken from: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug First download linecache19-0.5.13.gem and ruby-debug-base19-0.11.26.gem from http://rubyforge.org/frs/?group_id=8883, then …
$ gem install linecache19-0.5.13.gem Building native extensions. This could take a while... Successfully installed linecache19-0.5.13 1 gem installed $ gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=/Users/rtremaine/.rvm/src/ruby-1.9.3-p194 Building native extensions. This could take a while... Successfully installed ruby-debug-base19-0.11.26and voilá.
Wednesday, February 15, 2012
Getting this message when trying to start WEBrick. Run
kill -9the pid you get from the previous command.