Showing posts with label Library. Show all posts
Showing posts with label Library. Show all posts

Monday, 1 December 2014

OS X installing Profiles .mobileconfig files through ARD command line

I've not quite got OS X server running pushing changes to macs yet, so in the mean time I have to change a profile through the web service, download it and install it on the machines I want to update.

I found this article which helped doing it through command line:

/usr/bin/profiles -I -F "/Library/MyOrganization/Company Wi-Fi.mobileconfig"
 
I first copied the file to "Users/Shared" then ran this script. To improve it, I could make a pkg file which ran a script to install the file. That is the next step

Thursday, 30 October 2014

transfering music from ipod to itunes on OS X

So you have your music on you iPod and now you want to transfer it to another iTunes library for free?

Solution:

  1. Download iExplorer
  2. Load it up and right click and "mount" iPod
  3. load up terminal and type:
    1. defaults write com.apple.finder ShowAllFiles YES
  4. go to the apple at top left > Force Quit ...
  5. Click on finder and "Relaunch"
  6. Load up a new Finder window, go to the iPod > iPod_Control > Music
  7. Copy the Music Folder to your desktop
  8. load up "Terminal" again and type:
    1. chflag nohidden ~/Desktop/Music
    2. chflag nohidden ~/Desktop/Music/*
  9. Now you can load up iTunes and copy the music folder onto it
  10.  Sorted!
  11. Oh, you probably want to not show hidden files anymore so type:
    1.  defaults write com.apple.finder ShowAllFiles NO
Cheers

Wednesday, 8 October 2014

Mavericks Black Screen with Cursor (mouse)

Just encountered two Mac Mini's which, when turned on, show a black screen with a cursor which moves when you move the mouse. cmd + alt + esc doesn't do anything.

Tried:
  1. reset PRAM
  2. SafeBoot (hold down shift)
  3. hold down cmd + s and type "/sbin/fsck -yf"
I gave up and reimaged these macs.

Did a bit of research afterwards and found this apple discussions on it. There were two suggested fixes. One involved blindly logging in which isn't an ICT Technician friendly fix. However, Spiro.r suggested:

1. ssh 192.160.0.1 -l username
2. sudo rm /Library/Preferences/com.apple.loginwindow.plist
3. sudo rm /Library/Preferences/loginwindow.plist
4. sudo rm /private/var/db/.AppleUpgrade
5. reboot


As ssh is by default turned off, you could also do this in single user mode (hold down cmd + s).

Apparently it is a problem with updates. It basically wants you to log in and OK an update, but seems to stop the login screen appearing. Not entirely sure anyone knows what's happening, but deleting these preference files and .AppleUpgrade fixes it. I shall try it next time I see it.

Monday, 6 October 2014

Apple Remote Desktop ARD preferences and presets transfer

It's always good to have a backup of all the preferences and tasks you have saved in ARD. I thought I had it sussed,  just need the file:

~/Library/Prefeences/com.apple.remotedesktop.plist

Turns out as of version 3.7 it's all been 'sandbox'ed. That means these prefences files have been moved to:
~/Library/Container/com.apple.remotedesktop/Library/Preferences/com.apple.remotedesktop.plist

But not only this, it has to have the right ACL's (permissions)

What I tried to do is copy this file between accounts and it ended up replacing the copied file with a blank one every time. It wasn't until I read this post which mentioned resetting ACL's. THis is the command they suggested using:

{ sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
So first I copied the com.apple.remotedesktop.plist file to  
~/Library/Container/com.apple.remotedesktop/Library/Preferences/com.apple.remotedesktop.plist

I then ran the command in terminal.

Then I logged out and back in again.

Crash bang wollop it worked.

Cheers

Wednesday, 10 September 2014

Mavericks "The software for the printer was installed incorrectly" error

After reimaging a computer suite with Mavericks and installing a networked printer via "Profile Manager" mobileconfig files, the printer had an exclamation mark next to it in the print dialogue box. When a print was sent to the queue, the print queue would load up and prompt the error:

"The software for the printer was installed incorrectly.
Would you like it to be repaired?"

After clicking "Repair" you are prompted with an Administrator Username and Password dialogue box.

I needed to find a way of "repairing" all these machines via ARD or Profile Manager. Looking in console, I found that the error was due to:
"/Library/Printers/hp/filter/hpPostProcessing.bundle/Contents/MacOS/hpPostProcessing" has insecure permissions (0100775/uid=0/gid=80)"

I found this forum which mentions the fix which is to change owner and permissions.

I ran a few commands to first change the owner, which needs to be Wheel, and the permissions with need to be 755. After doing so, I needed to reboot to see if it had fixed it, only to come up with more errors due to insecure permissions of the containing folders. After continuously doing this it finally fixed it.

I ended up running a command which changed the permissions for the whole /Library/Printers folder recursively:

chmod -R g-w /Library/Printers/
chown -R root:wheel /Library/Printers/

This needs to be run as root, which is an option in ARD, or you can put "sudo" before each line.

Monday, 10 March 2014

OS X Mavericks and Active Directory Home drive problems (NHR)

So, I'm going to document what problems I currently have with Active Directory home drives stored on windows SMB shares.

In the past when we put our macs on the active directory logins, I always untick the "Force local home" in the active directory options. The main reason is so that users take with them all of their account settings and preferences where-ever they login. This does however come with problems. It seems the mounted home drive has some permission issues which some applications have real problems with.

In the past I have installed Network Home Redirection (NHR). At login, this script runs whenever it detects the user to be a network user. It then creates a local temporary folder and creates alias' from particular folders on your home drive to the local folder. From the perspective of an application running, it thinks that these folders are normal local folders which they tend to prefer.

The default NHR setup redirects folders of known problems in OS X 10.6. But I don't think it is updated anymore. I have been constantly adding and taking away folder re-directions for the application we use in the computer suites.

Here I shall document current problems with network home preferences where NHR has worked.

Adobe Acrobat Pro 9
Seems to Crash when opening a document
Redirected folder: ~/Library/Application\ Support/Adobe/Acrobat
Seems to have fixed the crash

Thursday, 17 May 2012

Safari Crashing on OS X 10.6.8 for Active Directory Users

It appears on the machines where they were 'accidentally' updated to OS X 10.6.8 (we currently run OS X 10.6.6), Active Directory users cannot run Safari as it crashes on launch. For local users Safari works fine. I have deleted the ~/Library/Safari/ folder and also the ~/Library/Preferences/com.apple.safari* files.

My initial conclusion is that Safari doesn't like the permissions on certain folders in the ~/Library folder. e.g. Caches folder. I am used to this issue hence the installation of the useful program "NHR" (Network Home Redirection"), which currently redirects the ~/Library/Caches folder to a local location. I shall look into pinning down which folder needs redirecting. I have found this post which suggests ~/Library/Safari/WebpageIcons.db causes crashes. I shall continue to add to this post.

Wednesday, 28 March 2012

Canon LiDE 60 on OS X 10.6.6 and Active Directory probs

So, after installing the scanner (heres the notes) I then thought all would be fine. It turns out that students logging in through active directory would not be able to scan. It would not provide a preview of what was in the scanner, nor would it let you press the scan button.

On looking in the logs I found this entry:
28/03/2012 12:56:47 /System/Library/CoreServices/coreservicesd[48] removing dropped transaction for -114,_mac_bind/Library/Preferences/CanoScan LiDE 60/~SGCheck.tmp

It appears the program cannot gain the right access privilages to this folder, as it is on a Windows SMB share (I think) through active directory.

On trying to create an alias to this using OS X finder I saw this error:
28/03/2012 13:02:29 kernel smb_maperr32: no direct map for 32 bit server error (0xc0000279)

As I have NHR installed, which redirects certain folders, I thought I'd try and redirect this /Library/Preferences/CanoScan LiDE 60/ folder.

After redirecting it to the local drive, I found it still not working. I found another error:

3/28/12 1:07:52 PM /System/Library/Image Capture/Devices/TWAINBridge.app/Contents/MacOS/TWAINBridge[4423] Allocator race detected: transaction is not verified for -114/2 - _mac_bind/Library/Preferences/~SGCheck.tmp
3/28/12 1:07:55 PM /System/Library/CoreServices/coreservicesd[48] removing dropped transaction for -114,_mac_bind/Library/Preferences/~SGCheck.tmp
3/28/12 1:07:59 PM /System/Library/CoreServices/coreservicesd[48] removing dropped transaction for -114,_mac_bind/Library/Preferences/~SGCheck.tmp
3/28/12 1:07:59 PM /System/Library/CoreServices/coreservicesd[48] removing dropped transaction for -114,_mac_bind/Library/Preferences/~SGRot.tmp

It looks like it needs to write two files to the ~/Library/Preferences folder:
~SGCheck.tmp
~SGRot.tmp

I regigged the LIclean.hook to delete the Preferences folder, create it in the tmp folder on the local drive, and to create a symlink in the users Library folder.

Having done this, it worked like a dream. I would preferably have it so that it just had a symlink to these files it needs, but they are probably deleted as soon as they're not needed any more, and that would be the end of the symlink until the next login.

Anyway, for reference, here are the lines I added to the LIclean.hook file:
rm -rf "$home_loc"/Library/Preferences
mkdir /tmp/$1/Preferences
ln -s /tmp/$1/Preferences/ "$home_loc"/Library/Preferences


Thinking about it I'll also need to sort the LOcleanupclean.hook file. Here's what I need to add:
rm -rf "$home_loc"/Library/Preferences

Thats a good days work.

Wednesday, 15 February 2012

iTunes Apps folder on OS X

So, I've been downloading a few new apps for the iPads and have just been notified that I'm using too much disk space. So, looking into where the apps are stored I found this folder:

~Music/iTunes/iTunes\ Media/Mobile\ Applications

Thought I'd move this to the local drive and make a symlink:

ln -s /Volumes/Scratch\ Disk/Stephen/Mobile\ Applications /Network/Servers/appleton.chesterfield.ac.uk/home2\$/LeachS/Music/iTunes/iTunes\ Media

Yep, still works. So all is good.

Thursday, 9 February 2012

Installing UniFLOW client on Mac OS X 10.6 and deploying it

So, we're going to be using a UniFLOW system for our print management. Everythings working fine, just need to deploy it to all the Apple Macs under my control.

Simply set up the printers on one machine. Load up Workgroup Manager and add these printers to whatever managed computer lists you have (but make sure the managed computers have the drivers installed first!)

Next is to install the client. Luckily it comes as a mpkg file! Just have to set the preferences to pick up the right server and settings

From what I can find the settings are in a plist file:
~/Library/Preferences/com.NT-Ware.UniFLOWMacClient.plist

Although In this file there were only a few things:

TEST
aaa

Doh!

But I have also found:
~/Library/Preferences/ByHost/com.NT-Ware.UniFLOWMacClient.001b6399ade5.plist

Which contains:





LogFileName

LogonNoName

PopupForEveryJob

Reditect

ServerName
put.your.server.dnsname.here.com

(it didn't put all of the "<" and ">" things in!!

Result. Not sure what the "ByHost" folder is all about. I might look into it if just getting this plist file and putting in workgroup manager doesn't work.

So, I saved this file in the ByHost folder as ~/Library/Preferences/com.NT-Ware.UniFLOWMacClient.plist and added it to the Workgroup Manager - Managed Groups - Preferences - Details tab and set it to "Always".



Now when I load up the UniFLOW - MacClient app it comes up with the right server!

But for some reason it hasn't popped up when printing. Might be to do with the user. I'll try my login.......
.... yep worked a charm.

Just emailing the guy in charge to see if he can set up my test user the same as myself (I think the main thing to do is change the threshold for when the user gets notified).

Yep, turns out the test user account didn't have any budget or anything. Now he's sorted the account out, everything works fine!

Monday, 12 December 2011

iTunes iPad backup location

I've noticed my Library folder get immensely large. I looked into it with OmnDiskSweeper (now that WhatSize has decided to charge) and found nearly 800MB (not much nowadays but too much for this as far as ICT Services goes) was taken up with iPad backups:

/Library/Application\ Support/MobileSync/Backup

I thought the easiest solution was to move it to the local scratch disk and symbolically link it. Heres the exact command I used to create the symbolic link:


ln -s /Volumes/Scratch\ Disk/Stephen/Library/Application\ Support/MobileSync/Backup /Network/Servers/appleton.chesterfield.ac.uk/home2\$/LeachS/Library/Application\ Support/MobileSync 

Seems to have done the trick.

I also noticed another folder taking up a lot of disk space whenever I tried to do a software update for the iPads:

/Volumes/Scratch\ Disk/Stephen/Library/iTunes/iPad Software Updates/

I decided to move the whole /Library/iTunes folder across. Here's the command I used to create a symbolic link:

ln -s /Volumes/Scratch\ Disk/Stephen/Library/iTunes /Network/Servers/appleton.chesterfield.ac.uk/home2\$/LeachS/Library

Wednesday, 14 September 2011

iPhoto '11 (version 9) library's volume is unsupported

After recently updating the OS and iLife to 10.6.6 and iLife '11 I've found that for networked users (using Active Directory hosted on Windows servers) this message appeared:

Error
The library could not be opened because the file system of the library's volume is unsupported

It became apparent that the new version of iPhoto does not support photo library's on this type of networked volume. I have now found it to encompass any type of volume which is not 'Mac OS Extended (Journaled)'.

I found quite a few postings on the subject, but most were concerned with NAS storage backup stuff, for which a few solutions were posted, but nothing relating to Active Directory windows servers stuff. But, at last, after a few more minutes I came across this post by PJ_AU down the bottom:
  1. Simply double click on the iphoto library located in the Pictures folder.
This opens it up in iPhoto, and iPhoto does not check the volume it is on.

For new users:
  1. 'Alt' click on the iPhoto icon in the dock (this opens iPhoto prompting for a library)
  2. Create a new iPhoto Library on the local Mac OS Extended (Journaled) volume
  3. Close iPhoto
  4. Move the Library to the networked (or unsupported) volume
  5. Double click it to open it in iPhoto
From then on iPhoto does not check the volume the library is on. It ONLY checks the volume when creating or updating the iPhoto Library.

Tuesday, 13 September 2011

Network Home Redirector - reverting back

Back when we had OS X 10.5 installed throughout the computer suites we had to run a script at startup which created a symlink for Caches in the users Library folder. These scripts were called NHR (Network Home Redirector) This linked to a folder stored locally, as the caches folder stored on the Active Directory smb shares had permissions issues for some applications.

The only thing which didn't work quite as planned was the fact that the logout scripts never ran, and so people were left with the symlink in their Library folder.

Now we have updated to OS X 10.6.6, this permissions issue seems to have resolved itself. But anyone who logged in last year has now got a symlink for their Caches folder, and not a folder! To resolve it I plan to make a small script which, upon login, looks for a symlink, deletes it and makes a nice new folder.


I've had a look at the man page for 'ls' function, and if you use the -l command in it, it shows you more info on the files and folders. Any with a 'l' at the beginning of the line are symbolic links. I ran the command with the grep command to pick out the Caches folder:

ls -l Library/ | grep 'Caches'
lrwxrwxrwx+ 1 leachs  CHSTFADMIN\teaching_global     19 15 Sep 14:00 Caches -> /tmp/leachs/Caches/
So thats a good start.