Replacing the OS X Login Image
If you need to replace the system default image in Leopard OS X 10.5. You can do this easily from the terminal:
sudo cp /System/Library/CoreServices/DefaultDesktop.jpg /System/Library/CoreServices/DefaultDesktop.jpg.bak Then just copy in the image you want (you really want this to be the correct aspect ratio/resolution):
sudo cp ~/Pictures/filename.jpg /System/Library/CoreServices/DefaultDesktop.jpg
Finding and Listing Email Addresses from Active Directory Groups with Powershell
Get hold of the excellent Quest Free PowerShell Commands for Active Directory, then once installed use the following command from the powershell (Quest) console:
Get-QADGroupMember group name -Indirect | select name, email Change group name to the AD group you are interested in querying. Indirect will give you results from nestled grouping. This works for distribution groups as well as other types. Use the following to output the results to a csv file:
Adding Colour to ‘ls’ in OS X
You can add colour to ‘ls’ with the -G option. To reduce typing pop an alias in your bash_profile file:
alias ls=‘ls -G’
Adding MacPorts Path/Environmental Variable
Run the following from a terminal:
echo export PATH=$PATH:/opt/local/bin < < ~/.bash_profile source ~/.bash_profile
Report a Dell Service Tag Remotely
Create a text file with the following:
ComputerName = InputBox(Computer Name)strComputer = ComputerNameSet objWMIService = GetObject(winmgmts: _& {impersonationLevel=impersonate}!\ & strComputer & \root\cimv2)Set colSMBIOS = objWMIService.ExecQuery _(Select * from Win32_SystemEnclosure)For Each objSMBIOS in colSMBIOSWscript.Echo Service Tag: & objSMBIOS.SerialNumberNext``` Save it as a vbs then run: cscript filename.vbs
You will need to run the script with the correct permissons to WMI.
Run the Last Command with Sudo
This will add sudo to the last command (that you forgot to use sudo in the first place):
sudo !!
Updating MacPorts
sudo port selfupdate Then to upgrade your installed ports:
sudo port upgrade outdated
Creating A Custom WinPE Disk
Currently I am using this to run Dell updates on non windows operating systems that are not directly supported.
imagex /mountrw c:\winpe_x86\winpe.wim 1 c:\winpe_x86\mount imagex /unmount /commit c:\winpe_x86\mount copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim oscdimg.exe -n -bc:\winpe_x86\etfsboot.com c:\winpe_x86\ISO c:\winpe_x86\dell.iso
Compare Directories in Linux
comm <(ls ~/dir-new/) <(ls ~/dir) This works in OS x as well.