This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a mysql user and give him all rights on a given database | |
$ mysql -u root -p | |
GRANT SELECT, LOCK TABLES, INDEX, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP ON specific_database.* TO 'brand_new_user'@localhost IDENTIFIED BY 'awsome_password'; | |
FLUSH PRIVILEGES; | |
# To improve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make an SSH tunnel | |
$ ssh remotehost.com -L X/localhost/Y | |
Where: | |
- X is the local port | |
- Y is the remote port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Push a DB to Heroku with UTF8 encoding | |
heroku db:push mysql://root@localhost/my_db_name?encoding=utf8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Building UML graphs with railroad for Rails | |
lib/tasks/uml.rake | |
namespace :uml do | |
desc 'Builds UML graphs for the project' | |
task :build do | |
`railroad -M | dot -Tpng > models.png` | |
`railroad -C | dot -Tpng > controllers.png` | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install the MySQL gem on Snow Leopard | |
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################## | |
# Environment variables for Oracle and Rails # | |
############################################## | |
# Oracle stuff is supposed to be installed in /opt/oracle | |
ORACLE_HOME=/opt/oracle | |
LD_LIBRARY_PATH=$ORACLE_HOME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install gitosis on a server | |
Source: http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way | |
# On the server : | |
$ cd ~/src | |
$ git clone git://eagain.net/gitosis.git | |
$ cd gitosis | |
$ sudo apt-get install python-setuptools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################### | |
# Typical Passenger VHost # | |
########################### | |
<VirtualHost *:80> | |
ServerName myapp.com | |
ServerAlias www.myapp.com | |
ServerAdmin support@myapp.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Interactively create new user on Ubuntu | |
$ sudo adduser john | |
# To enable sudo : | |
$ sudo usermod -G admin john |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################### | |
# Set path for REE # | |
#################### | |
# By the end of /etc/profile : | |
export PATH=/opt/ruby-enterprise/bin:$PATH | |
alias sudo='sudo env PATH=$PATH' | |
# Then : |
OlderNewer