The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,861 other subscribers

Archive for the ‘Mac OS X 10.7 Lion’ Category

Mac OS X: getting default route and ip addresses

Posted by jpluimers on 2015/11/30

On Mac OS X, bare route and ifconfig give way too much information to view the most important things at once.

So I used an alias for this:

route -n get default | grep 'gateway' && echo && ifconfig | grep '\: flags\|inet\|inet6'

Later I needed IPv6 support, so I changed it to:

netstat -nr | grep 'Internet\|Gateway\|default' && echo && ifconfig | grep '\: flags\|inet\|inet6'

So you get something like this:

Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            192.168.178.1      UGSc           23        0     en4
default            192.168.71.1       UGScI           7        0     en0
Internet6:
Destination                             Gateway                         Flags         Netif Expire
default                                 fe80::3631:c4ff:fe47:13f1%en0   UGc             en0

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    inet6 ::1 prefixlen 128 
    inet 127.0.0.1 netmask 0xff000000 
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    inet6 fe80::6203:8ff:fea2:4814%en0 prefixlen 64 scopeid 0x4 
    inet 192.168.71.40 netmask 0xffffff00 broadcast 192.168.71.255
    inet6 2001:982:2345:1:6203:8ff:fea2:4814 prefixlen 64 autoconf 
    inet6 2001:982:2345:1:4011:119a:e527:e021 prefixlen 64 autoconf temporary 
en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
en4: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    inet6 fe80::426c:8fff:fe44:95ea%en4 prefixlen 64 scopeid 0xb 
    inet6 fd00::426c:8fff:fe44:95ea prefixlen 64 detached autoconf 
    inet6 fd00::74a7:8f26:cd22:20b7 prefixlen 64 detached autoconf temporary 
    inet 192.168.178.22 netmask 0xffffff00 broadcast 192.168.178.255

–jeroen

via:

Posted in Apple, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User | Leave a Comment »

OS/X – How to print screen in Remote Desktop Client (RDS) on Mac OS X? – Super User

Posted by jpluimers on 2015/11/16

The only reliable way to create a remote print-screen is by using the Windows On-Screen Keyboard. It even works with Alt-Prt+Sc to make screenshots of individual Windows.

Just run OSK to start the On-Screen Keyboard.

–jeroen

via: osx – How to print screen in Remote Desktop Client (RDS) on Mac OS X? – Super User.

Posted in Apple, Keyboards and Keyboard Shortcuts, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User | Leave a Comment »

osx – Toggle AppleShowAllFiles with a simple bash script? – Stack Overflow

Posted by jpluimers on 2015/10/15

LOL:

The if syntax of your script was a bit…well, iffy.

Indeed it is:

#!/bin/bash
#toggle AppleShowAllFiles

current_value=$(defaults read com.apple.finder AppleShowAllFiles)
if [ $current_value = "TRUE" ]
then
  defaults write com.apple.finder AppleShowAllFiles FALSE
else
  defaults write com.apple.finder AppleShowAllFiles TRUE
fi

killall Finder

Even the alternative if statement is:

if [[ $(defaults read com.apple.finder AppleShowAllFiles) == TRUE ]]

–jeroen

via osx – Toggle AppleShowAllFiles with a simple bash script? – Stack Overflow.

Posted in Apple, bash, Development, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Scripting, Software Development | Leave a Comment »

Restore music and video from iPod: the iPod_Control\Music folder

Posted by jpluimers on 2015/10/09

When you’re not a frequent iTunes user, and recycle computer systems, then every once in a while you will get you in to a situation where you have Music on your iPod, but not on your PC any more.

Whereas iTunes is great at putting music on an iPod, it cannot get it back.

There are numerous paid tools to get the music from your iPod, but doing it manually is not that hard. Below are a few links to get you started, but they all come down to this:

  1. Your iPod has a hidden folder called iPod_Control in the root
  2. Inside the iPod_Control folder is a folder called Music
  3. Inside the Music folder, there are folders named with letters and numbers like F00
  4. Each numbered folder has media (music, video or even photos!) files with a strangely encoded name like B00N.mp3 or 3DUN.m4v with supported media extensions including mp3 m4a m4p jpg gif tif m4v mov.
  5. The media files contain meta data with song, artist, album, etc.

The steps to copy them back

  1. Do not erase your iPod when opening it in iTunes!
  2. Ensure you can mount your iPod as a disk (the “enable disk use” option in iTunes)
  3. Mount your iPod as a disk in Mac or PC
  4. Ensure you can view the hidden files
  5. Copy the Music folder including all subfolders to your Mac or PC
  6. Unhide the Music folder and all Music and Music/F* folders inside it using this chflags trick from Unhiding Unix Directories | Apple Support Communities:
    1. chflags nohidden Music
    2. chflags nohidden Music/F*
  7. Add these to your iTunes library and have iTunes re-generate the correct filenames from the meta-data

Some links explaining this in more detail:

–jeroen

Posted in Apple, iPod, iTunes, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Windows, Windows 7, Windows 8, Windows 8.1, Windows 9 | 2 Comments »

OSX: Log shell script events to the OS X system consolemacissues.com (If you are familiar with the Unix command line)

Posted by jpluimers on 2015/08/31

Interesting: Log shell script events to the OS X system consolemacissues.com.

–jeroen

via: If you are familiar with the Unix command line and shell scripting, then you….

Posted in Apple, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User | Leave a Comment »

Intermittent but frequent OS X pauses may be from iCloud syncing | MacIssues

Posted by jpluimers on 2015/05/21

fseventer is a great tool for investigating Mac OS X file system events. Like many low-level tools, it requires admin privileges.

This is apparent through the use of the tool “fseventer” which monitors what files on your hard drive are being accessed.

–jeroen

via: Intermittent but frequent OS X pauses may be from iCloud syncing | MacIssues.

Posted in Apple, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User | Leave a Comment »

Mac OS X: Open a Terminal at Folder from Finder / Open Finder at Folder from the Terminal (via: StackOverflow)

Posted by jpluimers on 2015/04/06

Thanks User Chris Page – Stack Overflow for answering on StackOverflow:

  • How to open a Terminal from a selected Folder in the Finder
  • Hoe wo open a Finder at the current Folder in a Terminal

Some quotes of his answer:

As of Mac OS X Lion 10.7, Terminal includes exactly this functionality as a Service. As with most Services, these are disabled by default, so you’ll need to enable this to make it appear in the Services menu.

System Preferences > Keyboard > Keyboard Shortcuts > Services

Enable New Terminal at Folder. There’s also New Terminal Tab at Folder, which will create a tab in the frontmost Terminal window (if any, else it will create a new window). These Services work in all applications, not just Finder, and they operate on folders as well as absolute pathnames selected in text.

In addition, Lion Terminal will open a new terminal window if you drag a folder (or pathname) onto the Terminal application icon, and you can also drag to the tab bar of an existing window to create a new tab.

Finally, if you drag a folder or pathname onto a tab (in the tab bar) and the foreground process is the shell, it will automatically execute a “cd” command. (Dragging into the terminal view within the tab merely inserts the pathname on its own, as in older versions of Terminal.)

You can also do this from the command line or a shell script:

open -a Terminal /path/to/folder

This is the command-line equivalent of dragging a folder/pathname onto the Terminal application icon.

–jeroen

via: osx – Open terminal here in Mac OS finder – Stack Overflow.

Posted in Apple, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.7 Lion, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User | 2 Comments »

Setting the SMB/Netbios name of your Mac

Posted by jpluimers on 2015/03/30

Even after changing the name of your Mac, from the Windows side it still looks like this:


C:\Users\developer>net view
Server Name Remark
——————————————————————————-
\\MACBOOKPRO-4C7F Jeroen's MacBook Pro
The command completed successfully.

I knew I had solved this in the past, as the MacBook Air showed up correctly in the list:


C:\Users\developer>net view
Server Name Remark
——————————————————————————-
\\MACBOOKPRO-4C7F Jeroen's MacBook Pro
\\MBAIR133JWP MBAIR133JWP
The command completed successfully.

The trick is that there are 2 names for your Mac: the name for the Apple side of things, and the name for the Windows side of things. For the latter you’d think it would be named SMB or NetBIOS. Read the rest of this entry »

Posted in Apple, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, OS X 10.8 Mountain Lion, Power User, SpotLight | Leave a Comment »

OS X Finder: viewing hidden paths

Posted by jpluimers on 2015/03/27

One of the most frustrating things on a Mac is that the OS X Finder does not allow you to browse all paths.

Unlike Windows the Windows Explorer, where it is fairly easy to switch a preference for enabling/disabling showing the hidden files and folders, there is no option in the Preferences. There is a command-line trick (see below) to enable/disable showing hidden files and folders.

Luckily, both the Windows Explorer and the Mac OS X Finder allow you to specify the full folder path to browse, where you can enter a path that otherwise would (partially) be invisible.

  • Windows Explorer: just enter a full path in the address bar.
  • Mac OS X Finder: press Shift-Command-G (or Menu -> Go -> Go to Folder...), then enter the full path.

An alternative for Mac OS X is the payed (but great tool) Path Finder which is one of the best Finder replacements I know.

Command-line trick to enable/disable Mac OS X Finder hidden folder behaviour

Read the rest of this entry »

Posted in Apple, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, OS X 10.8 Mountain Lion, Power User | Leave a Comment »

Mac OS X: Replicating md5sum Output Format (via: Raam Dev)

Posted by jpluimers on 2015/02/18

Mac OS X has md5, but no md5sum.

I agree with Mac OS X: Replicating md5sum Output Format that the second way of emulating md5 is better than the first one.

So here it is:


#!/bin/bash
/sbin/md5 -r "$@"

view raw

md5sum.bash

hosted with ❤ by GitHub

–jeroen

via: Mac OS X: Replicating md5sum Output Format – Raam Dev

Posted in Apple, bash, Development, Hashing, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, md5, OS X 10.8 Mountain Lion, Power User, Scripting, Security, Software Development | Leave a Comment »