Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Editing dynamic content with WebDAV Internet
One of the problems with using WebDAV is that you can't open (GET) files that have any kind of server-side rendering, like PHP files. When you open these files, if you can open them over WebDAV at all, you're treated to the rendered page. That sucks!

Here's where mod_rewrite comes in. Apache comes with a very powerful rewriting engine, which allows you to change the content of just about everything on the fly. We can use this power to turn our dynamic pages into something static to suit our editing needs.

Chances are your WebDAV directory configuration in httpd.conf looks something like this:

<Directory /Library/WebServer/Documents/dav>
    DAV On
    AllowOverride AuthConfig
    Options FollowSymLinks Indexes
    AuthName "WebDAV Restricted"
    AuthType Basic
    Require valid-user file-owner file-group
</Directory>
Read the rest of the hint for the changes to implement mod_rewrite...
read more (204 words)   Post a comment  •  Comments (11)  
  • Currently 4.00 / 5
  You rated: 5 / 5 (5 votes cast)
 
[8,183 views] Email Article To a Friend View Printable Version
Secure POP and SMTP email via SSH Internet

Now that I have a laptop and a wireless ethernet card (YAY!), I want to check my email from public wi-fi points like the café down the street. But POP and SMTP send my password in cleartext which I obviously don't want other people using the same wi-fi point to sniff. The solution? SSH.

Prerequisites:
I will assume you are able to ssh into your server and therefore, you have a login and password and know your server's address. (If you have a commercial webhost hosting your website and email, ask them to enable SSH login for you.)

read more (428 words)   Post a comment  •  Comments (21)  
  • Currently 3.00 / 5
  You rated: 1 / 5 (5 votes cast)
 
[68,736 views] Email Article To a Friend View Printable Version
Have AIM page you when a buddy signs on Internet
I'm not always within earshot of the audible Buddy Alerts that AIM produces, but I always have my pager on my belt, so I wrote a few scripts to email a quick notice to my pager when a buddy signs on. Although I much prefer Fire as my chat client, it does not yet allow a buddy alert to call an AppleScript, so you'll have to use AOL's AIM client to achieve this. This method uses the UNIX mail command to send a message via sendmail (which must already be configured properly). Also, you must be using a Dynamic DNS service.
read more (182 words)   Post a comment  •  Comments (7)  
  • Currently 2.00 / 5
  You rated: 1 / 5 (5 votes cast)
 
[10,831 views] Email Article To a Friend View Printable Version
Transfer addresses to Earthlink's online address book Internet
Earthlink started their new spamblocker program which blocks spam from addresses that are not in your online address book. Blocked recipients then receive an automated response giving instructions on how to ask for permission to be unblocked by the user. The thing is, I don't store my addresses online. All of my addresses are on my computer in the Address Book. There is no way to import the addresses through Earthlink either. So here is how I imported all my addresses from Address Book to Earthlink's online Address Book using Safari.

Note: Make sure you have autofill turned on under Safari Preferences.
  1. Navigate and sign onto your Earthlink online webmail using Safari.
  2. Select Earthlink's "address Book"
  3. Select "Add Contact." This will open a new window. Open as many windows at once that you see necessary. This makes adding contacts faster.
  4. Open the Mac OS X Address Book application.
  5. Select one address from the Address Book that you would like to import.
  6. Select "Card" from the menubar and then select "This is My Card" from the drop down menu.
  7. Go back to Safari's window (which contains the form to add the new contact) and then press Shift-Command-A (selecting Edit and then Autofill form will work as well). The autofill will then complete the form with all the information from that contact in your OS X Address Book.
  8. Make any changes necessary to form.
  9. Go back to your "Address Book" and repeat - starting at step five.
Note: I noticed that if you make any changes to the form after selecting Shift-Command-A, then the next time you add a contact, your last modifications may still show up. To fix this, go to Safari's autofill preferences. Click the edit button next to "Other Forms." Select and remove "earthlink.com" from the list. You may try unchecking "other forms" to see if it clears this problem, but I didn't try that when importing my contacts.

This allowed me to add my addresses to Earthlink's online webmail in a matter of minutes instead of the hours it would have taken by filling out each form manually. I was unable to get this to work with Yahoo.com
  Post a comment  •  Comments (2)  
  • Currently 2.40 / 5
  You rated: 2 / 5 (5 votes cast)
 
[6,785 views] Email Article To a Friend View Printable Version
Cure the Slashdot addiction with a one-step solution Internet
I confess to a self-destructive addiction to Slashdot. But I'm now a recovering addict thanks to my one-step program.

Pull up a Terminal window and type:
sudo echo 127.0.0.1   slashdot.org >> /etc/hosts
Then reboot your computer (experts can use niload instead of rebooting). This instantly licks impulse attempts to "just look at Slashdot for a momoment" during a "break" at work. And so far, I've resisted editing the hosts file to remove this line. An amazingly effective cure, and now I have more time to read macosxhints!

Addendum: If the above command doesn't work for you, try this version:

sudo sh -c 'echo "127.0.0.1 slashdot.org" >> /etc/hosts'
robg adds: OK, I know it's somewhat of a ridiculous hint, but heck, it's the Friday before perhaps the most amazing Apple announcement day in a number of years (check this Slashdot article (heh!) for the details), and I felt the need for a bit of humor. For those that don't know what this does and don't want to try, it will force any attempt to load slashdot.org to instead connect to your machine's webserver.]
  Post a comment  •  Comments (16)  
  • Currently 1.71 / 5
  You rated: 4 / 5 (7 votes cast)
 
[8,169 views] Email Article To a Friend View Printable Version
An AppleScript to search for usenet email addresses Internet
I ran across a way to look up email addresses on Usenet. I incorporated it into an AppleScript which automates the process. The scripts sends a specially formated email to a usenet server, and searches for the email of the name you submit.

Caveat: Depending on the provided name, this can return a lot of email addresses. Also, you must set the variable theSender to your email address.
set theSubject to ""
set theSender to "your_email@your_host.com"
set theAddress to "mail-server@rtfm.mit.edu"
set theBody to "send usenet-addresses/"

tell application "Finder"
  display dialog ¬
  "Enter name to find: LASTNAME FIRSTNAME" default answer ¬
  "Washington George" buttons {"Okey Dokey"} default button 1
  set myName to text returned of the result
      
  tell application "Mail"
    activate
    set newMessage to make new outgoing message with properties ¬
          {subject:theSubject, content:theBody & myName}
    tell newMessage
      set visible to false
      set sender to theSender
      make new to recipient at end of to recipients ¬
      with properties {name:theSender, address:theAddress}
      send
    end tell
  end tell
end tell
Thanks again to jbc and grrl_geek for their help in grokking Mail.app scripting!

[robg adds: The server may take quite a few minutes to process the request, and the list will only include addresses of people who have posted to usenet. If you don't know what usenet is, your email address is probably not going to come up. On the other hand, the usenet archives go way back in time, and if you were active, you may find a long history of your prior email addresses ... don't ask me how I know this :-). This is posted more for the AppleScript example than the exact usage of the script, but it is somewhat interesting...]
  Post a comment  •  Comments (5)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[4,966 views] Email Article To a Friend View Printable Version
Install the no-ip.com client as a system service Internet
Many people use no-ip.com to run servers on dynamic IPs. This file allows the Linux version of the No-IP client to be run as a system startup service. This means that it stays running without anyone logged in, and uses next to nothing in system resources.

An added benefit is that it may also be used to find stolen systems by passing the IP alone to the police. I created this package personally.

[robg adds: I haven't tested this myself, but I did verify that the package doesn't seem to contain any malicious code.]
  Post a comment  •  Comments (10)  
  • Currently 1.50 / 5
  You rated: 1 / 5 (4 votes cast)
 
[10,156 views] Email Article To a Friend View Printable Version
Prevent Apache from serving .DS_Store files Internet
I was just looking at the directory listing in a shared web directory, and a .DS_Store file caught my eye. The default OS X httpd.conf allows these files to be served. This might be a security hole, particularly if directory listings are denied. One could inadvertently give prying eyes a glimpse of the files in the directory that one would rather not make public. To prevent this, /etc -> httpd -> httpd.conf should probably contain:
<Files .DS_Store>
    Order allow,deny
    Deny from all
    Satisfy All
</Files>
Remember to restart Apache after making this change, either with the GUI tools or just by typing sudo apachectl graceful in the Terminal.
  Post a comment  •  Comments (10)  
  • Currently 1.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[13,796 views] Email Article To a Friend View Printable Version
Parsing .html files for php code Internet
I recently wanted to add some PHP code to my web pages, giving the last modification date. The PHP code to do this is:
<?php
putenv("TZ=America/New_York");
echo "Last modified: " .date("F d Y ", getlastmod());
echo "at "  .date("h:i:s A.",getlastmod());
?>
The problem was that all of the pages were .html files, and Apache isn't set up by default to parse .html for PHP code. A search on the web for help found a page [nonpplus.net] that suggested that one add the following to an .htaccess file and place the file in the directory to be affected:
AddType application/x-httpd-php .htm .html.
However, I wanted my whole /Users/user_name/Sites folder to have .html, .htm, and .php parsed for PHP code, so I added
RemoveHandler .htm .html
AddType application/x-httpd-php .php .htm .html
to the bottom of my user_name.conf file in /etc/httpd/users by typing:
sudo pico /etc/httpd/users/username.conf
(Enter your password when prompted). I would assume you could set Apache to parse all .htm, .html, and .php files for PHP by adding some version of the above to httpd.conf in /etc/httpd, but this might have a huge impact on the server's performance. This hint really just collects together two useful pieces of information in one place, but I hope somebody else finds it helpful.
  Post a comment  •  Comments (7)  
  • Currently 3.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[12,438 views] Email Article To a Friend View Printable Version
Track an eBay auction from the Script menu Internet
Say you are following an item on eBay and you don't want to automatically query eBay on that item. Here's a script you can use from the Script menu. Now the trick is it searches on the bid item number and retains the item number from one running of the script to another. Just don't shut down your computer!
property my_bid : 0

tell application "Finder"
  display dialog "Gimme yer eBay item number:" default answer my_bid ¬
    buttons {"OK"} default button 1
  set my_bid to text returned of the result
  tell application "Safari"
    activate
    open location ¬
      "http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=" & my_bid
  end tell
end tell
[robg adds: I haven't tested this one...]
  Post a comment  •  Comments (3)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[3,723 views] Email Article To a Friend View Printable Version