Replacement for Manila

It would seem that there isn’t much internal support for Manila at the U. I have a few, topical Manila sites that I probably want to preserve and/or migrate.

MT is a possibility…

LDAP search from the command line

Get a name, dbkey, and email address from ldap

ldapsearch -hldap.arizona.edu -LLL -x
“(mail=*payne*@*arizona.edu)” dn mail
|
perl -p -i -e
‘ s/.*cn=(.*)+dbkey=([0-9]+),.*/1~2/; s/mail: (.*)/1/’

all of that on one line – or use the continuation characters

POSIX path or POSIX file

POSIX path or POSIX file

set f to choose file — f is a file object

set p to POSIX path of f — p is Unicode text of the path

set f1 to POSIX file p — f1 is a file object again

set qp to quoted form of p — qp is a path string you can send to Terminal even if it contains spaces or special characters

Changing keyboard equivalents

Changing keyboard equivalents

The following example would set the Activity Viewer menu item of mail.app to be command+shift+A:

defaults write com.apple.Mail NSUserKeyEquivalents ‘{“Activity Viewer”=”@$A”;}’

The odd characters before the ‘A’ in the previous command, specify the modifiers:

* @ = Command * $ = Shift * ~ = Option * ^ = Control

To use other keys, such as Delete, you will have to use their Unicode codes like this:

@U0008 which would mean command+Delete.

This is really good, since it does not involve modifying the original application, and only applies to your environment, leaving that of others unchanged. I will try to make an app to handle this proceedure some time in the future.

Logging out via AppleScript

From Chris Nebel of Apple’s AppleScript Engineering group

ignoring application responses
¬†¬†tell application “loginwindow” to <>
end ignoring

The double pointy brackets around the raw event call should be replaced by option-backslash and shift-option-backslash.The “rlgo” is short for “really log out”; if you want the “are you sure you want to log out” dialog, use aevtlogo instead. A future version of AppleScript will have a real command similar to “shut down”.

PHP – FTP timeouts

Warning: ftp_site(): Transfer completed. 23188 (8) bytes transferred. in /Library/WebServer/Include/IIWheader.inc on line 102 Error: Site command failed.

I think I’m experiencing a timeout on a long running query. I found a couple of references to commands to address this issue and tried them to no avail.

set_time_limit(6000);
$old_max_execution_time = ini_set(“max_execution_time”, 6000);
$fn = rdb_query($conn_block, $host, $db, $query);
ini_set(“max_execution_time”, $old_max_execution_time);

the fix

ftp_set_option($conn_id, FTP_TIMEOUT_SEC, $runtime);

arrow keys in Terminal.app

export TERM=dtterm

this seems to make my arrows work when and where I want them to.

cool. and I can edit in Radio still

There are problems (sometimes) with emacs and other tools.

If you do this you probably don’t want “lynx” to be in color, so make lynx work like this

TERM=vt100; lynx

as a single command.