Archive for ‘Tip’ Category
Browse:
Tip »
Subcategories:

Get rid of double (triple) entries in Finder’s “Open With” Menu

datePosted on 09:55, February 20th, 2013 by Many Ayromlou

Does sh*t like this make you wanna smack your mac :-)

Screen Shot 2013-02-20 at 9.48.59 AM

Here is a quick way to rebuild the Launch Services database and get rid of duplicates in the Open With submenu:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

This process should take about a minute or two. You should check to see if this has fixed the problem. On my machine, running 10.8.2, I had to also restart Finder to complete the process using the following command:

killall Finder

That’s all…..Now Open With submenu is squicky clean

Screen Shot 2013-02-20 at 10.07.02 AM

Turn Your FreeNAS Box Into the Ultimate Anonymous Downloading Machine

datePosted on 15:56, December 10th, 2012 by Many Ayromlou

Turn Your FreeNAS Box Into the Ultimate Anonymous Downloading Machine:

Here’s how to turn your FreeNAS box into the ultimate downloading machine so you can download safely and monitor its activity from anywhere.

(Via lifehacker.com)

IOS6 Passbook “Can’t connect to iTunes Store” error fix…..

datePosted on 16:36, September 20th, 2012 by Many Ayromlou

Yeah, brand new app in IOS6 and it does not work without fiddling…..Here is how you get it working:

  1. Open Settings.
  2. Open General.
  3. Open Date & Time.
  4. Switch the Set Automatically setting to Off.
  5. Open Set Date & Time.
  6. Set the date to a year ahead.
  7. Go back to the Home screen and open Passbook.
  8. Tap the App Store button. The App Store should load.
  9. Go back to Date & Time and turn on Set Automatically.

That’s it…….life goes on :-)

Copying large number of files between two Unix/Linux/OSX Servers

datePosted on 14:38, August 15th, 2012 by Many Ayromlou

Here are some quick tip(s) for copying a ton of files between unixy machines really fast. You’re probably thinking “why not use rsync?”…..well rsync can be miserably slow if your source or destination cpu is underpowered. You can always do a rsync after these commands to make 100% certain that everything checks out, but try using one of these methods for the initial copy:

  • One way of doing it is
    tar -c /path/to/dir | ssh user@remote_server 'tar -xpvf - -C /absolute/path/to/remotedir'

    You’ll be prompted for the remote servers password or you can use the private key of the remote server using the -i switch in the ssh command. This has the side benefit of preserving permissions. An alternate version of this command can also be used to locally move folder structures across mount points while preserving permissions: 

    tar -cf - -C srcdir . | tar -xpf - -C destdir

    or

    cd srcdir ; tar -cf - . | (cd destdir ; tar -xpf -)
  • Another way of doing it with netcat (nc) is
    srv1$ tar -cfv - * | nc -w1 remote.server.net 4321

    followed by

    srv2$ nc -l -p 4321 |tar -xpfv - 

    Note that you type the first command on the source machine and the second command on the destination machine.

  • Yet another way of doing it with socat utility is
    host1$ tar -cvf - * | socat stdin tcp4:host2:portnum

    followed by

    host2$ socat tcp4-listen:portnum stdout | tar -xvpf - 

    Note that you type the first command on the source machine and the second command on the destination machine.

Once your favourite process (above) is done you can do a quick rsync to tie up any loose ends.

rsync -avW -e ssh /path/to/dir/ remote_server:/path/to/remotedir

Rsync will now fly through the filesystem as 99.9% of the time, 99.9% of the files on the destination are good. And as always make sure you understand the commands before you use them…..and keep backups just in case :-).

Flush DNS cache in Lion and Mountain Lion

datePosted on 21:11, August 8th, 2012 by Many Ayromlou

Flush DNS cache in Lion and Mountain Lion:

To flush the DNS cache in Mac OS X 10.5 and 10.6, run this command in Terminal: 

sudo dscacheutil -flushcache 

To do the same in 10.7 and 10.8, run this command: 

sudo killall -HUP mDNSResponder 

(Via MacOSXHints.com)

CLI commands that let you access meta data of all files in OSX

datePosted on 14:29, July 31st, 2012 by Many Ayromlou

Two small commands with huge possibilities:

  1. mdls 
    usage: mdls [-name attr] [-raw [-nullMarker markerString]] [-plist file] path
    list the values of one or all the attributes of the specified file
    -raw: don't print attribute names before values
    -nullMarker: substitute this string for null attributes in raw mode
    -plist: output attributes in XML format to file. Use - to write to stdout
    option -plist is incompatible with options -raw, -nullMarker, and -name
    example: mdls ~/Pictures/Birthday.jpg
    example: mdls -name Keyword ~/Pictures/Birthday.jpg
  2. mdfind
    Usage: mdfind [-live] [-count] [-onlyin directory] [-name fileName | -s smartFolderName | query]
    list the files matching the query
    query can be an expression or a sequence of words
    
    	-live             Query should stay active
    	-count            Query only reports matching items count
    	-onlyin <dir>     Search only within given directory
    	-name <name>      Search on file name only
    	-s <name>         Show contents of smart folder <name>
    	-0                Use NUL (``\0'') as a path separator, for use with xargs -0.
    
    example:  mdfind image
    example:  mdfind -onlyin ~ image
    example:  mdfind -name stdlib.h
    example:  mdfind "kMDItemAuthor == '*MyFavoriteAuthor*'"
    example:  mdfind -live MyFavoriteAuthor

Everything you ever needed to know about OSX launchd

datePosted on 14:22, July 31st, 2012 by Many Ayromlou

Great in-depth article by Nathan Grigg. Everything you ever wanted to know about launchd and how job scheduling can be easily done under OSX.

How to install Office 2010 on Windows XP x64-bit edition

datePosted on 15:17, September 23rd, 2010 by Many Ayromlou

Let me guess…..you tried it and it failed. Well, there is a way (probably not sanctioned by MS) to get this done. I’ve installed it on two separate machines and verified that it works. First you need to download MSXML 6 from Microsofts website. Just go to microsoft.com and search for MSXML. There should be a link to MSXML6.0 download. Download the 64-bit version of the software and install it. Then force a windows update by choosing windows update from the start menu. You will notice a bunch of updates for MSXML. Let it update the files and reboot after that’s done.

Now you need to get the x86 version of office 2010 off the cd and copy it onto your computer somewhere (I just dragged the folder onto my desktop). We need to modify something and you can’t do that on the CD/DVD. Once the copy is done, find setup.exe right click on it and choose properties. Under the Compatibility tab choose “Run this program in compatibility mode for:” and choose Windows XP from the pull down.

Click Apply/Okay and double click setup to run it. That’s it. It works…..Happy days are here again :-).

Map any network drive to Mac OS X that auto mounts after system reboot

datePosted on 13:34, September 20th, 2010 by Many Ayromlou

Here is a quick recipe for making a network drive auto mount on your OSX machine. This works with pretty much any protocol supported by Finders “Connect to Server” option. Here is how you do it:

  1. From the Finder, hit Command+K or select Connect to Server from the Go menu.
  2. You’ll see the following window, enter the relevant information (ie: the network drive location, be it afp:// or smb:// or http://) and hit Connect button.
  3. Enter your login/password and click “OK
  4. Make sure your Finder Preferences are set so Network Drives are visible on your desktop:
  5. At this point you should have a icon like on your desktop
  6. Now go to System Preferences under the Apple menu
  7. Click on the Accounts icon under System and select Login Items tab (you might have to unlock this panel by clicking the small lock icon on the bottom left of that screen):
  8. Click the “+” sign to add a Login Item to the list and in the following screen go to your Computer icon (on the left under Devices) and select the mounted volume icon from the list on the right and click Add:
  9. You’ll end up with a screen similar to the one below. Click on Show All and exit Preferences. Reboot and make sure it all works.

That’s it…..Enjoy :-)

OSX Server: Could not setup Mach task special port 9

datePosted on 12:57, August 26th, 2010 by Many Ayromlou

com.apple.launchd[1] (0x10f860.cron[43786]): Could not setup Mach task special port 9: (os/kern) no access

If you’re seeing this warning/error in your OSX Server log files, it is more than likely caused by cron running jobs for mailman subsystem. Even if the Mail process is disabled in Server Admin, OSX will try to run these cron jobs. The way around this (only do this if you’re NOT running mail server or mailman mailing list manager on your box) is to comment out all lines in /usr/lib/cron/tabs/_mailman file (insert a # character at the beginning of each line that doesn’t have it). This fixed the problem for me…..hopefully it will also work for you :-).

12Next