11/5/2007
OSX Scrollbars Top and Bottom
In Terminal:
Popularity: 74%
In Terminal:
Popularity: 74%
Copy an entire database:
Copy a single table:
This shortcut only works if you can access the local DB without a password. If you have to login to both local and remote MySQL servers, the MySQL password prompts get mashed together. You could specify the password on the command line like
but your shell may keep the password in its history so that anyone with access to your account could pick through your shell history and retrieve the password. Using the MySQL password prompt doesn’t do this.
Popularity: 100%
Then copy in any public keys into ~/.ssh/authorized_keys
Popularity: 38%
These are all useful when trying to track down an open formmail script.
List bounce messages
Freeze bounce messages
Freeze messages from user@domain.com
Find out what user your webserver runs as. Use this as the email address to key on. For example, my Apache runs as nobody so I want to freeze all messages sent from the user nobody@domain.com so I can look through them to see if I can deduce where the insecure formmail script is.
Delete frozen messages
Popularity: 27%
Recursively chmod only directories
Similarly, recursively set the execute bit on every directory
The +X flag sets the execute bit on directories only
Recursively chmod only files
Recursively chmod only PHP files (with extension .php)
Popularity: 32%
I spend so much time in a text editor, its hard to get my head around a word processor sometimes. Text and formatting at the same time?
Moving some content around I found myself with a ton of links formatted in an unordered list. I only needed the plaintext of the name and link separate for the current project. My trusty BBEdit with Grep search and replace support yield the following search and replacement patterns to make quick work of the list.
Search Grep Pattern
Replace Grep Pattern
Turned this
into this
I always keep an empty BBedit window for text processing like this. Its easy to paste a chunk of text, process it and then paste it back into your word processor.
Note:
I’m almost good enough at Grep search patterns to make this viable in all situations. It used to take me 5 minutes to debug and expression that would have taken 2 minutes to cut and paste manually. I had this one whipped out in much less time than it would have taken to manually cut and paste a hundred of these.
Popularity: 23%