Interesting Snow Leopard reads
Some interesting reads for anyone wondering about the upcoming OS X 10.6.
http://www.appleinsider.com/articles/08/08/26/road_to_mac_os_x_10_6_snow_leopard_64_bits.html
This is a good place on Snow Leopard developments
Great tire wall cleaner
This past weekend I was washing my truck and really wanted to clean my white lettering on my tires. Well, after some searching around the garage I noticed I was out of my normal tire cleaner. So I pondered for a minute and then decided to try my hand cleaner.
IT WORKED! The stuff actually worked and worked really well. What was it? Orange Goop hand cleaner. Stuff works on anything.
mDNSResponder — Mac stuck at boot screen
So today I had a professor bring their Leopard 10.5.4 laptop back to me because it was stuck booting up. Well, come to find out in single user mode the System log file had a whole bunch of lines like this:
—–
com.apple.launchd[1] (com.apple.mDNSResponder[53]): posix_spawnp(”/usr/sbin/mDNSResponder”, …): No such file or directory
…com.apple.launchd[1] (com.apple.mDNSResponder[53]): Exited with exit code: 1
…com.apple.launchd[1] (com.apple.mDNSResponder): Throttling respawn: Will start in 10 seconds
—–
So, after some searching I found that it probably could be permission problems. Sure enough, I changed the permissions on the root volume to 775 and bingo the laptop now boots. What the heck!
chmod 775 /
First post from iPhone
So, this is my first post from my iPhone. Very cool application. But it is scary to think that I can post from anywhere I have signal. Very cool!
Reset your LCD on MacBook or MacBook Pro
So, I just learned this interesting key combo tonight. Hold down ctrl-shift-eject keys to reset your LCD to factory defaults. Hmm…. Another hidden gem.
R
Setting up AWStats on Leopard Server and Client
For my side business MACSYS I had to setup AWStats for a client. So, since I did not find to much documentation out there to aid in the installation, I decided to create a post on my business blog to aid others in getting this very cool statistics app up and running.
Check it out here: http://macsysrochester.org/wordpress/?p=4
Netbooting Macs across subnets
So, I was recently asked if we Netboot are machines. The answer to that is yes and we have been since the days of 10.0. The main reason for moving to Netbooting computers is the convenience of not having to be at that physical spot to reimage a computer. The other main reason is that it is fast and very cool.
So, how is this achieved one might ask. First off, let’s list the tools that you will need for such an endeavor.
TOOLS:
- OS X Server running the Netboot daemon
- OS X Server hosting the disc images for Netboot –> this is usually the same machine as your netboot server
- A file server to handle the images that get deployed, i.e. Lab images or Faculty images
- This for us is a separate OS X Server with the images on a AFP share. These can be SMB or even NFS.
- Bombich: http://www.bombich.com
- NetRestore
- This application is used to apply your “models” to the client computer”
- NetRestore Helper
- This application is used to create your “model” image and also your Netboot Install image that your computers will boot from over the network
- NetBoot across subnets or NBA
- This is the tool used to build the shell script you will need to run on your client computers to get them to NetBoot accross the subnets –> or you can just look below. I already have the script that is need for both.
- This is the tool used to build the shell script you will need to run on your client computers to get them to NetBoot accross the subnets –> or you can just look below. I already have the script that is need for both.
- NetRestore
- Apple Remote Desktop
- This one is optional, but really a requirement if you want total automation, or at least automation from your office desktop.
THE MAGIC:
So, here is how all of this works. First off let’s explain a bit about how to get started.
First thing you do is setup your back end infrastructure to support your new NetBoot environment. Setup your OS X server and turn on the NetBoot feature.
Now setup your File Server (recommended that this is a different machine then your NetBoot box) and create a user that has read only access to your “image” directory. i.e. Create a share point to hold your “Model” images that you create using NetRestore helper.
Okay, now go to your latest and greatest machine you have in your department and download and launch NetRestore Helper. Once started select the “Create NetInstall Set” tab. Give your image a name, recommended that it does not contain any spaces. Mine is called NetBoot_Intel. Image ID can be 101 or something of that short. Description is not required but you can put something in there if your desire. Leave the Protocol set to NFS.
Now click on the “Advance Settings” and you will see a new window. Here is were the true magic lies. You can turn on ARD under NetBoot. Yes, you can remote control a netbooting machine. COOL STUFF!!!! Anyways, check the boxes next to “Enable Screen Sharing” and “Enable SSH”. The SSH one is up to you. Then fill in the Username and Password field for the account that is going to get created. I recommend this be the same local user that you use for Remote management and as a back door to your systems.
Okay, hit the “Okay” button and click the “Save NetInstall-Restore set” button. NetRestore Helper will now create the desired NetBoot disc image on your desktop.
Once the image is created you can modify NetRestore’s settings by launching the application right from the disc image. I will not get into this here. The settings are pretty much self explanatory. If you are wondering though, I do not use the local settings feature. I actually build my settings on the fly using a MYSQL database, shell, and PHP scripts.
Well now you have your NetInstall disc image. What need to do next is copy the disc image to your NetBoot server. The NetBoot folder is usually located in /Library/NetBoot/. Inside you will see multiple folders. Put your disc image inside the NetBootSPO folder. The NetBoot side of things is now set. You may need to restart the NetBoot server for the new disc image to work.
Now, from here you can use NetRestore to create your “Model image” and then upload that to the your file server share. I will post more detail about this later.
Now, how do we get these machines to NetBoot. If the machine is located in the same subnet as the NetBoot Server then you will see the option to Boot to your server in the Startup Disk utility. To boot machines off subnet, you need to install the following script and then run it. This is where Apple Remote Desktop comes in handy. You can just actually run this script right from the “Run Unix Command” without installing it. Please make sure you change the variables to match your environment.
— Begin Script —
#!/bin/sh
# Name: Robert Henderson
# Date: 2-25-2005
# Description:
# Allows the user to make a choice on which netboot volume they want to boot from.
# Thanks to Mike Bomich for the original code created by NBA.
### Global Variables ###
server=<enter your NetBootServer’s IP Address here>
sharepoint=”NetBootSP0″
# Determine Arch value and point to proper netboot image
archtech=`arch`
if [ "`arch`" == "ppc" ] ; then
setName=”PPCNetboot.nbi”
else
setName=”IntelNetboot.nbi”
fi
imageName=”NetInstall-Restore.dmg”
protocol=”nfs”
simple=”false”
nextboot=”"
if [ $simple == true ]; then
if [ "`arch`" == "ppc" ]; then
/usr/sbin/nvram boot-device=”enet:${server}” boot-args=”" boot-file=”"
else
/usr/sbin/bless –netboot –server “bsdp://${server}” $nextboot
fi
else
if [ "`arch`" == "ppc" ]; then
/usr/sbin/nvram boot-args=”rp=${protocol}:${server}:/private/tftpboot/NetBoot/${sharepoint}:${setName}/${imageName}” boot-file=”enet:${server},NetBoot\\${sharepoint}\\${setName}\\mach.macosx” boot-device=”enet:${server},NetBoot\\${sharepoint}\\${setName}\\booter”
else
/usr/sbin/bless –netboot –booter “tftp://${server}/NetBoot/${sharepoint}/${setName}/i386/booter” –kernel “tftp://${server}/NetBoot/${sharepoint}/${setName}/i386/mach.macosx” –options “rp=${protocol}:${server}:/private/tftpboot/NetBoot/${sharepoint}:${setName}/${imageName}” $nextboot
fi
fi
reboot
— End of Script —
So, there you have it. NetBoot is cool and very helpful when working on computers remotely.
Unlocking a folder via terminal
Always a useful command to have when working on someone’s machine. To remove a “Lock” from a user’s folder run the following command.
sudo chflags nouchg --pathtoFolder--
This certainly came in handy for me today.
Removing items from OS X dock — on a mass scale
So, I was looking around the internet today and was trying to figure out how to automate removing applications from the User’s dock. After about an hour of searching, I came to the realization that there really is no good solution, especially one from the command line.
Well, come to find out, Apple actually ships a handy little script called PlistBuddy that allows you to modify plists rather easily. Certainly better than using the defaults command.
To locate the PlistBuddy, run the following command.
/usr/bin/locate PlistBuddy | sed 2,10000d
The result will show you the path to the first hit for PlistBuddy. If you want to see all of them just run the first part of that command.
/usr/bin/locate PlistBuddy
So, I have created a script using PlistBuddy that will remove any occurrences of the keyword you supply. Basically, just save the following script into a file called removeApps.sh (or whatever you want to call it), move the PlistBuddy script to a good place for scripts, like /usr/bin/ and then run my script. Example to remove all Microsoft apps,
removeApps.sh Microsoft
Hopefully this will help a lot of Mac administrators out there that are looking for quick ways to remove Dock items.
Here is the script, enjoy.
Remove App
Decided to join
Well, since everyone is going crazy about blogs and wordpress, I decided to see what all the commotion is about. I guess it is a good way to stay in touch and share your thoughts. Makes everything searchable by google and collaboration is at it’s highest point once it is on the web. Share your thoughts, give me your mind….
So, here is the start to my blogging future. Good or bad, time will tell.