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

An AppleScript to look up phone numbers in Google Internet
Well just bought Google Hacks and couldn't resist. Had to try at least one! Here's an AppleScript to look up phone numbers using Google:
tell application "Finder"
  try
    display dialog "enter full first name lowercase" default answer 
      "joe" buttons {"OK"} default button 1
    set first_name to text returned of the result
    display dialog "enter last name lower case" default answer 
      "blow" buttons {"OK"} default button 1
    set last_name to text returned of the result
    set full_name to first_name & " " & last_name
    -- The next three lines should be entereed as ONE LINE:
    display dialog 
      "Enter city in lower case, leave blank if you don't know it."
      default answer "my city" buttons {"OK"} default button 1
    set my_city to text returned of the result
    display dialog "Enter state as two letter abbreviation" default answer 
      "ca" buttons {"OK"} default button 1
    set my_state to text returned of the result
    tell application "Safari"
    -- The next two lines should be entereed as ONE LINE:
      open location "http://www.google.com/search?q=rphonebook:" & 
        first_name & " " & last_name & " " & my_city & " " & my_state
    end tell
  end try
end tell
Be careful of line wraps on the display dialog lines and the open location line at the end. Be sure to copy and paste into Script Editor and make them all one line. Save this AppleScript as a compiled script and put it in your scripts folder. From there, you can access it using Script menu in the menubar.
  Post a comment  •  Comments (7)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,821 views] Email Article To a Friend View Printable Version
Automatically check eBay for favorite auction items Internet
Ok this isn't a hardcore geek hint but ... I like to troll for bargains on eBay. I re-run the same search query every so often to see if what I'm looking for is available. Here's how I automated the process:
  1. Surf to eBay and run your search query.
  2. Once the query has run, copy the contents of the URL field of your browser (Safari) into the clipboard (select all the text then hit Command-C)
  3. In the AppleScript Script Editor (in /Applications -> AppleScript), enter this script:
    tell application "Safari"
      activate
      get location "[paste clipboard contents here]"
    end tell
    
    Obviously, replace [paste clipboard contents here] with the actual clipboard contents, by hitting Command-V.
  4. Save the script as an AppleScript application.
  5. Use Cronnix to set a cron job to fire off the script at the interval you want. Use this syntax in Cron:
    open /path/to/script/myscript.app
At the interval you choose, your script will run, Safari will launch, and the query will be executed.
  Post a comment  •  Comments (14)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,244 views] Email Article To a Friend View Printable Version
Start and stop Apache from the dock Internet
I wanted a way to quickly start and stop Apache without having to go into System Prefs every time. This small AppleScript can be placed in the Dock, allowing one-click launching and terminating of Apache. One caveat: In order for this to work, you have to edit /etc -> sudoers to give yourself the ability to launch Apache without having to enter your password -- see man sudoers for help with that process. That's a potential security risk, but as I see it, it's no riskier than allowing System Prefs to launch it via a button.
  do shell script "sudo /usr/sbin/apachectl stop"
  if result = "/usr/sbin/apachectl stop: httpd (no pid file) 
  not running" then
    do shell script "sudo /usr/sbin/apachectl start"
    display dialog "Apache Started" with icon 2 buttons 
    {"OK"} giving up after 1
  else
    display dialog "Apache Stopped" with icon 2 buttons 
    {"OK"} giving up after 1
  end if
Enter the script in Script Editor, save it as an application, and drag it into your dock.
  Post a comment  •  Comments (7)  
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[14,579 views] Email Article To a Friend View Printable Version
A short script to automate dial-up internet connections Internet
This is a hint for all those poor people out there who still have dial up at home, like me. This isn't much of anything just a little something for those lazy people. Using a key editor, I suggest iKey), create a script like this:
  tell application "internet connect"
    (connect)/(disconnect)
  end tell
Using iKey, set the key to launch this script to whatever you want -- I used the Command-F13. When pushed, it automatically connects to the internet for you. The only problem I have found is that it opens the application Internet Connect. If you're like me, and don't like a bunch of applications open in the dock that are pretty useless, it's kind of irritating. Maybe someone could find the command for the little phone thingy in the status bar. That way it wouldn't open anyhting.

[robg adds: I don't have a dial-up account to test this with, but I would think adding "quit" just above the "end tell" would connect to the net and then quit the Internet Connect app -- that's just a guess, though...]
  Post a comment  •  Comments (5)  
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[8,295 views] Email Article To a Friend View Printable Version
Ban specific browsers or robots from browsing your site Internet
Ever want to ban a specific robot technology from browsing your hosted website? For example, perhaps there's a bot that ignores the robot exclusion rules. Here's how you can do just that -- ban a specific robot or browser from your site. Note that this hint could be helpful for lots of other tasks, like specific behavior according to specific http headers. See Apache's documentation on Module mod_setenvif and Environment Variables in Apache for more info.

It only takes two lines in your httpd.conf file to ban any specific browser or robot. The first is in the <IfModule mod_setenvif.c> section. Somewhere in that section, add:
  BrowserMatch "some_text" badbot
Replace some_text with a word that appears in the User-Agent HTTP request header field. For instance, if you wanted to (not that you would!) block the Mozilla browser from your site, use "Mozilla" to replace "some_text".

Then inside your <Directory "/Library/WebServer/Documents"> section, add the following line before the Allow from all line (I removed the comments, showing only the active commands):
<Directory "/Library/WebServer/Documents">
  Options Indexes FollowSymLinks MultiViews
  AllowOverride All
  Order allow,deny
  # The next line is the new addition
  deny from env=badbot
  Allow from all
</Directory>
What we did is quite straightforward. If the User-Agent field contains "some_text" anywhere inside it, the environment variable 'badbot' is declared; it is non-existent otherwise. Then, when checking for accessibility, if 'badbot' exists, the client is denied.
  Post a comment  •  Comments (0)  
  • Currently 2.75 / 5
  You rated: 1 / 5 (4 votes cast)
 
[4,976 views] Email Article To a Friend View Printable Version
Using Siemens S55 GPRS to connect to the net Internet
While about to go to the countryside, I was desperately searching for a solution to connect to the Internet via my new Siemens S55 GPRS phone. I've searched macosxhints but could only find one for Nokia and another for Sony Erricson. After some searching on the internet, I've compiled the steps needed to make it work via my G4 Powerbook iRDA port (bluetooth should work too). You can find the instructions at BusyBee OSX in this article. FYI, I'm connected to Australia's Telstra ISP. It should work with other Australian providers and even in other countries.

For those of you with other mobile GPRS phones, you may wish to follow the link in the article to access a bunch of other mobile phone modem scripts.
  Post a comment  •  Comments (2)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,775 views] Email Article To a Friend View Printable Version
Use bookmarks to aid in forum reading Internet
I'm sure many of you already do what I do when reading various forums: click the "View New Posts" link, then open tabs for each of the articles you're interested in reading. Trouble is, many forums don't have a "Mark All Forums As Read" link on the results page of the new posts search, so you have to go back to the main page to clear all the posts.

To save a few clicks, I've added the "View New Posts" link as a bookmark in the Bookmarks Bar, so that I can just go directly to the list of new posts. I make tabs of all the threads I'm interested in, then I click on another bookmark I made of the "Mark All Forums As Read" link to clear the list.
  Post a comment  •  Comments (2)  
  • Currently 2.60 / 5
  You rated: 5 / 5 (5 votes cast)
 
[2,908 views] Email Article To a Friend View Printable Version
Customize .Mac Slides Publisher's settings Internet
I was messing around with .Mac Slides Publisher (one of the lesser known features of .Mac), and I found some interesting hidden treasures. I had previously messed with Slides Publisher when it first came out, but I was disappointed at the lack of options for image compression (combined with the default setting of 'too much', in my opinion). I have recently found a way to replace the images uploaded via Slides Publisher with your own (arbitrarily compressed) images.

Use Slides Publisher to create a basic slide show of an image or two. This will create the directories and files needed to provide slideshows via .Mac. Now connect to your iDisk and look in the Pictures folder - you'll see a new folder called "Slide Shows," inside of which is a "Public" folder, inside of which are the images you uploaded with Slides Publisher. You'll also see an xml file called config.plist. The config.plist file looks a little something like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>BaseURL</key>
    <string>http://homepage.mac.com/dre/.Pictures/Slide Shows/Public/</string>
    <key>Images</key>
    <array>
      <string>Image-001.jpg</string>
      <string>Image-002.jpg</string>
      <string>Image-003.jpg</string>
    </array>
    <key>SizeOfSlideshowInBytes</key>
    <integer>727771</integer>
  </dict>
</plist>
You can upload your own images into the Pictures -> Slide Shows -> Public directory, and then either rename them to match the names in the Images array (that is, Image-001.jpg, etc), or else alter the array contents to match the names of your images. Also, update the SizeOfSlideshowInBytes to match the sum of the file sizes of your images (the numbers in parenthesis of each image file's Get Info window, or the 5th field of ls -l Terminal output). I'm not sure where or how this value is used, but it's there for a reason, I do declare!

There's more! You can even change the base URL to be anything you want it to be. In my testing, it works without a hitch, and I'm pulling images from my server via the .Mac Screen Effects screensaver. Combine this with some scripting elsewhere to update the images, and you've got yourself a pretty handy way to roll out updatable images to the masses (I seem to remember that .Mac Screen Effects will refresh with the .Mac servers every so often, but I'm not sure).

Also, you'll note that in the example, the BaseURL points to a .Pictures folder (with a period in front of the name, as if it were hidden), which as far as I can tell does not exist. In any case, it works as if there were no period. As far as which image file formats are supported, and any upper-limit on size ... I'll leave that as an exercise for the reader (just remember to keep things modest if you want to share with your non-broadband-enabled bretheren!
  Post a comment  •  Comments (1)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,063 views] Email Article To a Friend View Printable Version
Accessing a local DSL machine by its external IP Internet
When you have a (A)DSL connection like I do, you have to specify your internal IP number in the Network control panel, as well as the router address. For example, 10.0.0.150 and 10.0.0.138. Your real IP address will be different. When you have built a website on your computer (or anything else), you may want to check if what you did was any good. This can be a problem, since your 'outside' IP address is, of course, not 10.0.0.150, but some other number. This can be a fustrating mess. After checking complicated solutions like the Apache conf file and routed, I just found an amazing simple solution!
  • Go to Preferences -> Network and selelect Network Port Configurations from the popup.
  • Duplicate your ethernet card's port
  • Change the IP address to your outside IP number, e.g. 80.60.xx.xx (no complete sample ;-))
  • Set the netmask: 255.255.0.0
  • Set the router: 127.0.0.1
  • Hit Apply Now
The control panel will complain that the router's address is not in your address range. Ignore this. Now you can access your local machine by its external IP. I'm quite amazed at the simlicity of this!

[robg adds: I have not tested this one...]
  Post a comment  •  Comments (15)  
  • Currently 2.00 / 5
  You rated: 1 / 5 (4 votes cast)
 
[9,857 views] Email Article To a Friend View Printable Version
Debugging a slow SMTP server connection problem Internet
For the past few months I have had to contend with unbearably slow outgoing email. It seemed to take an age to connect to the SMTP server and send even a single line of text. I tried the MTU fix, I tried different mail clients - all the same thing.

I finally found today that if I turn off the OS X software firewall, it solves the problem. I'm behind two hardware corporate firewalls anyway, so it's clearly redundant. Go to System Preferences -> Sharing -> Firewall and press Stop.This fixed the problem for me and hope it helps others.
  Post a comment  •  Comments (11)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[13,738 views] Email Article To a Friend View Printable Version