Showing posts with label OSX. Show all posts
Showing posts with label OSX. Show all posts

Thursday, March 20, 2014

Use fs_usage to monitor file system activity on OS X


Here's 3 commands I've found useful over the past year to see:

  • how much filesystem activity is going on
    IOPS (i/o operations per second), approximately
  • which applications are causing the most activity
  • which files or paths in the filesystem are being accessed
I will assume some unix familiarity here;  if you don't know where these commands go, then you probably don't understand the output either.  Come back after you've learned more.  All command lines are a single line, and appear below in courier bold.

Also, you need to be root for this.
I like to keep past outputs, and in a separate directory to contain clutter, so if you want to use these commands without modification then first do (one time only):
mkdir fs_usage

1.  Collect output from fs_usage

[42]original-mac 10:21:56 1082 ~# fs=$[fs+1]; fsd=0216; time fs_usage -w -f filesys  | grep '/.*/'  | head -10000 > fs_usage/fs.$fsd.$fs  


real    1m18.214s
user    0m1.379s
sys     0m1.428s


Here, only looking for the fs_usage output lines with pathnames (at least 2 slashes), the first 10k instances.  You can do more or less...  This took 78 seconds, which tells me the system is "fairly idle", at least mine, with the normal set of applications that I usually have open.  I have seen it complete in as little as two or three seconds.

I set $fsd as the date, and then increment the filename each time; this is just a personal packrat preference, but you can just use a single file in /tmp if you like.

In this form, it's easy to wrap with a while or
for sample in {1..10}; do ...; doneif you want to get ten samples, and then compare/combine the outputs.  Putting output from time into a separate file left as exercise for the reader.

Note these do not directly correspond to disk accesses (reads/writes), just general i/o activity.
'Activity Monitor' provides a graph of IOPS (or so it says); there are other benchmark programs if you want to check your disk (what's your favorite?).

2.  See which applications are issuing requests.  

Note with fs_usage '-w' wide output, the application name starts in column 234.  


[37]original-mac 10:02:40 1078 ~# cat fs_usage/fs.$fsd.$fs | cut -c234- | sort | uniq -c | sort -n | tail -25
  67 fseventsd.1560736
  67 fseventsd.3241
  67 fseventsd.639202
  80 CalendarAgent.2319030
  81 mds.2317581
  96 Dropbox.6042
 114 leapd.2991
 119 mdworker.2292251
 120 fseventsd.3427
 120 fseventsd.3428
 131 Google Chrome.1506982
 132 CalendarAgent.2319032
 148 Google Chrome.1507028
 152 launchd.210
 154 opendirectoryd.2318992
 154 opendirectoryd.2318994
 156 Google Chrome.1507026
 156 opendirectoryd.2318977
 160 opendirectoryd.2318972
 202 dbfseventsd.626141
 206 mtmfs.780
 230 Google Chrome.1506961
 288 com.apple.iCloud.2319050
 376 mtmd.781
6021 Google Chrome.1506955


Google Chrome is the majority of the activity...  not particularly surprising (I currently have 30+ tabs open).

3.  See what directories and files are being accessed

[36]original-mac 10:01:26 1077 ~# cat fs_usage/fs.$fsd.$fs | cut -c57-200 | sort | cut -c1-60 | uniq -c | sort -n | tail -33

  20 /Users/todd/Library/Application%2525252520Support
  20 /private/var/folders/98/vpw5gnnx1xg_9l3vjv3cc7r00000gn/T/.co
  20 0       /dev/disk0s2
  20 private/var/folders/98/vpw5gnnx1xg_9l3vjv3cc7r00000gn/T/.com
  21 /Applications/TextEdit.app
  22 /Users/todd/Library/Application%252520Support>>>>>>>>>>>>>>>
  23 /Users/todd/Library
  23 /Users/todd/Library/Application%20Support>>>>>>>>>>>>>>>>>>>
  23 /Users/todd/Library/Application%2520Support>>>>>>>>>>>>>>>>>
  24 /Users/todd/.dropbox/PENDING_MN7VKR
  24 /Users/todd/.dropbox/UPDATED_Xp1v55
  24 /Users/todd/Library/Application Support/Google/Chrome/.com.g
  24 /Users/todd/Library/Application Support/Google/Chrome/Local
  25 private/var/folders/98/vpw5gnnx1xg_9l3vjv3cc7r00000gn/T
  29 /Users/todd/Library/Saved Application State/com.apple.Termin
  31 /Users/todd
  31 /Users/todd/Library/Calendars
  32 00      /dev/disk0s3
  36 /Users/todd/Library/Application Support/iCloud>>>>>>>>>>>>>>
  40 /Users/todd/Library/Calendars/CE0DC09B-CC04-47D0-9217-E0E295
  42 /Users/todd/Library/Preferences/com.apple.security.revocatio
  47 /Volumes/rescue          
  58 /Users/todd/Library/Preferences/VMware Fusion/preferences
  72 /System/Library/CoreServices/backupd.bundle/Contents/Resourc
  89 /Users/todd/Library/Calendars/Calendar Cache-wal
 104 /Users/todd/Library/Calendars/Calendar Cache-journal
 114 /dev/console
 115 /Users/todd/Library/Application Support/Google/Chrome
 123 /private/var/folders/98/vpw5gnnx1xg_9l3vjv3cc7r00000gn/T
 216 /System/Library/PrivateFrameworks/CalendarAgent.framework/Ex
 250 /Users/todd/Library/Application Support/Google/Chrome/Safe B
 454 0       /dev/disk0s3
6487 /Users/todd/Library/Application Support/Google/Chrome/Defaul

Again, the fs_usage output has the pathname (since we explicitly grep'd for one) starting around column 57..  then I'm only looking at the first 60 characters of that path and aggregating to get a useful summary; you can use shorter or longer, or just search the raw output for specific files.

Mostly Chrome accessing my profile here.  Not sure about the /dev/disk accesses, or why some lines have '>>>>..' in them...  in the context of the full fs_usage output it might be more apparent.  However, for my purposes of approximately finding out what is going on, these are useful.

You need to run this a few times on yoru system to determine a baseline--i.e., what normal levels of activity are, and which applications are generating them.

DISKS ARE SLOW,  limited to one head per platter, and you have to wait for it to rotate into place.. a limiting resource (if you have an SSD or hybrid disk or RAID with battery-backed write-cache memory--they are a little better).  Sometimes you can't avoid them (e.g., you have to save your work).  But if/when your system starts slowing down, this can provide a little insight into what may be the bottleneck, and what unnecessary items you can shut down.


Tuesday, August 27, 2013

CPAN: Terminal does not support GetHistory (No ReadLine support)


Surprised to see these messages come up again, I thought this had gone away in the 90's.

Disk is cheap now; why not just include all these packages?

Or at least:  grab my personal [developer] profile, see all the packages I have installed,
offer to display them for me.
Show me which I use frequently, a web page with statistics and links to latest news...

In case I come across this again, I will note:
CPAN:
Terminal does not support GetHistory
Terminal does not support AddHistory


if you are using a 'straight' CPAN system:

install Term::ReadLine::Gnu


linux, as a package:
sudo apt-get install libterm-readline-gnu-perl 

Sunday, August 18, 2013

Annoyances for 18 August, 2013

Actually, these have been building for a long time; I've just decided to collect them now, and ideally, find some answers.

Bitcasa:

  • Opaqueness of Bitcasa:  it says "513kb to go" or "788 bytes to go", and seems to just switch back and forth between those numbers.  Network bandwidth at 250KB/sec for several minutes, never getting to zero.  3 hours to finally finish from where it said 13M (and 33 hours from ~1570Mb...
  • Efficiency of Bitcasa:  800M of RAM when I'm just looking at files?  1G+ sometimes?  You're using a huge chunk of disk for cache, what do you need all the RAM for ?
  • Interface:  I alt-tab over, Cmd-, to bring up preferences (only to see how munch I am using) and then what key do I use to get rid of the window?  ESC?  Cmd-W ?
    No, I HAVE TO CLICK.  I DON"T WANT TO USE THE MOUSE>
  • bitcasa, why 15 minutes to list 600000 files (using find + stat)?
    Doulbe why:    sustained CPU at 80% during this time, but not much network.  Should be less that 50M total transmitted (need to estimate).  I saw stuff disappear before; until I trust you more, I'm going to keep checking.  [Maybe staggered checking is better.]


Last.fm -- 25M download?  It seemed to never install successfully either.  Finally, with iTunes 11 it does?

iTunes -- you say you're started, but no window?  Why don't windows show when I alt-tab to the icon?  Where are you?  I have to click ?!?  To get the 'agreement' window for new iTumes?  what's so special about this window, why can't it act like a normal window?

Maybe it's not just iTunes, maybe other applications too since Mountain Lion.  Or maybe just Apple's apps ?

Mountain Lion (10.8.4) - I finally recently upgrade from Snow Leapord (10.6.8) about 3 weeks ago--had to because my LEAPmotion controller required it.
Pros:

  • Upgrade process *very* smooth -- totally online, cheap ($20), no effort (1 click, walk away, come back, no surprises)
  • Hibernate seems to work now; at least it has a couple times.  I frequently fall asleep on the couch after opening my laptop when it's charged, and don't bother plugging in (or it comes unplugged)...  then I wake up to it being off.   Maybe I should take care of the "Service battery" status?  -- but pretty impressed it still gives 2 hours after 4 years.
  • Re-opens (all?) applications that were running from before reboot.
    Slightly mixed about this; Terminal opens, but not all my screen windows.  
  • TimeMachine also uses free disk when you're not connected to your TM backup drive?
    or is this part of MobileMe, I mean iCloud ? no, I didn't sign up.
  • Also, java:  automatically downloads 1.6 when I started Eclipse;
    and system updates automatically install 1.7 (aka Java 7).
  • XCode (developer tools, compiler etc) and easy one-click install from the app store.
    Mostly I needed it for 'macports' so I could update it (because my old system was so out of date..).
    Possibly useful in the future for iOS, though I think 1) Android is bigger and better, and 2) HTML5 is a better choice before native iOS.  Still, a think iOS wrapper app might be able to provide some control/integration features.
  • Notification center -- seems to be a good centralized idea.
    Configurable.  Note to self:  I should maybe not have my calendar reminders on screen ?
Cons  (or more things that I haven't gotten used to (yet)):
  • 'Natural scrolling'
  • 'desktops' v spaces.  wish I could rename.
    but maybe it best that they remain temporary, to reduce multi-tasking ?
  • CalendarAgent takes a lot of cpu, never syncs...
  • MagicPrefs starts with two icons (doesn't seem to be two copies running)
  • Bitcasa *doesn't* autostart.
  • VMware .. gone.  I didn't upgrade before even when VMware fusion nagged me;
    after the upgrade, it's "damaged goods".
    Maybe I'll just stick with VirtualBox -- it's multi-platform.
  • no Rosetta?  I might like for a thing or two .. ?
  • app store.  I'm an old-school sysadmin control-freak who wants total control;
    maybe I should just relent, realize you can't pop the hood on some machines
Still note this is WAY ahead of WINDOWS.  To people who complain Macs are more expensive, realize that you will not have to spend 1-2 hours per week with anti-virus scans; your disk speed is not reduced because every file also has to be read by anti-virus software before your program starts or your application can read it.  How much is your time worth to you?  Consider the reduced frustration and stress.  (Windows is a sinking ship ..).  

windows abomination legacy sinking ship; please, launch your torpedo.  competition is good, but windows is just not up to the task.  everyone, just keep it in some virtual corner (if you have to have it) as a warning to future occupants.  suckit ballmer.

LEAPmotion - eats a ton of cpu.  20% when no movement, 65% cpu when I'm moving my hand around it, even when nothing is reading...  (so I have an old computer..  2.5GHz dual core should not require that much).

VMware -- something better could be done than being gone after ML upgrade.  Is it ML's fault?

CiscoVPN -- fills up my log files (system.log, others?) with messages like
acwebsecagent[151]: License : One or more of the License/Public Key can't be NULL
and plenty others.
[ maybe uninstall, re-install w/ out certain components ? ]



General notes on software:
although better than ever, the current state is still lagging behind my vision by what seems like five, ten years, and growing.  So while I get older, more jaded, more cynical and curmudgeonly, it's more frustrating.  

On the other hand, I understand how hard it is to write software..  and how short our vision really is, a limited understanding and capacity for anything beyond a few chunks at a time.


On the third hand, there is more development than ever before, exponentially so; I get frustrated with myself trying to keep up.

There are better software management tools.  There are just so many.  And each are different, for
rpm's, pkg, npm, ruby gems, python libs, github, maven, CPAN, JPAN, RCRAN (?);
sourceforge, google code,



... will organzine and update more later.
maybe find some answers.

Sunday, August 4, 2013

Macbook external monitor loses sync, goes into loop flashing blue

Symptom:

External monitor (connected via mini-port to hdmi adapter) loses sync or doesn't display, Macbook screen flashes blue like it wants to show the external display but can't.  Keeps doing this over and over again.

The first time I plug it in it nearly always gets the connection.  The time that it fails seems to be when already plugged in, and the screen wakes up from screen saver.

Solution:

Unplug and plug mini-port display adapter back in.  This works for me at least 95% of the time the first time, then probably 100% of the time the second time.  Unless the adapter has failed, in which case it won't.

When the adapter is failing, there is no way to determine what is going on.  Results will be intermittant and random, and (can't be) explained by any event.  Might be the phase of the moon, could be sacrificing a goat or chicken, and then the next day it's the chicken.  Or the goat.  It will be just like religion.

I wish there was a way to reset it; I have tried the following:

  • like put the monitors back to sleep, then re-awaken.  This doesn't help.  
  • I've also tried putting the computer to sleep, then waking back up.
  • Bring up the monitors controller, while the screen is flashing from blue to normal,
    and trying "Detect displays" but this hasn't worked
  • Turning the external monitor off and back on.
    When it's off, it behaves exactly if there is no second monitor connected.
    When on, it goes into flashing blue mode again.
    -->  this implies it is in the state of the Mac, not the state of the monitor.

    To TRY:
     - put mac to sleep, disconnect adapter and plug back in, then wake up mac
There is also "resetting the parameter RAM" and SMC
(doesn't help if adapter is broken).

What worked for you ?

2013.08.28 Update:
After upgrading to Mountain Lion 10.8.4 (previously was Snow Leopard, 10.6.8) it seems it might be a little better.  Some differences:

  • After wake from sleeping display (not awake from standby, just after the screen has blanked) the laptop may have a blue screen but the external monitor remains blank and powered off.  After entering password, the laptop screen came back (no longer blue);
    once the external monitor came back, another time it didn't (I had to unplug/plug it back it to get the display back).
  • A couple times my system seemed to hang completely after the display woke back up, getting hot and with the fan running, to the extent I had to forcibly power it off (it may have already been hung to some extent due to other processes, but the display partially "woke up").

    Once I was able to log in remotely to see was might be going on, first thing I saw was
    21:53  up 1 day,  4:39, 10 users, load averages: 66.81 27.60 11.78
    (note that is an EXTREMELY high load average) and saw these processes:


   88    92     1   0 Mon05PM ??        30:22.22 /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Resources/WindowServer -daemon
  501 16972    92   0  9:53PM ??         0:00.25 /System/Library/CoreServices/DMProxy -discovery
  501 16973    92   0  9:53PM ??         0:00.24 /System/Library/CoreServices/DMProxy -login
    0 16974    92   0  9:53PM ??         0:00.27 /System/Library/CoreServices/DMProxy -login
    0 16976    92   0  9:53PM ??         0:00.22 /System/Library/CoreServices/DMProxy -discovery
  501 16977    92   0  9:53PM ??         0:00.19 /System/Library/CoreServices/DMProxy -login
  501 16978    92   0  9:53PM ??         0:00.19 /System/Library/CoreServices/DMProxy -login
  501 16979    92   0  9:53PM ??         0:00.19 /System/Library/CoreServices/DMProxy -login
  501 16980    92   0  9:54PM ??         0:00.07 /System/Library/CoreServices/DMProxy -discovery
  501 16981    92   0  9:54PM ??         0:00.07 /System/Library/CoreServices/DMProxy -discovery
    0 16982    92   0  9:54PM ??         0:00.08 /System/Library/CoreServices/DMProxy -discovery
  501 16999    92   0  9:54PM ??         0:00.04 /System/Library/CoreServices/DMProxy -discovery
  501 17000    92   0  9:54PM ??         0:00.03 /System/Library/CoreServices/DMProxy -discovery
  501 17001    92   0  9:54PM ??         0:00.03 /System/Library/CoreServices/DMProxy -discovery


I unplugged the miniport adapter, and everything started to go back to normal.  Lots of activity in the log files (/var/log/system.log) but I haven't analyzed in detail yet, but messages like this repeat over and over:

Aug 20 21:49:38 macbookpro WindowServer[92]: Received display connect changed for display 0x4272900
Aug 20 21:49:38 macbookpro WindowServer[92]: Created shield window 0x29c9 for display 0x04272900
Aug 20 21:49:38 macbookpro WindowServer[92]: handle_will_sleep_auth_and_shield_windows: no action for lock state 1
Aug 20 21:49:38 macbookpro WindowServer[92]: Received display connect changed for display 0x3f003d
Aug 20 21:49:39 macbookpro WindowServer[92]: Display 0x04272900: GL mask 0x1; bounds (0, 0)[1440 x 900], 36 modes available
Aug 20 21:49:39 macbookpro WindowServer[92]: GLCompositor: GL renderer id 0x0102260e, GL mask 0x00000003, accelerator 0x00003c7f, unit 0, caps QEX|QGL|MIPMAP, vram 256 MB
Aug 20 21:49:39 macbookpro WindowServer[92]: Display 0x003f003d: GL mask 0x2; bounds (2464, 0)[1 x 1], 1 modes available
Aug 20 21:49:39 macbookpro WindowServer[92]: Created shield window 0x29ca for display 0x04272900
Aug 20 21:49:39 macbookpro WindowServer[92]: Created shield window 0x29cb for display 0x003f003d
Aug 20 21:49:40 macbookpro WindowServer[92]: **DMPROXY** (2) Found `/System/Library/CoreServices/DMProxy'.


Aug 20 21:49:44 macbookpro WindowServer[92]: post_notification : Time out waiting for reply from "Flux" for notification type 109 (CID 0x16603, PID 992)
Aug 20 21:49:44 macbookpro WindowServer[92]: Display 0x04272900: MappedDisplay Unit 0: Startup Mode 1440 x 900, CGSThirtytwoBitColor, Resolution 1, IOMode 0x80000000, IODepth 0x2, IOReturn 0x0
Aug 20 21:49:44 macbookpro WindowServer[92]: Display added
Aug 20 21:49:44 macbookpro WindowServer[92]: Display removed
Aug 20 21:49:44 macbookpro WindowServer[92]: Display 0x04272900: GL mask 0x1; bounds (0, 0)[1440 x 900], 36 modes available
Aug 20 21:49:44 macbookpro WindowServer[92]: GLCompositor: GL renderer id 0x0102260e, GL mask 0x00000003, accelerator 0x00003c7f, unit 0, caps QEX|QGL|MIPMAP, vram 256 MB
Aug 20 21:49:44 macbookpro WindowServer[92]: Display 0x003f003d: GL mask 0x2; bounds (2464, 0)[1 x 1], 1 modes available
Aug 20 21:49:44 macbookpro WindowServer[92]: Display 0x04272900: MappedDisplay Unit 0; ColorProfile { 3, "Color LCD"}; TransferTable (256, 3)
Aug 20 21:49:45 --- last message repeated 1 time ---


Aug 20 21:49:46 macbookpro WindowServer[92]: **DMPROXY** (2) Found `/System/Library/CoreServices/DMProxy'.
Aug 20 21:49:46 macbookpro WindowServer[92]: Display 0x04272900: MappedDisplay Unit 0; ColorProfile { 3, "Color LCD"}; TransferTable (256, 3)
Aug 20 21:49:48 --- last message repeated 1 time ---


Aug 20 21:50:51 macbookpro WindowServer[92]: Received display connect changed for display 0x4272900
Aug 20 21:50:51 macbookpro WindowServer[92]: Created shield window 0x2a18 for display 0x04272900
Aug 20 21:50:51 macbookpro WindowServer[92]: handle_will_sleep_auth_and_shield_windows: no action for lock state 1
Aug 20 21:50:51 macbookpro WindowServer[92]: Received display connect changed for display 0x3f003d
Aug 20 21:50:51 macbookpro WindowServer[92]: Created shield window 0x2a19 for display 0x19c6b0c1
Aug 20 21:50:51 macbookpro WindowServer[92]: handle_will_sleep_auth_and_shield_windows: no action for lock state 1
Aug 20 21:50:52 macbookpro WindowServer[92]: Display 0x19c6b0c1: GL mask 0x2; bounds (0, 0)[1920 x 1080], 48 modes available
Aug 20 21:50:52 macbookpro WindowServer[92]: Display 0x04272900: GL mask 0x1; bounds (-1440, 0)[1440 x 900], 36 modes available
Aug 20 21:50:52 macbookpro WindowServer[92]: GLCompositor: GL renderer id 0x0102260e, GL mask 0x00000003, accelerator 0x00003c7f, unit 0, caps QEX|QGL|MIPMAP, vram 256 MB
Aug 20 21:50:52 macbookpro WindowServer[92]: Created shield window 0x2a1a for display 0x19c6b0c1
Aug 20 21:50:52 macbookpro WindowServer[92]: Created shield window 0x2a1b for display 0x04272900
Aug 20 21:50:52 macbookpro WindowServer[92]: Display 0x19c6b0c1: MappedDisplay Unit 1: Startup Mode 1920 x 1080, CGSThirtytwoBitColor, Resolution 1, IOMode 0x80001000, IODepth 0x2, IOReturn 0x0
Aug 20 21:50:52 macbookpro WindowServer[92]: Display 0x04272900: MappedDisplay Unit 0: Startup Mode 1440 x 900, CGSThirtytwoBitColor, Resolution 1, IOMode 0x80001000, IODepth 0x2, IOReturn 0x0
Aug 20 21:50:52 macbookpro WindowServer[92]: Display added
Aug 20 21:50:52 macbookpro WindowServer[92]: Display removed
Aug 20 21:50:52 macbookpro WindowServer[92]: Display 0x19c6b0c1: GL mask 0x2; bounds (0, 0)[1920 x 1080], 48 modes available
Aug 20 21:50:52 macbookpro WindowServer[92]: GLCompositor: GL renderer id 0x0102260e, GL mask 0x00000003, accelerator 0x00003c7f, unit 0, caps QEX|QGL|MIPMAP, vram 256 MB
Aug 20 21:50:52 macbookpro WindowServer[92]: Display 0x04272900: GL mask 0x1; bounds (-1440, 369)[1440 x 900], 36 modes available
Aug 20 21:50:52 macbookpro WindowServer[92]: GLCompositor: GL renderer id 0x0102260e, GL mask 0x00000003, accelerator 0x00003c7f, unit 0, caps QEX|QGL|MIPMAP, vram 256 MB
Aug 20 21:50:53 macbookpro WindowServer[92]: **DMPROXY** (2) Found `/System/Library/CoreServices/DMProxy'.
Aug 20 21:50:55 --- last message repeated 3 times ---
Aug 20 21:50:55 macbookpro WindowServer[92]: Display 0x19c6b0c1: MappedDisplay Unit 1; ColorProfile { 4, "HF237"}; TransferFormula (1.000000, 1.000000, 1.000000)
Aug 20 21:50:55 --- last message repeated 1 time ---
Aug 20 21:50:55 macbookpro WindowServer[92]: Display 0x04272900: MappedDisplay Unit 0; ColorProfile { 3, "Color LCD"}; TransferTable (256, 3)
Aug 20 21:50:55 --- last message repeated 1 time ---
Aug 20 21:50:55 macbookpro WindowServer[92]: Display 0x19c6b0c1: MappedDisplay Unit 1; ColorProfile { 4, "HF237"}; TransferFormula (1.000000, 1.000000, 1.000000)
Aug 20 21:50:55 --- last message repeated 1 time ---
Aug 20 21:50:55 macbookpro WindowServer[92]: Display 0x04272900: MappedDisplay Unit 0; ColorProfile { 3, "Color LCD"}; TransferTable (256, 3)
Aug 20 21:50:55 macbookpro WindowServer[92]: Display 0x19c6b0c1: MappedDisplay Unit 1; ColorProfile { 4, "HF237"}; TransferFormula (1.000000, 1.000000, 1.000000)
Aug 20 21:50:55 macbookpro WindowServer[92]: Display 0x04272900: MappedDisplay Unit 0; ColorProfile { 3, "Color LCD"}; TransferTable (256, 3)
Aug 20 21:50:55 macbookpro WindowServer[92]: Display 0x19c6b0c1: MappedDisplay Unit 1; ColorProfile { 4, "HF237"}; TransferFormula (1.000000, 1.000000, 1.000000)
Aug 20 21:50:55 macbookpro WindowServer[92]: Display 0x04272900: MappedDisplay Unit 0; ColorProfile { 3, "Color LCD"}; TransferTable (256, 3)
Aug 20 21:50:55 macbookpro WindowServer[92]: Display 0x19c6b0c1: MappedDisplay Unit 1; ColorProfile { 4, "HF237"}; TransferFormula (1.000000, 1.000000, 1.000000)
Aug 20 21:50:55 macbookpro WindowServer[92]: Display 0x04272900: MappedDisplay Unit 0; ColorProfile { 3, "Color LCD"}; TransferTable (256, 3)
Aug 20 21:50:55 --- last message repeated 1 time ---
Aug 20 21:50:55 macbookpro WindowServer[92]: Display 0x19c6b0c1: MappedDisplay Unit 1; ColorProfile { 4, "HF237"}; TransferFormula (1.000000, 1.000000, 1.000000)
Aug 20 21:50:55 macbookpro WindowServer[92]: Display 0x04272900: MappedDisplay Unit 0; ColorProfile { 3, "Color LCD"}; TransferTable (256, 3)
Aug 20 21:51:17 macbookpro WindowServer[92]: Received display connect changed for display 0x4272900
Aug 20 21:51:17 macbookpro WindowServer[92]: Created shield window 0x2a47 for display 0x04272900
Aug 20 21:51:17 macbookpro WindowServer[92]: handle_will_sleep_auth_and_shield_windows: no action for lock state 1
Aug 20 21:51:17 macbookpro WindowServer[92]: Received display connect changed for display 0x19c6b0c1
Aug 20 21:51:17 macbookpro Flux[992]: CGSGetSizeOfDisplayTransfer: Invalid display 0x19c6b0c1
Aug 20 21:51:17 macbookpro Google Chrome[1011]: CGSGetCurrentDisplayMode: Invalid display 0x19c6b0c1
Aug 20 21:51:17 --- last message repeated 1 time ---
Aug 20 21:51:17 macbookpro Terminal[313]: CGSGetCurrentDisplayMode: Invalid display 0x19c6b0c1
Aug 20 21:51:17 --- last message repeated 1 time ---
Aug 20 21:51:17 macbookpro Flux[992]: CGSGetSizeOfDisplayTransfer: Invalid display 0x19c6b0c1

... Lots of 'display added', 'display removed' messages;  oddly, the external monitor (HF237) was not identified until about 3 minutes later (but still came as invalid).

Anyway, unplugging and plugging the display back in still seems to be the best solution


2014 Update:  after updating to OS X 10.8 (Mountain Lion) this has rarely happened.  Occasionally the external doesn't properly reconnect after display wakeup or resume from standby, but not the endless looping with screen flashing blue.  Unplug/plug back in always seems to fix it, it's just required a lot less frequently.

Saturday, May 25, 2013

keyboard shortcuts: Disable front row (OSX), NetBeans

I use the keyboard far more than mouse..
  • cmd-tab to switch applications
  • cmd-` for windows, Aquamacs buffers
  • ctrl-tab for tabs in browsers, buffers in NetBeans
Occasionally I miss and hit cmd-ESC, which does the worst thing -- stops my music, fades everything to black,
and then brings up the front row icon. Luckily hitting ESC again makes it go away, but it's an annoying interruption. Every time I say "I have to disable that..." and put it off.

No more.

Cmd-space keyboard to access System Preferences.
The shortcuts come up, Front Row is the fourth icon for me;
select, click checkbox on the right,
done!

Now, cmd-ESC is the same as ESC.. I thought there would be a good shortcut to use this for, but I can't think of a better one.

Links:
Any other favorite shortcuts ?
New tools?
Been meaning to look into ubiquity...



Enhanced by Zemanta

Tuesday, October 5, 2010

OSX: Constant disk activity after attaching a disk to Mac

Mac
(windows and linux, keep reading)

What it probably is: spotlight indexing.
If you're just hooking up a drive to copy some data or look for something, then this can be a hindrance to your work.

Verify that it is this process with:
sudo fs_usage

this will show all I/O activity, which will be a lot because it will include every line of text coming out to the terminal as well. Filter it with something like

sudo fs_usage | egrep -v 'screen|grep|head' | head -20

If you see mdworker, that's spotlight indexing going on.
If you see backupd, that's Time Machine (but you may have noticed the spinning icon in the menu bar).

Turn off indexing with:
mdutil -i off /Volumes/mountname

It may take 30 seconds or so (depending how busy it is) before you see
Indexing disabled.

You can turn it back on later by specifying 'on' instead of 'off'.

There are many other usages; you can use fs_usage to find what configuration or plist file(s) a program is using, where your data is going to on disk, etc.

Here's a MacWorld article: Watch file system activity in real time

Windows
On windows, get fsmon; it's one of the sysinternals tools.
regmon will do the same thing for registry accesses.

I've used fsmon to discover trojan processes before.
Windows == virus.

Linux
atop is supposed to come with ubuntu.
I don't think it gives specific paths in output, but once you have the pid you can connect with strace and just look at the IO syscalls, or use lsof to find which files are currently in use.



any other tools of note?


Enhanced by Zemanta

Friday, August 13, 2010

Add ogg support to iTunes on Mac OS X

iTunes for Mac:
this was harder to find than I thought.
Not hard, just not trivial; this should be a one-click add-capability type action,
but the instructions were not as clear. (Ideally, iTunes would already have support for open formats.)

  1. Quit iTunes
  2. Download XiphQT QuickTime component.
    This is a small 1M .dmg; double click to open it. You'll see some text files, but most importantly
    XiphQT.component
  3. Copy it in to /Library/QuickTime
  4. [Optional] This is only necessary if you want to double-click an .ogg file and have it open in iTunes. You can still use the 'add to library' menu item or drag files from the Finder on to iTunes. I think.
    Edit the info.plist file inside of iTunes;
    see instructions here: http://en.wikibooks.org/wiki/Using_iTunes/Ogg_in_iTunes
Go to dir.xiph.org and try an ogg stream.
Start up iTunes and play.
I did this on 10.6.4.

Tuesday, February 23, 2010

Browser inconsistencies: Safari, Firefox, Chrome (Mac OS X)

this is kinda in draft form right now; post comments with dis/agreements and links to similar lists or maybe solutions.

I use all of these browsers on the Mac, and used them all before on Windows (though Safari coming in later, not as much).

Primary reasons for use:
  • Firefox: plugins make it easier check multiple accounts (gmail manager), manage passwords / identity2.0 (sxipper)
  • Chrome: seems a little faster, responsive, lower system footprint.
  • Safari: has spotlight indexing for web pages
  • IE: just kidding, I avoid this generally. There are a couple sites I have to use IE, but I have windows in a vm, but usually rdp to a server (avoids local bloat).
There are downsides to using multiple browsers, besides the inconsistencies listed below, and the main one is being able find where something is, if you are a big user of browser history (I am) and bookmarks (not so much--mostly bookmarks are write-only. Except for important work/project related items)

Can you get spotlight to index other pages? I am considering a local caching proxy for this..

Here is a working list.
  • cmd-arrows for begin/end of line. Sometimes up/down in a text field will go to the beginning or end, and sometimes this appears to be (web-)application specific; e.g., up in a google spreadsheet cell takes you to beginning of line.
  • Home/end keys. Why can't these go to beginning/end of line?
    On a page, top and bottom of page are fine.
  • Select/drag text
    When one-handed, or lazy, select and drag of text is faster than select/menu-ut/click/menu-paste
  • drag-n-drop URLs into rich editor fields
    Two variants: drag of a bookmark or location URL, and drag of a link from the HTML.
    Useful for inserting into (G)mail, or with google notebook.
    And what's up with focus of the element? E.g., gdoc spreadsheet needs to have focus/input entry to drop it in, otherwise the page loads with new URL ?
If the behavior is not consistent, then I have to remember which works where, and this increases cognitive load and slows me down. I want to just transfer this to muscle memory and not have to think about it.

I've started a page in my notebook, but probably a table (spreadsheet) would be better, if embeddable here.

The main inconsistency bugging me right now: begin/end of line. It would be nice if ctrl-a/e worked like emacs. They do--yay! .. at least in blogger. But if not other sites, I will be annoyed.

Friday, November 20, 2009

Mount filesystems over ssh, ftp, etc on OSX with MacFUSE, Macfusion, and a fix for snow leopard

OS X can already mount folders shared by windows machines with smbfs (Finder - Connect to server), or WebDAV natively. With a little more software, you can mount any (*nix) filesystem over ssh or ftp, with macFuse/Fusion.

'FUSE' is something like Filesystem in User SpacE.. that means it doesn't have to be part of the OS directly, most importantly making easy for developers to try something, test it, fix it, and try again really quick, instead of maybe having to compile a whole OS, rebooting, etc. This has been around for a long time on Linux, and a while for Macs too. Just a whole lot easier on a Mac because there's some nice interfaces.

  1. MacFUSE allows you to extend Mac OS X’s native file handling capabilities via 3rd-party file systems. Visit the MacFUSE website for more information.
  2. install, you will need to reboot.
  3. Get Macfusion from http://www.macfusionapp.org/ and install it.
  4. Run it and mount some drives. After it's mounted, you can exit Macfusion.
One problem, it didn't work for me.. because I have the newer 10.6 (snow leopard). The error I got (see the macfusion log viewer) was:

(macfusionAgent, SSHServerFS, norad, 11/20/09 7:35 PM) dyld: could not load inserted library: /Applications/Utilities/Macfusion.app/Contents/PlugIns/sshfs.mfplugin/Contents/Resources/sshnodelay.so

I put mine in Utilities, but you might also see the path
/Applications/Macfusion.app/Contents/PlugIns/sshfs.mfplugin/Contents/Resources/sshnodelay.so

tell it to look for beta versions, check for update, remove an old module, and then it works..


I see my password in the macfusion log viewer -- how to I get rid of that?