- View
- Edit
- Delete
function dump_db {
/usr/local/mysql/bin/mysqldump -u root -p $1 > $1.sql
}
function dump_db {
/usr/local/mysql/bin/mysqldump -u root -p $1 > $1.sql
}
#Register a host in /etc/hosts
function register_host {
echo "127.0.0.1 $1.site" | sudo tee -a /etc/hosts
add_vhost $1 $2 $3 | sudo tee -a /etc/apache2/extra/httpd-vhosts.conf
sudo apachectl restart
}
function add_vhost {
echo "
#$3
<VirtualHost *:80>
ServerName $1.site
DocumentRoot /Users/webalab/$2
ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"
CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log common"
</VirtualHost>"
}
Usage:
$ sudo port selfupdate : Updates the macport's app list.
$ port list : List All packages
$ port search kwd : Search "kwd" in the packages list
$ port info pkg: Retrieve information about the pkg
$ port deps pkg: Show the dependencies of a pkg
$ port variants pkg : Show pkg variants
$ sudo port instal pkg: Install pkg
$ port clean --all pkg: Clean all the mess done by the app installation whatsoever
$ port uninstall pkg: Uninstal pkg