I always used to log-out / log-back-in to shell, to allow changes in my .bash_profile to kick in. I’m guessing this would work in OSX with your .profile file too but I’ve not tested it. Anyways, I discovered you can reload the script on the fly using:
1source ~/.bash_profile
Lots of love going about today! This time, the recipient is SSHFS which allows you to mount a remote filing system onto your local tree over SSH. In a virtual hosting environment (/vhosts/ etc) it’s pure joy to work with.
You’ll need to install SSHFS on the client (the machine you want to mount the remote [...]
Today I had a log table report query that contained a nested query. It was taking ages (5mins) to complete. I investigated indexes which I had been meaning to look at for a while. Anyway I managed to bring down the query to 0.04s – I now have much love for indexes!!
Basic MySQL syntax:
1CREATE INDEX [...]
To dump an SQL file of just the schema (structure) of a MySQL database table you can use this command line:
1mysqldump -du username -p databasename tablename > filename.sql
You can drop the -p if you don’t have a password.
Useful if you need to move table structures around ;]
For my own notes:
To rebuild the Postfix virtual.db file including any new additions/edit to the /etc/postfix/virtual config file. Use this command line a root:
1postmap virtual
This will dump an SQL statement into a file:
1mysql -u username -p database_name -e "SQL_STATEMENT" > file.data
Checks out over an SSH connection if no HTTPS access is available. For my own records:
1svn checkout svn+ssh://your_user@yourdomain.com/usr/local/svn/ReposName/trunk
If you want to ignore (skip) files inside a directory with SVN:
1svn pe svn:ignore smarty/templates_c
This will prompt you for a pattern (*.php) via your editor of choice. So you’ll need the EDITOR environment variable set in your ~bash.rc / .profile etc
1EDITOR=vi; export EDITOR
Update (14/04/09): This only ignores files that are not already version controlled (inside [...]
I recently moved over to the 64bit version of Fedora Core 8.
My plan was to compile both Apache and PHP from source, as they require a fair amount of customisations for my needs.
The Apache compile went without problems but using my regular configure directives for PHP (5.2.5) threw this error:
1configure: error: mysql configure failed. Please [...]