Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.7: Hidden Mobile Network Profile support Network
Opening a .mobileconfig file in Lion exposes an otherwise hidden System Preference, 'Profiles' as shown here.

The .mobilconfig files are typically used to manage network settings on iOS, including the Access Point Name (APN).

To view this in Lion, just open a .mobileconfig file from Finder and System Preferences will now reveal 'Profiles' with a means to manage multiple profiles.

If you install a .mobileconfig, Profiles will remain available in System Preferences; if you delete all profiles, then Profiles no longer appears in System Preferences.

This doesn't yet seem to affect network access or browsing at all, so it is possible this feature exists to pave the way for more unified management of APN on desktops with mobile internet access, similar to iOS. You saw it here it first!

[crarko adds: I think the point of this is to indicate possible future support of cell networks in OS X, perhaps on a future MacBook Air. It doesn't seem to have any immediate utility.]
  Post a comment  •  Comments (12)  
  • Currently 2.83 / 5
  You rated: 3 / 5 (6 votes cast)
 
[14,364 views]  View Printable Version
10.7: Manage firewall logs Network
After upgrading to 10.7 my firewall logs were filled with endless "Firewall: Allow foo connecting from 1.2.3.4:1234 to port 1234 proto=x". Happily the logging system can be told to selectively ignore these messages.

Certain applications use lots of incoming network connections, and the default behaviour in Lion when the firewall is enabled is to log every single allowed connection.

A single rule line in /etc/asl.conf can silence these useless messages.

? [= Sender Firewall] [A= Message Allow foo] ignore

You can add this line using your favorite text editor, but you'll need one that can save files with root-level permissions (like the non-App Store version of TextWrangler).

[crarko adds: I haven't tested this one. To be honest, I don't run the OS X firewall.]
  Post a comment  •  Comments (0)  
  • Currently 3.00 / 5
  You rated: 2 / 5 (6 votes cast)
 
[6,276 views]  View Printable Version
MCX Refresh for Mobile Accounts Network
I needed to forcibly refresh the per user mcx for a large number of mobile users across many desktop machines under Snow Leopard so I wrote this short script that will do just that.

Can be run from remote desktop (as root), or locally (sudo). It will not always successfully refresh the mcx, but it will force it to be reloaded from the server on the next logon.

Here's the shell script:
#Brutally refresh mcx for a machine and all mobile accounts on it

#Clear machine cache
dscl . -list Computers | grep -v "^localhost$" | while read computer_name ; do sudo dscl . -delete Computers/"$computer_name" ; done
echo "Cleared machine MCX cache."
#Get a list of locally cached accounts
for usr in `dscl . -list /Users AuthenticationAuthority | grep LocalCachedUser | awk '{print $1}' | tr '\n' ' '`; do
#Clear mcx caches
dscl . -delete /Users/$usr MCXSettings
echo "Cleared MCXSettings for "$usr
dscl . -delete /Users/$usr MCXFlags
echo "Cleared MCXFlags for "$usr
dscl . -delete /Users/$usr cached_groups
echo "Cleared cached groups for "$usr
#Attempt to refresh from server
mcxrefresh -n $usr
echo "Refreshed preferences for "$usr; done

[crarko adds: MCX is the centralized Managed Client for Mac OS X. You use this from OS X Server. Typically this would be found in academic environments for managing shared machines in labs or in Mac-centric enterprises. For more information consult the documentation for OS X Server.]
  Post a comment  •  Comments (0)  
  • Currently 3.00 / 5
  You rated: 3 / 5 (4 votes cast)
 
[18,982 views]  View Printable Version
Annotate information in Connect to Server dialog Network
In Finder, Command+K (Finder » Go » Connect to Server…) permits the storing of frequently used server addresses and protocols. However, when servers are indicated only by their IPv4 or IPv6 addresses, it is not easy to remember which address corresponds with which server. There appears to be no way to include text information associated with server addresses.

It is possible to include the # anchor at the end of the address and to indicate some information after this #. No spaces are allowed after the #.

Examples:

vnc://fkm@[2b01:0670:3201:1137:0211:24ff:ffe0:4bc6]#eMac_Conservation
afp://mgi@[2a01:0e35:2d49:0580:9227:e2ff:fef2:29ff]#Macbook_d_Emelyne
smb://129.172.107.192#DataXlab

Note that the true addresses have been changed of course in the examples.

[crarko adds: This works at least as far back as Leopard, and it wouldn't surprise me if it goes back further. I didn't find an obvious duplicate, but it's possible this has been mentioned before.]
  Post a comment  •  Comments (4)  
  • Currently 3.00 / 5
  You rated: 3 / 5 (5 votes cast)
 
[3,592 views]  View Printable Version
10.7: Enable AirDrop on Macs without supported wireless hardware Network
AirDrop is a handy way to share files between Macs. Unfortunately, it is only supported on newer models which have the hardware necessary to support a certain type of point-to-point WiFi connection. There is, however, a hidden setting to enable AirDrop on older Macs. Just type:

defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1

into a Terminal window, hit enter, and relaunch the Finder.

Note that:
  • You must do this on both the sending and receiving macs, even if one of them already has the correct WiFi hardware (I think).
  • You will be able to see other macs on the same network, and they will be able to see your Mac (when AirDrop is open), even if they are not physically nearby. On a larger network with many Macs, this could potentially cause some confusion, although it shouldn't be a real security issue. This may be why Apple decided not to enable this feature by default.
  • Both macs must be connected to the same network somehow (ethernet, existing WiFi network, etc.)

[crarko adds: So here I sit, with only one Lion machine, so I can't fully test this. However, when using the command, it did enable the AirDrop icon in the Finder's Sidebar and said it had become available, so it will likely work, given the caveats mentioned above. To reverse this, just change the 1 in the command to a 0. This will be a great boon to those of us with some older (but still Lion-capable) machines still around.]
  Post a comment  •  Comments (27)  
  • Currently 4.81 / 5
  You rated: 5 / 5 (21 votes cast)
 
[78,201 views]  View Printable Version
10.7: Monitor your Wi-Fi with Wi-Fi Diagnostics Network
Lion ships with an app called Wi-Fi diagnostics. It allows you to monitor Wi-Fi networks your computer is connected to and collect various kinds of information. This utility could be very useful for finding problems or doing research on your Wi-Fi networks.

The easiest way to launch Wi-Fi Diagnostics is to open it directly from the location /System/Library/CoreServices.

Once it launches, you get some options to choose from. As an example, let's use the first, Monitor Performance. Select that and click Continue.

You are given a live-updating graph of the signal/noise ratio of your network. This could be useful for live testing to find problems with interference. For example, turn on your coordless phone and see if your ratio worsens. If it does, move your router farther away from the phone.

The other options are also useful, allowing you to log events like people connecting and disconnecting, and allowing you to sample raw data sent across the network.

[crarko adds: A good utility to have, with some very powerful capabilities. Use it responsibly, and also take it as a reminder not to send private data over unencrypted connections, because there are plenty of programs which can snoop open Wi-Fi networks.]
  Post a comment  •  Comments (2)  
  • Currently 3.83 / 5
  You rated: 5 / 5 (6 votes cast)
 
[41,354 views]  View Printable Version
10.7: Active Directory Binding Network
Many people, myself included seem to be having problems binding 10.7 machines into Active Directory, a cryptic 'Error 5202' seems to be fairly common. Here's the fix that worked on our network.

Initially I managed to get machines to bind by manually creating an edu.mit.Kerberos file and populating it before performing the actual bind. This would work but a reboot would often cause a 'Network Accounts Unavailable' message.

The opendirectoryd logs were full of messages such as 'No preferred destination' and 'Failed to retrieve keychain password for 'MACHINENAME$' module '' node '/Active Directory/DOMAIN'.'

On a whim I tried disabling IPv6 on the ethernet adapter -- which is apparently no longer possible using the GUI in 10.7. Once I disabled it from the command line the machine bound without the need to create a kerberos file and authentication worked perfectly.

You can disable IPv6 from the command line with:

networksetup -setv6off Ethernet

Alternatively the script below will disable it on all adapters:
#!/bin/sh

services=$(networksetup -listallnetworkservices | grep -v "*");

for service in "${services}"
do
	echo "Disabling IPV6 on ${service}";
	networksetup -setv6off "${service}";
done
exit 0
Note: I've read a few things that say that disabling IPv6 can cause problems but we don't use it on our network and I haven't had any issues yet.

[crarko adds: I haven't tested this one. Looking at the man page for the networksetup command gives -setv6automatic or -setv6manual as the parameters to enter to re-enable IPv6 using the above command.]
  Post a comment  •  Comments (7)  
  • Currently 3.25 / 5
  You rated: 5 / 5 (4 votes cast)
 
[33,323 views]  View Printable Version
10.7: Accessing Windows shares if files/folders do not appear in Finder Network
I'm experiencing a problem whereby the Windows shares I use at work mount in the Finder but don't reveal 'child of child' directories. So basically I can't see any of my working files/folders.

Here's a workaround I used in this situation:

Open Terminal, navigate to the share (once mounted) in /Volumes. Navigate to one of the child of child folders (they appear in Terminal but were empty when viewed in the Finder) and type 'open.'

This opens the folder in the Finder revealing the files/folders that were invisible before. In addition, you can now navigate 'up' in the Finder to see the previously hidden parent directory.

[crarko adds: I haven't tested this one.]
  Post a comment  •  Comments (3)  
  • Currently 3.60 / 5
  You rated: 3 / 5 (5 votes cast)
 
[4,720 views]  View Printable Version
A cross-platform text Clipboard using Dropbox Network
This hint describes how to set up a cross-platform text-only clipboard using Dropbox.

I've found myself frequently having a piece of text in one computer and wanting to have it in another one. I use Dropbox all the time, so the 'easiest' was to save the text to a text file in the Dropbox folder and open it in the other computer. Hey, it's like a Dropbox Clipboard!

See, the thing I haven't mentioned is that the two machines in question are a MacBook and a Windows 7 box, so that leaves out any Mac- or Windows-only solution. I also want something simple (so Synergy is out too) and tweakable. Full clipboard support is not simple, but fortunately I just need plain text and AppleScript (for OS X) and AutoHotkey (for Windows) can do everything I'll need, so let's code a bit.

One of AutoHotkey's strengths is its complete keyboard control so it can do it all in one punch:
;
; AutoHotkey Version: AutoHotkey_L 1.1 (Unicode)
; Language:           English
; Platform:           Win7 SP1
; Author:             Antonio Bueno 
; Last Mod:           2011-06-19
;
; Script Function:
;  - Copies (and cuts) to and pastes from a file in Dropbox, using Shift+Ctrl+C, X and V
;  - All the operations are in plain text (and encoded using UTF-8)
;  - The main objective is to get a plain-text clipboard across several computers
;  - As a side effect it works as a system-wide "paste without format" function
;  - In Windows Explorer, copying files results in a filelist with full paths

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases
SendMode Input ; Recommended for new scripts due to its superior speed and reliability
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory

Menu, Tray, Icon, %A_WinDir%\system32\shell32.dll, 217 ; Shows a clipboard icon in the system tray
; NOTE: The clipboard icon index is different for each Windows version

FileEncoding, UTF-8-RAW ; Text file operations use UTF-8 encoding without BOM

; Hardcoded location of Dropbox folder (proper method requires sqlite3 queries or base64 decoding)
DropboxFolder = %A_MyDocuments%\My Dropbox

; Shift+Ctrl+c copies (and Shift+Ctrl+x cuts) to DropboxClipboard.txt
+^c::
+^x::
  FileDelete, %DropboxFolder%\DropboxClipboard.txt
  ClipBoard =
  StringRight CopyOrCut, A_ThisHotKey, 1
  Send ^%CopyOrCut%
  ClipWait 2
  If !ErrorLevel
    FileAppend, %ClipBoard%, %DropboxFolder%\DropboxClipboard.txt
Return

; Shift+Ctrl+v pastes from DropboxClipboard.txt
+^v::
  IfExist, %DropboxFolder%\DropboxClipboard.txt
    FileRead, ClipBoard, %DropboxFolder%\DropboxClipboard.txt
  Else
    ClipBoard =
  Send ^v
  Sleep 50
Return
As the comments in the script mention, not only do I get a clipboard across all my Dropbox-linked computers, but I also get a system-wide 'paste without format' function.

NOTE: The script above requires a Unicode build of AutoHotkey_L. If you don't want to install it just to test this, just download the binaries and drop the script on the .exe.

AppleScript has no problems with the clipboard, but does not handle the keyboard shortcuts. I solved it with FastScripts, associating the keys Shift+Command+C, Shift+Command+X, and Shift+Command+V to these three scripts below.

Copy:
-- Hardcoded location of Dropbox folder (proper method requires sqlite3 or base64 decoding)
set DropboxFolder to ((path to home folder) as string) & "Dropbox"
set DropboxClipboard to DropboxFolder & ":DropboxClipboard.txt" as string

tell application "System Events"
  keystroke "c" using command down
end tell
try
  set outFile to open for access DropboxClipboard with write permission
  set eof outFile to 0
  write (the clipboard as «class utf8») to outFile
  close access outFile
on error
  close access outFile
end try
Cut:
-- Hardcoded location of Dropbox folder (proper method requires sqlite3 or base64 decoding)
set DropboxFolder to ((path to home folder) as string) & "Dropbox"
set DropboxClipboard to DropboxFolder & ":DropboxClipboard.txt" as string

tell application "System Events"
  keystroke "x" using command down
end tell
try
  set outFile to open for access DropboxClipboard with write permission
  set eof outFile to 0
  write (the clipboard as «class utf8») to outFile
  close access outFile
on error
  close access outFile
end try
Paste:
-- Hardcoded location of Dropbox folder (proper method requires sqlite3 or base64 decoding)
set DropboxFolder to ((path to home folder) as string) & "Dropbox"
set DropboxClipboard to DropboxFolder & ":DropboxClipboard.txt" as string

try
  set inFile to open for access DropboxClipboard
  set the clipboard to (read inFile)
  close access inFile
on error
  close access inFile
end try
tell application "System Events"
  keystroke "v" using command down
end tell
NOTE: For these scripts to work you probably need to 'Enable access for assistive devices' in the Universal Access System Preference pane.

This is a standalone and simplified version of the scripts I really use, for the sake of clarity. The ones I use get the Dropbox folder path from Dropbox's configuration files, encrypts and decrypts the text in the file, and do a couple of extra things with files inside the Dropbox folder, all this accompanied with notifications, so I know what's happening.

I hope someone else find this useful, and if there are better ways to do it, please tell about it in the comments.

P.S. I really, really would love to have something similar in my iPhone. Right now I get by giving DropboxClipboard.txt a star in the Dropbox app and using the system clipboard, but it's not the same.

[crarko adds: I haven't tested this one.]
  Post a comment  •  Comments (11)  
  • Currently 3.80 / 5
  You rated: 3 / 5 (5 votes cast)
 
[7,269 views]  View Printable Version
Toggle Airport On and Off Network
The hint 'Control Airport Without Menu Bar' in the June issue of Macworld (also see this article) was very informative and useful. I devised a simple script based on the article hint that toggles airport on and off.

Here is the script. Copy and Paste it into AppleScript Editor and save it as an Application.
--
-- Toggle Airport Power On and Off
--
if (offset of "On" in (do shell script "networksetup -getairportpower en1")) > 0 then
	do shell script "networksetup -setairportpower en1 off"
else
	do shell script "networksetup -setairportpower en1 on"
end if

[crarko adds: I tested this, and it works as described. It follows precisely the method described in the linked Macworld article, in case you hadn't seen that.]
  Post a comment  •  Comments (8)  
  • Currently 3.43 / 5
  You rated: 4 / 5 (7 votes cast)
 
[9,551 views]  View Printable Version