- Three-finger swipe up: Home key (top of the page)
- Three-finger swipe down: End key (bottom of the page)
- Three-finger swipe left: Browse back
- Three-finger swipe right: Browse forward
Welcome to Mac Tricks And Tips. The blog is all about Tricks and Tips for Apple Mac, updated daily to help you get the most out of your Mac.
Wednesday, July 15, 2009
Firefox 3.5's Three-Finger Swipes
Use web proxy auto-discovery in Safari
This auto-detect feature works through DNS. The browser looks for a host named "wpad" and if it exists, loads its settings by accessing a file named "wpad.dat" via HTTP. To use DNS-based WPAD with Safari on OS X, follow these steps:
- In Safari, choose Safari » Preferences
- Click on the Advanced icon
- Click on the Proxies » Change Settings button
- In the Configure Proxies dropdown menu, select Using A PAC File
- In the PAC File URL field, enter http://wpad/wpad.dat
- Click on OK
- Click on Apply
Tuesday, July 7, 2009
Remove Safari history files on logout via shell script
#!/bin/bash
# Point this at your user folder.
useroot=/Users/your_user
# Clear Safari History (except for bookmarks).
rm -f $useroot/Library/Safari/Downloads.plist $useroot/Library/Safari/History.plist
rm -f $useroot/Library/Safari/HistoryIndex.sk $useroot/Library/Safari/TopSites.plist
rm -f $useroot/Library/Safari/WebpageIcons.db $useroot/Library/Safari/LastSession.plist
# Add any additional clean-up here.sudo defaults write com.apple.loginwindow LogoutHook "/Users/your_user/scripts/privacy.sh"
To be complete, you should also visit Safari's Preferences, open the AutoFill tab, and clear all of the checkmarks (Safari then won't remember passwords and forms).
Make SMB shares appear in Devices section of Finder sidebar
- Open System Preferences » Network
- Click the network interface you use for the shares
- Click on the Advanced button at lower right
- Click on WINS tab, and manually enter the workgroup name of the server
- Click the '+' under the WINS Servers list
- Enter the IP of the server (you are using static IP on your server, right?)
- Click OK, Apply, etc. until you're done
Mac OS X 10.5: Wake a sleeping Mac with via Automator
However, even with the power efficiency of the 2009 Mac mini, I don't want to leave it on 24/7. After searching through several solutions that used Python and shell scripting (neither of which I know or could make work), I found this nifty this nifty Applescript from Mark Muir that I adapted to solve my problem. Here's my modified code: You'll need to replace the MAC_address property with the MAC address (found in the Networking System Preferences panel) of the machine you'd like to wake. I then wrapped this script in a simple Automator application to make it a true one-click operation. You can read all the details, and download a copy of the Automator application, in this entry in my blog.
I've mirrored the Automator application here on Mac OS X Hints, in case the original post ever goes away. While I haven't tested this one, I'm pretty sure you could replace the full script shown above with a call to the free Wakeonlan perl script, which was described in this older hint.
Wednesday, July 1, 2009
SSH’ing Into Your Mac
I use SSH a lot, it stands for Secure Shell and its main purpose is to connect to other computers, or servers, over a secure connection which you can use to manage the remote computer. For a general overview I recommend reading this Wikipedia article. For this article you do need to be a little tech savvy with Terminal, but if you are way from your computer, or you want to manage another computer this is a very useful technique.
The first step, which you must do, is enable this process in your Firewall. Took me ages to work out while I couldn’t do this on my own Mac. Go to System Preferences > Sharing and check Remote Login. This will open port 22 on your computer and allow SSH to be active.
This should be done on the computer you want to log into. For the purpose of this tutorial you can do it on your own computer, remember to switch it off when you have finished for security purposes. Under the Green icon there will be an address. This combines your ISP Internet address, which is given to you by your ISP, in my case it is part of my Uni address, this will be unique to you. For example it will be a unique identifier, such as a MAC address or account name, on your ISP network, it will then be preceded by your ISP web address. For the most part you don’t need to understand how this address is built. You just need to know what it is. The first part of the address is the user name, for the purpose of most maintenance a normal account will suffice, if you want to do some really high level stuff an administrators account can be used.
You can now log into the remote (or your Mac). Open terminal and type:
ssh user@ISP.address.com
This will start the connection process. If it immediately says connection refused make sure you have enabled SSH as mentioned above. If it says couldn’t connect on port XXX, add the following.
shh -p22 user@ISP.address.com
This will force your SSH connection to run on port 22, instead of a different port. If you, or someone else, has used SSH before it may have been bound to a different port. This will correct this problem.
The first login will ask you to accept and RSA key. This is a method to make sure the two computer are who they say they are. Since you know this accept the key by typing yes and hitting return. This is a security method to keep the connection secure, more information about this process can be found here.
The very final step is to type the password which belongs to the user name. This is the remote Mac’s login password, not your own, my friend who I tried to teach this concept too, didn’t grasp this step for a long while and confusion ensured. Once you have done this, the connection will be secured and you can happily run commands on their computer.
At this point you can run any Terminal command, which is useful to sort out problems with file and folder errors and problems relating to settings. You can also use it to monitor the health of the remote computer by running a process such as ‘top’. The Terminal window, at this point, is exactly the same as one you would use on your own computer. It just happens that the result run on a different computer and are forwarded to you.
When you have finished your session, type exit and the SSH session will finish.
Although this is a tech savvy process and solutions such as screen sharing are more useful to people who do not know how to use Terminal, it is a great technique to learn. You can use it on any Mac, Linux or Unix computer, this method is exactly the same. It is also very low bandwidth, with screen sharing your are sending a lot of data, this technique sends text. Text has a very low data rate, as a result can run on a dial up connection. This sort of process can be used to administer a server over a home network, or to make sure a remote Mac (such as your Grandparents) is still operating fine.
There is a lot more topics on how to use SSH on your Mac. I recommend search the internet for how to find out more, if you are interested on using this technique more.
