Wednesday, October 26, 2011

Useful Terminal Commands & Tips For Mac OS X

terminalcommands_iconMac OS X is built to be so user-friendly that anyone can use it, regardless of their level of experience when dealing with computers. However, delve beneath OS X’s shimmering surface by launching Terminal and you will find it possible to unlock hidden features, perform advanced tasks, tweak and troubleshoot your Mac.

This tutorial will discuss some of the best and most popular beginner-friendly Terminal tricks and tips to be found on the Internet.

Disclaimer

Usually it takes destructive behaviour or terrible luck to ruin your Mac’s OS X installation beyond repair, but using the Terminal could potentially bypass such safety and enable a user to cause themselves serious headaches, or even (in extreme cases) a completely ruined operating system. This is very unlikely and as long as you steer clear from “sudo” commands which require you to enter your password, you should be perfectly safe. However, I strongly advise you to back up your Mac fully and proceed at your own risk!

Some tips may only work for a particular OS, though I’ve taken care to only select Terminal commands which should mostly work on Leopard, Snow Leopard and Lion.

Show Hidden Files

Though OS X doesn’t really place much emphasis on hidden files and folders, some files and folders are hidden by default. This is usually for good reason and deleting the wrong thing can cause issues, but if you wish to show the hidden files, then enter the following code:

defaults write com.apple.finder AppleShowAllFiles true

To undo this command, replace true with false.


Enable 2D Dock


osxterminal-2ddock


If you’ve ever moved your Dock to the left or right of screen (depending on which OS X version you’re running), you may have seen the 2D Dock shown above. If you’d like to enable the 2D Dock in all positions, enter the following into Terminal:



defaults write com.apple.dock no-glass -boolean YES

Now restart your Dock to make the changes take effect by entering



killall Dock

To put your Dock back to normal, replace the “YES”‘ in the above code to “NO” and restart the Dock once again by entering the above killall command.


Disable Dashboard


I’ve never been a big fan of the Dashboard as it’s something of a RAM hog and I like it to be completely disabled in case I accidentally launch it. If you would like to do so too, enter this into Terminal and hit return:



defaults write com.apple.dashboard mcx-disabled -boolean YES

Once again restart Dock to make the changes take effect.



killall Dock

To undo this command and bring back Dashboard, just change “YES” to “NO” and restart your Dock by entering the killall command once again (note: the killall command can actually be inserted into the same line of code to save time, I’m making it separate here to give you a sense of what exactly is happening).


Show The Library Folder In OS X Lion


OS X Lion comes with the Library folder hidden by default but this can make troubleshooting any issues with your Mac, deleting the cache or just plain “tinkering” very difficult. In order to bring back the Library folder permanently, enter this command into Terminal:



chflags nohidden ~/Library/

Hide Desktop Icons


terminalcommands_desktop


A nice clean Desktop looks great but sometimes it’s not practical to keep all your files organised. If you’d like to hide all the icons on your Desktop through a Terminal command, enter the following:



defaults write com.apple.finder CreateDesktop -bool false

Then our friend the killall command once again



killall Finder

When you wish to bring your Desktop clutter back, copy and paste the following:



defaults write com.apple.finder CreateDesktop -bool true

Then enter the killall command.


Launch An Application


In order to launch applications from the Terminal, just follow this template, replacing Twitter with the name of whichever program you’d like to launch:



open -a Twitter

Kill A Process


If you need to quickly kill a process or application, type the following into Terminal, replacing Twitter with whichever process you’d like to kill.



killall Twitter

Open A Finder Window In Current Directory


To quickly open a Finder window in whichever directory you’re currently in, enter the following into Terminal



open .

Change Grab’s Default Image Format


OS X’s built-in screenshot utility Grab is very useful but if you’d like it to save files as JPG, enter the following into Terminal:



defaults write com.apple.screencapture type jpg

(note: You can also change jpg to png if preferred).


Via MakeTechEasier.com

Saturday, October 22, 2011

How to Free Up Drive Space By Removing Shadow Copies [Windows]

shadow-copies-low-disk-spaceHave you ever noticed that something other than your files seems to be eating away at your drive space? If you’re an uber-nerd like myself, you may have indeed selected all your folders in explorer, viewed their properties and wondered why the total is lower than the total space in use on the drive. Time to demystify!

When you install new software, run patch updates or setup new devices, Windows may automatically create a system snapshot before making changes to the system. Should something stop working, you then have the option to roll back the changes to one of these snapshots using system restore. Depending on your settings, Windows may also keep copies of files like your documents or pictures, which you can roll back to earlier versions.

The net effect of all of these “backups” is redundancy but less available drive space. If your system is working perfectly and you feel like freeing up some space, it might be time to take the plunge and wipe the shadow copy slate clean. Indeed, you potentially stand to gain many gigabytes of space depending on your settings. For example, on one of my RAID drives, system protection is set to use up to 1% of the drive, but that actually equates to an astounding 37GB!

There are essentially two options for reclaiming this space from the shadow copy void – you can choose to remove all restore points, or you can keep the newer ones and remove only the oldest restore points.

To remove the oldest shadow copies

Click the Windows (or Start) button and type cmd into the search box. Press “Ctrl + Shift + Enter” to open a command prompt as Administrator. You may be prompted by UAC – if so, click Yes. At the command prompt type the following:

vssadmin delete shadows /for=c: /oldest

This will wipe the oldest shadow copies on drive C:. If you have another hard drive on which you wish to do the same, simply substitute the drive letter where you see “c:” in the command.


shadow-copies-oldest


To remove all shadow copies


Click the Windows (or Start) button and type cmd into the search box. Press “Ctrl + Shift + Enter” to open a command prompt as Administrator. You may be prompted by UAC – if so, click Yes. At the command prompt type the following:



vssadmin delete shadows /for=c: /all

This will wipe all shadow copies on drive C:. If you have another hard drive on which you wish to do the same, simply substitute the drive letter where you see “c:” in the command.


shadow-copies-all


Reducing the amount of available space for Shadow copies


Go to Control Panel, ensure small icons are selected in the top right “View by” pull down, and click on System. Then click System Protection, and select the drive you wish to modify shadow copy settings for. Then click Configure. You can reduce the “max usage” slider (try to leave it at least 600MB to ensure it can create at least one shadow copy). Click OK.


shadow-copies-spaceused


If your system is working fine, you may as well create a current restore point by clicking Create in this window.


shadow-copies-create


Via Maketecheasier.com

Saturday, October 8, 2011

Host a Basic Website for Free with Dropbox

Are you using Dropbox, the free file-synchronization utility that won First Class Flyer last week? It was mentioned that Dropbox files in the ‘Public’ folder each have a link that you can share with the world. But did you know this can be used in many clever ways, including hosting your very own website?

Dropbox Website Folder

Folder for my sample website hosted on Dropbox

Simply add your HTML files, CSS, scripts, etc… into Dropbox’s public folder. Then copy the URL of each HTML page.

The sample site I created is an HTML copy of files.techairlines.com.

Dropbox Sample Website

Notice the URL here.

Only regular HTML files with client side scripting is allowed. Server side scripting like PHP will not work. In addition, directory indexing does not work so the index.html part is required or it will trigger a 404 error.

Want a Shorter URL?

Of course, the long Dropbox URL can get ridiculous, so is there a way to make the URL shorter? Technically no, but there are free services that let you hide the long URL and display the site in a frame instead.

And that service would be the previously reviewed free domain services such as Dot.TK and CO.CC.

Dropbox Sample Website Frame

The same website above shown in a frame using a free Dot.TK Domain Name

And there you have it. A simple website hosted completely for free using Dropbox.

Have any other clever suggestions for using Dropbox? Leave your thoughts in the comments.

via techairlines.com