Skip to content

Instantly share code, notes, and snippets.

View sukeerthiadiga's full-sized avatar

Sukeerthi Adiga sukeerthiadiga

View GitHub Profile
@sukeerthiadiga
sukeerthiadiga / psql-with-gzip-cheatsheet.sh
Created May 17, 2020 18:41 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
Rails Initialization Process
cli.rb
script/rails
boot.rb
rubygems
bundler/setup
rails/commands
rails/commands/server
config.ru
environment
@sukeerthiadiga
sukeerthiadiga / gist:3772311
Created September 23, 2012 17:05
Mysql2::Error: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
locate my.cnf
change character set and collation
[mysqld]
character_set_server = utf8
collation_server = utf8_general_ci
in console if your database is not huge.
@sukeerthiadiga
sukeerthiadiga / gist:3159676
Created July 22, 2012 13:25
Port forwarding
ssh -L 1111:localhost:1111 username@ip_address
@sukeerthiadiga
sukeerthiadiga / gist:2882998
Created June 6, 2012 16:16
/Users/sukeerthiadiga/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:762:in `initialize': Operation timed out - connect(2) (Errno::ETIMEDOUT)
gem install linecache19 -v '0.5.12' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p0/
@sukeerthiadiga
sukeerthiadiga / gist:1026599
Created June 15, 2011 06:39
Renames all *.rhtml views to .html.erb, .rjs to .js.rjs, .rxml to .xml.builder and .haml
namespace 'views' do
desc 'Renames all *.rhtml views to .html.erb, .rjs to .js.rjs, .rxml to .xml.builder, and .haml to .html.haml'
task 'rename' do
Dir.glob('app/views/**/*.rhtml').each do |file|
puts `git mv #{file} #{file.gsub(/\.rhtml$/, '.html.erb')}`
end
Dir.glob('app/views/**/[^_]*.rxml').each do |file|
puts `git mv #{file} #{file.gsub(/\.rxml$/, '.xml.builder')}`
end
@sukeerthiadiga
sukeerthiadiga / gist:1022695
Created June 13, 2011 12:29
updatedb command not found in latest mac os installed
$updatedb
$command not found
$ln -s /usr/libexec/locate.updatedb /usr/bin/updatedb
$updatedb