The legal tricks-Learn Your Self

Latest gadgets,softwares,hardware,reviews,programming and campuses, game cheats ext......

Use an alias to ease resumable scp transfers

If you do a lot of downloading via scp and occasionally find yourself restarting a download that failed due to a closed connection, here's an alias that can help. Add the following to your user's ~/.profile file to create a "resumable scp downloading command: 

Quote:
alias scpresume="rsync --partial --progress --rsh=ssh"

This command uses rsync, and sets options for resumable transfers (--partial), displaying a progress bar (--progress), and insures that the transfer will be made using secure shell (-rsh=ssh). To use the command, open a new shell after saving your modified .profile file, and then type scpresume in place of scp in your normal transfer command.

Switch spaces via gestures on newer laptops

If you find yourself switching Spaces frequently and use a laptop with multi-touch capability, you can use MultiClutch to map gestures to Spaces commands. 

First (and the order is important) disable any keyboard shortcuts you use for Spaces. Then go into MultiClutch and add (in the Global application) Swipe gestures to the key commands you want for Spaces up/down/left/right. Finally, set those key commands in the Exposé and Spaces pane. This lets you "sweep away" your old space with a single gesture (no finger juggling), kind of Minority Report-style. 

One caveat: although this overrides most applications' built-in three-finger gestures, it doesn't override the Finder's back/forward support, so you get stuck sometimes when a Finder window is in the foreground. Just choose another app, and you're on your way.

Make the Snap Links add-on work with Firefox 3

I couldn't wait any longer for the Firefox add-on Snap Links to be updated for Firefox 3, so I changed the supported version number myself to make it work. 

On your Mac, assuming you've installed Snap Links, quit Firefox and navigate to your user's Library » Application Support » Firefox » Profiles » [random].default » extensions » snaplinks@snaplink.net folder. In that folder, open install.rdf in a text editor. Change the MaxVersion number from 3.0beta number to just 3.0 and save the file. Now launch Firefox, and Snap Links should appear in the addon list as available now.

control calendar colors in iPhone 2.0

iPhone 2.0 lets you see multiple calendars in different colors. However, unlike iCal, you can't chose which calendar is which color. Here's a way (sort of) to select specific colors for specific calendars. 

The calendar app displays calendars in the following colors: red, orange, blue, green and purple, assigning them seemingly at random. However, if you add your calendars one at a time, syncing after each addition, they will be assigned in the order listed above. 

I created dummy calendars in iCal so I could "skip" a color. Just sync them in the proper position in the rotation, and delete them when you're done syncing all your calendars. Calendars won't change color after you've synced them onto your phone if you delete a previous one in the sequence.

control calendar colors in iPhone 2.0

iPhone 2.0 lets you see multiple calendars in different colors. However, unlike iCal, you can't chose which calendar is which color. Here's a way (sort of) to select specific colors for specific calendars. 

The calendar app displays calendars in the following colors: red, orange, blue, green and purple, assigning them seemingly at random. However, if you add your calendars one at a time, syncing after each addition, they will be assigned in the order listed above. 

I created dummy calendars in iCal so I could "skip" a color. Just sync them in the proper position in the rotation, and delete them when you're done syncing all your calendars. Calendars won't change color after you've synced them onto your phone if you delete a previous one in the sequence.

Take screenshots with iPhone 2.0 software

Running the new iPhone 2.0 software? Want to grab a screenshot of something? Turns out it's amazingly easy. Hold the Home button down, then tap the power button on the top of the phone. The screen will flash white, and that's it -- the screenshot has been taken.

Open your iPhone's Photos app, and you'll see the just-taken photo in your image library. This works amazingly well, and it's nice to see a factory-bundled solution for those of us who write about the iPhone!

Possibly use the Microtek S400 in 10.5

I have successfully gotten my "unsupported" Microtek S400 scanner to work under Leopard. First I copied the scanner driver from Tiger (in the /Library/Application Support folder), and installed it into the same folder in Leopard. Next, I installed the Scan Maker software. Maybe it's the 10.5.4 update that made it work; maybe my manual copy made it work, but either way, it's now working fine for me in 10.5.

Use MobileMe push email with any email address

You can set up MobileMe to use any email address as a 'push' email on the iPhone. The first thing you need to do is set your non-MobileMe (.Mac) email address for auto-forward to your MobileMe (.Mac) account. 

When you create the email account, make sure you set it up as Other (not as a .Mac or MobileMe account.) Then select IMAP as the type of account. Enter the name and auto-forwarded email address. (This is the email address that will show as the "From" email, even though you're using your MobileMe account.) 

For your mail server settings, use your MobileMe settings: 
Incoming settings: 

Host Name: mail.mac.com
User Name: MobileMe user name
Password: MobileMe password
Outgoing Settings: 
Host Name: smtp.mac.com
User Name: MobileMe user name
Password: MobileMe password
Advanced: 

Use SSL - On
Authentication - Password
Server Port - 587

Now you're able to receive 'push' email from your non-MobileMe account, and reply without using the @me.com address. (You can use those same settings in the Mail App as well.)

Add sub/superscript buttons to the Excel 2008 toolbar

There's a well-known problem in Excel 2008 (unlike Word 2008) where you as the user can't easily add the Subscript and Superscript formatting buttons to a toolbar -- these buttons appear in the Formatting Palette, but the commands don't appear in the Customize menu, meaning there's no apparent way to add them to a toolbar. 

In Excel 2004, the same problem existed, but there's a Visual Basic for Applications workaround to add the buttons to the toolbar. Using that information, I created small AppleScript to add the needed buttons to the standard Formatting toolbar in Excel 2008: 
-- Script to add Subscript and Superscript formatting buttons to Excel 2008...

Quote:
tell application "Microsoft Excel"
make new command bar control at command bar "Formatting" with properties {control type:control button, begin group:true, id:57}
make new command bar control at command bar "Formatting" with properties {control type:control button, id:58}
end tell

Remove every trace of a program by reinstalling it

Since almost every program installs files in many different places, it can be nearly impossible to completely remove an installed application. But with Leopard's new fsevents service, which tracks all write activity to the hard drive, a user can find out where all the miscellaneous files are, thus allowing them to be removed manually.

To do this, first install fseventer, run it, and turn it on (press the Play button). Then reinstall the program you wish to remove. You'll see the tree diagram in fseventer populated with every file that's been changed. Next, open the program you just installed (since many programs create their preference files upon first launch). Then stop (press the Pause button) fseventer. Now you can follow the paths to the files and delete each of them manually for a complete uninstall. If you need to get to files in folders which Finder hides, you can choose Go » Go to Folder in the Finder.

NOTE: Be smart about choosing which files to remove, because fseventer will record all file activity that occurs while it is recording. So if any other programs or services write to the disk during that time (which is likely), those files will also show up in the fseventer tree. You will only want to remove the files which make sense to be associated with the program you would like to uninstall.

Quick note creation in Mail via AppleScript

I'm always searching for something to write on when I want to take a quick note. I know that Mail in 10.5 includes a note function, but it's usually been too much trouble to launch Mail and then navigate the menus to select a new note. 

So I finally put together this little AppleScript that I use with Quicksilver's hotkeys to launch a new note with just one keystroke: 
Quote:
tell application "Mail"
activate
end tell

tell application "System Events"
tell process "Mail"
click the menu item "New Note" of the menu "File" of menu bar 1
end tell
end tell

I save the script as an application, and assign it to the F7 key in Quicksilver. Now when I need to take a quick note, it's just one key press away. As an alternative to using Quicksilver's hotkey, this script can be saved as an application and placed in the Dock, making a new note just one click away.

Annotate non-PDF (raster) images in Preview

As is known, one can annotate PDF documents by means of Mac OS X standard Preview application. It turns out that the same functionality is available for raster images also, but for some reason, it's hidden by developers. 

Open your picture in Preview, then select View » Customize Toolbar. Drag the Annotate tool to your toolbar. 

Then just choose the type of annotation you want to make from the newly-created toolbar element, and use the mouse to add it to your picture. You can also use following modifiers: 

Press the '+' or '-' keys to increase or decrease line thickness.

Choose Tools » Show Colors and use the color wheel to change the color of the selected object (including notes).

Choose Tools » Show Fonts and use the fonts panel to change the text note font.

This functionality could be useful when commenting screenshots.

Reorder Login Items via drag and drop

Here is a way to re-order the login items in your user's Accounts System Preferences panel. (Whether this is actually useful, as those items now load asynchronously, is another question entirely.) 

Click and hold on a login item, and drag the item a little bit down and/or right. Notice that a dark line will appear at the bottom of the list of items in the login panel. Release the mouse button, and that item will be moved to the bottom of the list. Not as convenient as "drop to the location of your choice," of course, but with a modicum of planning, you can re-order your list this way.

Avoid syslogd CPU usage when using AppleScript

Since the release of 10.5, I've seen that the execution of AppleScripts triggers heavy activity of syslogd, basically causing it to take over the CPU. I've found that by killing the syslogd process (which will automatically restart) and removing the asl.db file from the /var/log directory, I can at least temporarily solve the problem. 

Here's a two-line AppleScript to do just that: 

Quote:
do shell script "sudo launchctl stop com.apple.syslogd" with administrator privileges
do shell script "sudo rm /var/log/asl.db" with administrator privileges

Run that, and CPU usage by syslogd should drop to normal levels again, at least for a while.

One fix for built-in iSight and Photo Booth or iMovie HD

If you're having trouble with your built-in iSight in Photo Booth, iMovie HD '06 (or both), here's one possible fix. If there is a picture of a camera in Photo Booth where the video/pictures come up (or the black screen) with a cross over it, just quit Photo Booth and open it back up again. 

This also goes for iMovie '06, but in that app, there's a blue screen and it says that there is no outside camera attached, or the outside camera is not working properly. The only problem with this message is that there really isn't an outside camera attached to the Mac you are working with! However, quitting and restarting iMovie should fix the problem.

Reduce battery usage by controlling Flash in Safari

If you use Safari and a laptop, you may be surprised to find that sites that incorporate Flash may be draining your battery. Unless you're one of those people who browse with Activity Monitor open, you're probably not aware that many sites are sucking your battery dry. Many sites incorporate Flash, in particular to display advertisements. These little Flash tidbits may be poorly written, and can make your CPU work really hard. This, in turn, will drain your battery at a fast rate. 

You can prevent Flash from automatically loading in Safari using Safari Stand. Install it, launch Safari, go to the Stand menu, choose SafariStand Setting, then click on Advanced. Check the Load Plug-in Manually box in the Flash section and restart Safari. 

Now when your browser encounters Flash, you can click the box where the Flash would have been to load that bit of Flash. You can also add exceptions to the site alteration area -- for example, you might want to let Flash automatically load when you visit youtube.com.

Make Adobe CS apps run on case-sensitive volumes

For anyone who, like me, has yet to upgrade from Photoshop CS to something newer, and is getting an error dialog on launching Photoshop CS on their case-sentivie volumes, here's a possible solution. The dialog complains that the CS app "Could not complete your request because certain required files were not found in the Adobe Photoshop CS Required folder. Please reinstall Photoshop to restore these files..," and here's the solution. 

Navigate to Adobe Photoshop CS.app » (Control-Click and choose Show Package Contents » Contents » Resources » asn. In that folder, there should be a single file called PS.SIF. Rename the file to PS.sif, and Photoshop should now launch. The same thing needs to be done to ImageReady to get it to work. Note that I've only tested this with Photoshop CS and ImageReady CS, which are the only two CS apps I have. I can't speak for whether it works on any of the others. 

It seems like a bit of a shame that Adobe couldn't take the five minutes to rewrite their installer app to name the file correctly, and save the rest of us a lot of wasted time. 

If you're looking for another solution for a different piece of CS (ex. 2 or 3) software, for which this doesn't work, you could try out the make a disk image to install Creative Suite approach, which should, as always, still work.

Quick Look files in Open and Save dialogs

I was digging through my old email archives the other day, when I stumbled on one that explained how to use Quick Look on documents in Open and Save dialogs. The trick? A free AppleScript Quick Look Droplet, provided by none other than Apple themselves. 

There are actually two little apps on that page -- Quick Look Droplet, and Quick Look Viewer. The first is just what you might guess it is -- drag and drop any file or files onto its icon, and you'll get a Quick Look preview of those files. The second is a miniature media player, of sorts. You can store files inside the application bundle, and those files will be shown in Quick Look when the program runs. So you could, in theory, place the desired documents in the application bundle, then distribute that bundle to customers as a demo of your work, without worrying about them having the proper tools to actually open those files. 

But I really like the Quick Look Droplet. Store it in your Dock, and you can then drag a file from an Open or Save dialog onto the Droplet, and you'll see a Quick Look preview of that document. The only minor issue is that these two apps are using qlmanage to show the previews, which means things don't work quite like they do in the Finder. You can't, for instance, close the Quick Look window with the Space Bar. However, I love having Quick Look in the Open and Save dialogs, so much so that I've given this droplet a spot in my Dock.

Regain lost space hidden in trash on external disks

Think you emptied the trash on your external drive? Even if you did, there may be large amounts of trash still lurking on external or network drives that has not been emptied. As most folks know, the trash is segregated by user ID, and when you empty the trash, it only empties your user's trash -- even on FireWire disks. 

If you delete a user's account on your computer, the system won't remove the trash for that user ID on the external or network drive. This can also happen if you have ever shared a disk between two computers. Since the UIDs on one computer may not be the same as the other, trashes can be created by one computer that cannot be emptied by the other. This can even happen if your username is the same on both computers, but your UIDs (e.g. 501 an 502) are different. 

Thus periodically one needs to manually remove the trash like this, in Terminal: 

Quote:
$ sudo -s
$ rm -rf /Volumes/"my_external_disk"/.Trashes/*
$ exit

Replace "my_external_disk" is the name of the disk from which you want to remove all trash from all users. (The quotes are used in case of spaces in the disk name.) I noticed this because I had lost about one-third of my disk space to this phenomena, even though I only had one user account on my present computer.

.htaccess, Open Directory, and Leopard Server

I was looking to set up .htaccess on Leopard server, and as I was testing the .htpasswd file I set up for the user (myself), I tried the wrong password and it let me in! It turns out I had used my regular password that's set up through Open Directory. So I deleted the .htpasswd file, and I removed all references to it in the .htaccess file to further test. This is the resulting .htaccess file: 
Quote:
AuthName "Server Access"
AuthType Digest
require valid-user

Just by using the above .htaccess file, I am able to login with any user that has an Open Directory account. Nice treat, for me anyway. I'm guessing others will have to add restrictions for users they don't want to have access.