Showing posts with label Terminal. Show all posts
Showing posts with label Terminal. Show all posts

Thursday, October 4, 2012

Scheduled powered events

If you want to find out when your mac is scheduled to wake up or power on because it's missing important events, such as recording television shows, launch Terminal.  Verify using this utility that these Events are getting set properly. There is a command-line tool that can be used to view the existing Events within your Mac's Power manager. To use this tool, launch the "Terminal" utility, located in /Applications/Utilities/Terminal, then enter the following command (you can copy/paste the line below) and press return:

pmset -g sched

The resulting output should look something like this:

Scheduled power events:
[0] wakeorpoweron at 08/05/09 19:56:00 by com.elgato.eyetv

If there are no Events listed here, then there may be a problem with the "Wakein" component, a small script that EyeTV uses to create Events. If there are other Events listed here, these can conflict with some older versions of EyeTV, which cause EyeTV not to place its own Events.

Note: Before you check out this component, you may want to restart your computer and retype pmset -g sched into Terminal. The output may now be there.

You can view the full help page here.

Tuesday, September 25, 2012

Force key repeat

Staring with Lion Apple added a new "feature" to give you alternative characters when you hold down certain keys (this is equivalent to holding down the option key in previous versions of the OS).  To force key repeat, type in the following command in Terminal:


defaults write -g ApplePressAndHoldEnabled -bool false

You can also achieve this behavior via the Secrets Preference Pane, as illustrated below.

Monday, August 27, 2012

Completely reset Safari to fix problems

If you are constantly having problems with Safari hanging or it just refuses to quit, as was in my case, you'll want to do a FULL reset.  You will be deleting a bunch of preference files, but don't worry, Safari will recreate all these files.  Just follow the instructions below:

Open Terminal - follow this path: Applications => Utilities => Terminal  and paste the commands following the screen shot then hit return.  These commands will save your Safari folder with a date stamp on your Desktop and delete several files.


mv ~/Library/Safari ~/Desktop/Safari-`date +%Y%m%d%H%M%S`; \
rm -Rf ~/Library/Caches/Apple\ -\ Safari\ -\ Safari\ Extensions\ Gallery; \
rm -Rf ~/Library/Caches/Metadata/Safari; \
rm -Rf ~/Library/Caches/com.apple.Safari; \
rm -Rf ~/Library/Caches/com.apple.WebKit.PluginProcess; \
rm -Rf ~/Library/Cookies/Cookies.binarycookies; \
rm -Rf ~/Library/Preferences/Apple\ -\ Safari\ -\ Safari\ Extensions\ Gallery; \
rm -Rf ~/Library/Preferences/com.apple.Safari.LSSharedFileList.plist; \
rm -Rf ~/Library/Preferences/com.apple.Safari.RSS.plist; \
rm -Rf ~/Library/Preferences/com.apple.Safari.plist; \
rm -Rf ~/Library/Preferences/com.apple.WebFoundation.plist; \
rm -Rf ~/Library/Preferences/com.apple.WebKit.PluginHost.plist; \
rm -Rf ~/Library/Preferences/com.apple.WebKit.PluginProcess.plist; \
rm -Rf ~/Library/PubSub/Database; \
rm -Rf ~/Library/Saved\ Application\ State/com.apple.Safari.savedState

Sunday, August 26, 2012

Change the default save location in Mountain Lion

The default save location for TextEdit (and other apps that can store documents on iCloud) is iCloud. It takes a few clicks if you want to expand the save dialog and save a file locally. There is no way to change this in the GUI, but if you run the following command in Terminal, this will set the default save location to On My Mac for all iCloud-compatible apps:

defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false

To change this back to the default, run this command: 

defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool true

Update: you can also accomplish this through the Secrets preference pane



Click here to download the preference pane

Friday, June 22, 2012

User Library in Lion and Mountain Lion

After upgrading to Lion you will notice that your user's Library's folder is missing.  Don't worry, It's still there.  Apple decided to hide it so users don't mess around with this very important folder.  To unhide it, simply open Terminal (Applications ==> Utilities ==> Terminal) and input the following command:

chflags nohidden ~/Library/   #to show the Library folder

To change the setting back, input into the Terminal:

chflags hidden ~/Library/ #to hide the Library folder

You can also click this link to access this secret on Blacktree's Secret's page.  Secrets is a preference pane that gives you a graphical interface to access all of your Mac's hidden treasures.  You can download the software here

Wednesday, November 23, 2011

iTunes notifications in the Mac's Dock


a secret preference setting built into OS X Lion that allows song notifications to pop up over the iTunes Dock icon. Here’s how to enable them:
First, quit iTunes if it’s already running. Fire up Terminal (from /Applications/Utilities/) and paste in the following command, then hit Return:

defaults write com.apple.dock itunes-notifications -bool TRUE;killall Dock
The first part of that command turns on the Dock’s ability to display iTunes notifications; the second part restarts your Dock. (That restart may take a couple of seconds.)
Now, relaunch iTunes, select a track, and press play. Down in the Dock, you’ll see a brief notification with the song’s name and artist. The notification will appear whenever the track changes, regardless of the app you’re currently using; it will then fade away on its own.
If you decide you don't like the notifications, you can get rid of them by issuing the same command, but replacing TRUE with FALSE.

Update: if Hyperdock is installed then you don't need this command because this preference pane takes care of this for you,

Tuesday, September 14, 2010

Release and Renew

I was in mt Network Communications class last week and a student had no internet connection because the Ethernet cable was unplugged.  She then plugged the cable back into the jack to no avail.  I took a look at it and performed the following steps and all was fine:

SOLUTION:
  • Go to the start menu and click on Run...
  • type cmd and at the DOS prompt, type ipconfig /release
  • Now type ipconfig /renew
All was fine

Update: for Macs and other Linux based operating systems. the command is:


sudo ifconfig en1 down
sudo ifconfig en1 up

For the wired interface, replace en1 with en0.

You can also create an alias of these two commands by visiting Terminal and input this command:

alias renew="sudo ipconfig set en0 BOOTP && sudo ipconfig set en0 DHCP"

So then you just have one command called renew that will release and renew your DHCP

For a graphical way of doing this:

Open System Preferences
Click on Network
Click on Advanced...
Click on the TCP/IP tab in the bar across the top
Finally, click on Renew DHCP Lease