Sunday, March 9, 2014
Sunday, February 9, 2014
Can't play AVI file on Mac?
Use this http://www.videolan.org/vlc/index.html instead of Quicktime
Wednesday, August 14, 2013
Visual Studio 2008 Locks or Freezes in ASPX
http://abdullin.com/journal/2009/5/12/visual-studio-2008-locks-or-freezes-in-aspx.html
Deleting the SETUP.exe fixed the issue for me
Deleting the SETUP.exe fixed the issue for me
Wednesday, July 10, 2013
osx mysql2 mysql.h is missing.
Taken directly from Stackoverflow (http://stackoverflow.com/a/17262871/80492)
...
What worked for me in Mountain Lion Rails install(using Homebrew and RVM) was editing /usr/local/Cellar/mysql/5.XX.XX/bin/mysql_config and removing
-Wno-null-conversion -Wno-unused-private-field from cxflags and cxflags options as follows:
Before:
cflags="-I$pkgincludedir -Wall -Wno-null-conversion -Wno-unused-private-field -Os -g -fno-strict-aliasing -DDBUG_OFF " #note: end space!
cxxflags="-I$pkgincludedir -Wall -Wno-null-conversion -Wno-unused-private-field -Os -g -fno-strict-aliasing -DDBUG_OFF " #note: end space!
After:
cflags="-I$pkgincludedir -Wall -Os -g -fno-strict-aliasing -DDBUG_OFF " #note: end space!
cxxflags="-I$pkgincludedir -Wall -Os -g -fno-strict-aliasing -DDBUG_OFF " #note: end space!
After that gem install mysql2 proceeded without hickups
Thursday, February 21, 2013
Vim Folding Commands
https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun
| Vim folding commands |
|---|
zf#j creates a fold from the cursor down # lines.zf/string creates a fold from the cursor to string .zj moves the cursor to the next fold.zk moves the cursor to the previous fold.zo opens a fold at the cursor.zO opens all folds at the cursor.zm increases the foldlevel by one.zM closes all open folds.zr decreases the foldlevel by one.zR decreases the foldlevel to zero -- all folds will be open.zd deletes the fold at the cursor.zE deletes all folds.[z move to start of open fold.]z move to end of open fold. |
Friday, February 1, 2013
OSX: pipe console output to your clipboard with pbcopy
If you wanted to copy the contents of a directory (or any output) to your clipboard just run:
ls -lta | pbcopy
Wednesday, January 23, 2013
Use SSH as a web proxy
ssh user@yourserver.com -L 8080:localhost:3128 -N
Now change your proxy settings to point to localhost:8080
Monday, December 10, 2012
Todoist : Solving cross domain security policy
From https://todoist.com/API/help
Solving cross domain security policy [top]
You cannot use AJAX to directly communicate with Todoist, this is due to browser security policy. You can solve this by communicating with Todoist using a script tag:
var script = document.createElement('script');script.type = 'text/javascript';document.getElementsByTagName('head')[0].appendChild(script); |
callbackFunction({ JSON data here }); |
Monday, December 3, 2012
Sunday, December 2, 2012
GNU Screen Cheat-Sheet
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
Sphinx fails to start with rake ts:start or rake ts:rebuild
$ 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?
http://stackoverflow.com/questions/4667316/how-to-see-mysql-queries-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
VIM: Search And Replace Text In Multiple Files
:args **/*.* // set the pattern of file names to look at :argdo %s/search_for/replace_with/gecI | update
Sunday, May 20, 2012
Transfer Your Existing Git Repository to Github
$ git push --mirror git@github.com:username/project.git
Wednesday, May 9, 2012
Giganews Mimo Crashes After Splash Screen on Win 7
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.
Oracle, Ruby, RVM, and OSX Lion
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 Client
Install the 32 bit version of the Oracle Instant Client. Download and install the following packages to /usr/local/oracle/instantclient_10_2- instantclient-basic-10.2.0.4.0-macosx-x86.zip
- instantclient-sqlplus-10.2.0.4.0-macosx-x86.zip
- instantclient-sdk-10.2.0.4.0-macosx-x86.zip
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
Bash
Add the following to your .bash_profileexport 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.ora
Create 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)
)
)
Try it
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
Conditionally load ruby-debug gem
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
Subscribe to:
Posts (Atom)
