Archive for October, 2007

Deploying with Subversion tags in Capistrano

This is a 0.1 deploy method πŸ™‚ I have tested this and we are using this version in production BUT its is not stupid proof…
In the ./config/deploy.rb
# Setup the repository with the TAG variable ()
tag = (ENV[”TAG”] || β€œβ€)
set :repository, β€œhttp://svn.mypostit.local/#{application}/tags/#{tag}”
set :repository, β€œhttp://svn.mypostit.local/#{application}/trunk” if tag.empty?
Now you can deploy with:
[deployer@heimdull ]# cap deploy TAG=’my_tag’
Wow is that easy.. If the TAG environment variable is empty then it will use the trunk for the repository or else it will use whatever you put in TAG.
I guess I should check if the tag exists before continuing … maybe 0.2 πŸ™‚

Show MySQL users from command line

Some times when you only have the MySQL command line client available and you need to β€œsee” what users/grants are setup on the server here is a great little piece that gives you this information:
# mysql -e β€œSELECT User,Host,Password,Super_Priv,Grant_Priv,Repl_slave_priv,Repl_client_priv FROM mysql.user;”
+β€”β€”+β€”β€”β€”-+β€”β€”β€”-+β€”β€”β€”β€”+β€”β€”β€”β€”+β€”β€”β€”β€”β€”+β€”β€”β€”β€”β€”-+
| User | Host | Password | Super_Priv | Grant_Priv | Repl_slave_priv | Repl_client_priv |
+β€”β€”+β€”β€”β€”-+β€”β€”β€”-+β€”β€”β€”β€”+β€”β€”β€”β€”+β€”β€”β€”β€”β€”+β€”β€”β€”β€”β€”-+
| root | localhost | | Y | Y | Y | Y |
| root | hostname | | Y | Y | Y | Y |
| root | 127.0.0.1 | | Y | Y | Y | Y |
+β€”β€”+β€”β€”β€”-+β€”β€”β€”-+β€”β€”β€”β€”+β€”β€”β€”β€”+β€”β€”β€”β€”β€”+β€”β€”β€”β€”β€”-+