Showing posts with label mac. Show all posts
Showing posts with label mac. Show all posts

Saturday, October 20, 2012

Sluggish streaming with AirPlay

If you experience sluggish sometime stopping streaming with AirPlay try switching the Wireless Channel from Automatic to a specific channel (i.e. Channel 9).
Other AirPlay devices may interfere with yours.
This happened when my neighbour turned on his own AirPort Express.

Wednesday, September 21, 2011

Disable spotlight

Disable Spotlight
sudo mdutil -a -i off

Enable Spotlight
sudo mdutil -a -i on

Saturday, March 5, 2011

Building Xcode Projects From the Command Line

xcodebuild -project myProject.xcodeproj -alltargets

Saturday, February 5, 2011

Finder shortcuts

Today I realized that i don't know enough Finder shortcuts, here you are.


Command-A Select All Items
Command-C Copy Selected Items
Command-D Duplicate Selected Items
Command-F Search with Spotlight
Command-H Hide Window
Command-I Open Get Info (Property) Pane

Command-M Minimize Window
Command-N Open New Window
Command-O Open Selected Items
Command-V Paste Items
Command-W Close Finder Window

Command-1 View as Icons
Command-2 View as Lists
Command-3 View as Columns
Command-4 View as Coverflow

Command-Shift-A Go to Application Folder
Command-Shift-H Go to Home Folder
Command-Shift-N Create New Folder
Command-Option-O Open File and Close Finder

Sunday, December 26, 2010

Command-line tools on Mac OS X, Snow Leopard

allmemory, fs_usage, fuser, latency, sar, sc_usage, spindump: Display various system usage statistics.

bless, disklabel, disktool, diskutil, drutil, fsck, hdiutil, pdisk: Create, identify, manage, and fix Mac OS X disks, file systems, and disk images.

ioreg, kextstat: Show device drivers and other kernel extensions in use.

mDNS, dns-sd: Test Bonjour service discovery with these diagnostic tools.

open: Invoke launch services on an arbitrary document or application as if doubleclicking it in the Finder.

pbcopy, pbpaste: Move data between stdin/stdout and the Mac OS X pasteboard.

say: Convert text to audio output or a file via Speech Synthesizer.

shasum: Compute or validate SHA message digests.

sips: Manipulate the format and color space of bitmap images (for example, rotate,

sw_vers, uname: Display Mac OS X version information.

syslog and logger: Send, view, and manage system log messages with these modern

xattr: List, display, set, and delete file system extended attributes

You can find more information on apple.com in this documentation.

Tuesday, December 21, 2010

snoop file opens on Snow Leopard

Opensnoop tracks file opens.
sudo opensnoop

or you can watch only a process
sudo opensnoop -n Google Chrome

Thursday, November 18, 2010

Changing the computer name on terminal


sudo scutil --set HostName [NewMacComputerName]

Next flush the DNS cache on the Mac by entering the command:

dscacheutil -flushcache

Saturday, October 23, 2010

iTunes search with command f

To use Command-F to get to the search field in iTunes you have to execute the following in Terminal.

defaults write com.apple.iTunes NSUserKeyEquivalents -dict-add "Target Search Field" "@F"

You have to restart iTunes to make it work.

Monday, October 4, 2010

List open ports on Mac OS X

sudo lsof -i -P | grep -i "listen"

Wednesday, June 16, 2010

What changed in your home folder today.

You can perform a simple Spotlight search from the shell

mdfind [query]

for instance

mdfind Ruby
mdfind -name stdlib.h

and then you pipe the result as you want

mdfind Ruby | grep 'pdf'

You can redefine your search by specifying any of the metadata attribute keys.
Here is a helpful list of metadata attributes that you can use.

You'd like to see what changed in your home directory today, easy.

mdfind -onlyin ~/ '(kMDItemFSContentChangeDate >= $time.today)'

Tuesday, June 15, 2010

Monitoring file system activity on OS X

My hard disk is quite slow, so It seemed a good idea to see what's going on under the hood, why the filesystem is so busy.
I came across fslogger, which is a great user-space program that subscribes to the kernel's file system change notification service.

Sounds great and actually monitoring file system activity with fslogger is quite easy. It must be run as root but that's it.

The output is little bit verbose but you can cut it with awk.

# changed files
sudo fslogger | awk '/FSE_ARG_STRING/ { print $5 }'

# file change type
sudo fslogger | awk '/type.*=/ { print $3 }'

# process that caused the change
sudo fslogger | awk '/pid.*=.*\(.*\)/ { print $4$5 }'



Helpful.