Terminal User notifications

Posted by on in Hints
OSAscript   osascript -e 'tell app "Finder" to display dialog "Hello World"'  osascript -e 'tell app "System Events" to display dialog "Hello World"'     sudo gem install terminal-notifier terminal-notifier -message "Hello, this is my message" -title "Message Title"     osascript -e 'display notification "Sample Title" with title "Title"'...
Hits: 1035
0
Continue reading

Shutting Down the StorNext M440 System

Posted by on in Hints
Follow these steps to cleanly shut down and power off the StorNext M440 system:   1. Halt all I/O access to SAN and/or LAN clients.   2. For each SAN and/or LAN client, unmount and/or unshared the file systems. Refer to that client’s operating system administrator’s guide for instructions.   3. Open an ssh connection to the MDC node currently acting as the secondary node, and log in as the stornext user.    4. To log in to the secondary server enter:         • User: stornext         • Password: enter the customer-supplied password (the default password is password)   5. Enter sudo rootsh.   6. Enter the password for the stornext user account a second time.   7. Enter /sbin/poweroff. Both the operating system and the StorNext software are gracefully shut down, and then the system powers off.   8. Open an ssh connection to the MDC node currently acting as the primary node, and log in as the stornext user.   9. To login to the M440 command line enter:          • User: stornext          • Password: enter the customer-supplied password (the default password is password)   10....
Hits: 3910
0
Continue reading

Creating a Master image OSX

Posted by on in Hints
When creating a master image from a mac computer, you have to be sure to delete the following files. This is will remove all the unique values from the master computer and be recreated when it the imaged computer first boots up.   You can boot the computer into single user mode see article http://support.apple.com/en-us/HT201573.    rm -rf /Volumes/Macintosh HD/System/Library/Caches/* rm -rf /Volumes/Macintosh HD/Library/Caches/* rm -rf /Volumes/Macintosh HD/Library/Preferences/OpenDirectory/Configurations/Active Directory rm -rf /Volumes/Macintosh HD/Library/Preferences/OpenDirectory/Configurations/LDAPv3 rm -rf /Volumes/Macintosh HD/Library/Preferences/OpenDirectory/DynamicData/Active Directory rm -rf /Volumes/Macintosh HD/Library/Preferences/OpenDirectory/DynamicData/LDAPv3 rm -rf /Volumes/Macintosh HD/Library/Managed Preferences/* rm -rf /Volumes/Macintosh HD/private/var/db/volinfo.database rm -rf /Volumes/Macintosh HD/private/var/vm/swapfile rm -rf /Volumes/Macintosh HD/private/var/vm/sleepimage rm -rf /Volumes/Macintosh HD/private/tmp/ rm -rf /Volumes/Macintosh HD/private/var/tmp/ rm -rf /Volumes/Macintosh HD/private/var/run/* rm -rf /Volumes/Macintosh HD/private/var/db/.configureLocalKDC rm -rf /Volumes/Macintosh HD/var/db/krb5kdc rm -rf /Volumes/Macintosh HD/etc/krb5.keytab   rm -rf /Volumes/Macintosh HD/Library/Keychains/System.keychain...
Hits: 1632
0
Continue reading

Unhide Xsan Volume

Posted by on in Hints
If you Xsan volume is mounted but not visible in the finder you can try one of the following solutions.   xattr -d com.apple.FinderInfo /Volumes/VolumeName   chflags nohidden /Volumes/VolumeName   SetFile -a V /Volumes/VolumeName...
Hits: 1517
0
Continue reading

Remove Ignore ownership on a volume

Posted by on in Hints
# vsdbutil -d /Volumes/yourdisk will cause ownership to be ignored on the specified disk.   # vsdbutil -a /Volumes/yourdisk will cause ownership *not* to be ignored on the specified disk.   # vsdbutil -c /Volumes/yourdisk will tell you whether or not ownership is currently being ignored on the   specified disk....
Hits: 1540
0
Continue reading

Change Timestamp of a file

Posted by on in Hints
Using the touch command you can change the modified date and time of a file. Here is how to Change the timestamp to 02/26/2010 7:30am of a file on your  desktop. touch -t 201002260730 ~/Desktop/myfile.txt...
Hits: 2098
0
Continue reading

Remove ACL from a File or Directory

Posted by on in Hints
This will command remove all ACL's including system ACL from any file(s) and folders. chmod -R -N "Directory or file" ...
Hits: 2128
0
Continue reading

Change password terminal

Posted by on in Hints
Change _Password_Terminal
If you know the current password you can just type: passwd You will be prompted to enter the old password and the new password twice. If it's for a different user or don't know the password: sudo passwd "OtherUser" Change _Password_Terminal        ...
Hits: 1963
0
Continue reading

Remove All Printer Script

Posted by on in Hints
I have tested this in 10.5. This will remove all printers that are listed in system preferences. ############Being Copy Here #############   lpstat -p | awk '{print $2}' | while read printers do lpadmin -x $printers done ############End Copy Here ############# ...
Hits: 2056
0
Continue reading

Time Machine directory exclusion

Posted by on in Hints
This very simple but useful tip. I usually don't backup my "/Documents/Microsoft User Data" or "/Documents/Virtual Machines" folder.   From the Terminal sudo defaults write /Library/Preferences/com.apple.TimeMachine \ SkipPaths -array-add “PATH-ONE” “PATH-TWO” From the GUI Open System Preferences > Time Machine > Options.   Time Machine Exclusion...
Hits: 1863
0
Continue reading

Send Clipboard over ssh to another computer

Posted by on in Hints
This command will send the contents of the clipboard from your machine to the clipboard of machine 2.   pbpaste | ssh user@machine2 'pbcopy' ...
Hits: 1941
0
Continue reading

ARD service management from Terminal

Posted by on in Hints
Enable ARD for all users sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -allUsers -privs -all       This will change the access from All users to only specified Users. *Note you have to specify the users from a different command. /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart  -configure -allowAccessFor -specifiedUsers       Add all privileges to the User "User1" /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -access -on -privs -all -users "user1"     Disable ARD /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart  -deactivate   ...
Hits: 2364
0
Continue reading

Disk Utility Terminal

Posted by on in Hints
Create Raid 1 diskutil createRAID mirror MirroredVolume JHFS+ disk1 disk2 diskutil createRAID mirror MirroredVolume JHFS+ /Volumes/Server\ HD /Volumes/Server\ HD\ 2/   RamDisk This will create a disk of Memory (Ram) which will be fast access. Remember you can't use it for data storage.   diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://1165430`  ...
Hits: 2152
0
Continue reading

Finder: Show all files

Posted by on in Hints
Show Hidden files   This command will show all files in the finder. The Finder by default hides lots of files that the normal user doesn't need to see. Usually the Admins will go in the terminal and browses those hidden files. With this command you will display all files including the ones the finder hides from you. Type the following commands in the Terminal app prompt one at a time or you can copy and paste it   defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder   Before Screenshot   After Screenshot You can undo this process by entering the following commands one at a time or you can copy and paste it. defaults write com.apple.finder AppleShowAllFiles FALSE killall Finder...
Hits: 1922
0
Continue reading

Open Directory Authenticated Bind

Posted by on in Hints
This will require authenticated bind. sudo slapconfig -setmacosxodpolicy -binding required This will allow authenticated bind.   sudo slapconfig -setmacosxodpolicy -binding enabled   This will allow authenticated bind.   sudo slapconfig -setmacosxodpolicy -binding disabled...
Hits: 1862
0
Continue reading

Create a Symlink

Posted by on in Hints
A Symlink is basically a shortcut from one path to another. So lets say your iTunes music folder is too big for your boot drive. You can get a huge external drive and move the iTunes library to it and create a Symlink in it's original location to redirect to the second drive. Lets assume your iTunes library is located at /Users/YourUserName/Music/iTunes and your external or secondary drive is at /Volumes/ExternalDrive/iTunes.   1. Move the files from /Users/YourUserName/Music/iTunes to /Volumes/ExternalDrive/iTunes. 2. Once you verified the files were copied to the external or secondary drive you will delete it from /Users/YourUserName/Music/iTunes. 3. ln -s /Volumes/ExternalDrive/iTunes /Users/YourUserName/Music/iTunes 4. This will create Symlink that looks like a folder with a small arrow on the bottom left hand side. This be created at  /Users/YourUserName/Music/iTunes and the actual files will be located at /Users/YourUserName/Music/iTunes.     iTunes Symlink    ...
Hits: 1917
0
Continue reading

Teired Software Update Server

Posted by on in Hints
Problem: You have 10 software update servers that you only allow certains updates to be download by the clients. If you setup all the server individually, every time a new update comes out it will downloaded from Apple's master Software Update Server and you will have to enable that update on all 10 servers. Here is how you can have 1 internal master and other slave servers in a way that if you enable update on the Master and all the slave servers will mirror that. 1. On the Master SUS: ServerAdmin -> Server's Name -> Software Update -> Settings, you will select "Copy All updates from Apple" but uncheck "Automatically enable copied updates" 2. On the Master SUS: ServerAdmin -> Servername -> Software Update -> Updates, here you will select the approved Updates you want to provide to the slave server and ultimately your clients.     3. On the Slave SUS: First we need to backup the configuration file located at /etc/swupd/swupd.plist file. You can do this in the Terminal application by entering the following command: sudo cp /etc/swupd/swupd.plist /etc/swupd/swupd.plist.bak   4. One the Slave SUS: Now we can modify the file using the Terminal application by using the following command:...
Hits: 1894
0
Continue reading

Get your Public IP via Terminal

Posted by on in Hints
Getting your public IP could be very helpful. Using a browser you can go to a site like www.whatismyip.com, but If you need to get it from the terminal it's a little different. Open the Terminal Application and enter the following command; curl -s www.whatismyip.com/automation/n09230945.asp   or   curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//' ...
Hits: 1912
0
Continue reading

Create a hidden admin account

Posted by on in Hints
Create Hidden User
For many reason you may want to create a hidden admin account in your system. This account will be hidden from the System Preferences, Login Window, Fast user switching menu and the home folder will not be in /Users. It will be very difficult for a user to know that his account exists. This is an interactive script so it requires you to enter the desire user name and password.   To create the configuration script, copy the text below beginning with the line "#Begin Copy" to the line "#End Copy" and paste the text into TextEdit. Before you save the file go to the "Format" and select "Make Plain Text".     ### Begin Copy ### #!/bin/sh echo Please Enter the Username you want to create read USERNAME echo Please Type in the password oldmodes=`stty -g` stty -echo read PASSWORD stty $oldmodes sudo dscl . create /Users/$USERNAME sudo dscl . create /Users/$USERNAME PrimaryGroupID 80 sudo dscl . create /Users/$USERNAME NFSHomeDirectory /private/var/$USERNAME sudo dscl . create /Users/$USERNAME UniqueID 499 sudo dscl . create /Users/$USERNAME UserShell /bin/bash sudo dscl . passwd /Users/$USERNAME $PASSWORD sudo dscl . append /Groups/admin GroupMembership $USERNAME sudo defaults write /Library/Preferences/com.apple.loginwindow Hide500Users -bool TRUE sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList...
Hits: 2258
0
Continue reading

Find and delete matching files

Posted by on in Hints
Lets day for some reason you needed to find files that were more than 30 minutes old and delete those files. You can use a very simple command for this that you can later add to an Apple script, shell script or even automate it using Launchd.   This will find and remove any files in the folder path specified in quotes that is older than 30 minutes   find "folder path"  -type f -mmin +30 -exec rm {} \;   You can also modify this and search for things that are older than 7 days   find "folder path" -type f -mtime +7 -exec rm {} \;  ...
Hits: 1791
0
Continue reading

Main Contacts

Tel : (866) 228-6286 

Fax : (718) 897-9665

Give us a call!

New York Office

70-11 Austin Street, St 3L
Forest Hills, NY 11375
 

Vegas Office

1810 E. Sahara Ave. St 121
Las Vegas, NV 89104

Florida Office

13899 Biscayne Blvd St 211
Miami, FL 33181
 

United Kingdom

1 Lockside Marina
Chelmsford, Essex
CM2 6HF United Kingdom