Skip to content

Instantly share code, notes, and snippets.

View toamitkumar's full-sized avatar
🏠
Working from home

Amit Kumar toamitkumar

🏠
Working from home
View GitHub Profile
@toamitkumar
toamitkumar / timestamp_css_image
Created November 30, 2010 03:43
task to time stamp images in css
task :timestamp do
file_list.each do |file_name|
file_path = "#{RAILS_ROOT}/public/stylesheets/"+file_name
file = File.new(file_path)
temp_file_path = "#{RAILS_ROOT}/public/stylesheets/"+file_name+"_1"
temp_file = File.new(temp_file_path, File::CREAT|File::TRUNC|File::RDWR, 0644)
file.readlines.map {|line|
line = line.gsub(/\.(ico|gif|jpe?g|png)/) {|s| s+'?'+rand(1000000000000)}
temp_file.write line
Gemfile entry:
gem "libxml-ruby-1.1.4-x86-mswin32-60", "1.1.4", :require=>'libxml', :path=>"vendor/gems/libxml-ruby-1.1.4-x86-mswin32-60", :platform => :mingw
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
vim /etc/hostconfig and removed the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
Don't forget this:
We couldn’t find that file to show.
require File.expand_path(File.dirname(__FILE__) + "/lib/capistrano_extension")
set :server_authentication, <remote user>@<remote server>
The steps for setting *nix server to connect to SQL Server:
1) Install the following binaries:
i) MyODBC-unixODBC
ii) unixODBC
iii) unixODBC-devel
2) Download and install FreeTDS (freetds-dev)
The ./configure step of FreeTDS is dependent on unixODBC being installed: ./configure -with-unixodbc=/usr/local
1) Download and install FreeTDS
2) Configure FreeTDS (make an entry inside /usr/local/etc/freetds.conf)
[free_tds_server]
host = <sql server>
port = 1433
tds version = 8.0
encryption = no
1) brew install freetds
2) /usr/local/etc/freetds.conf
[my_sql_server]
host = <hostip>
port = 1433
tds version = 7.0
3) Enter these in the Gemfile:
Find all the .svn directories:
$ find . -type d -name .svn
./.svn
./directory_1/.svn
./directory_2/.svn
./directory_3/module/.svn
./directory_4/.svn
.......
module Capistrano
class SSH
class << self
alias :original_connect :connect
def connect(server, options={}, &block)
additional_server_settings = options[:server_authentication] ? options[:server_authentication] =~ /#{server.to_s}/ : nil
if additional_server_settings.nil?
return original_connect(server, options, &block)
else
methods = [ %w(publickey hostbased), %w(password keyboard-interactive) ]