Category Archives: Mac

Vim : how do I search and replace text

Do the following to find and replace text string in a whole file using the Vi text editor : 1. Enter in command mode by typing ” : ” 2. Your command should look like this : :%s/search_for_text/replace_with_this_text/g NOTE : To search & replace a string containing slashes ” / “, use a coma ”… Read More »

Mac : Add a static route in OSX

To add a static route in Mac OSX, do the following as root in the terminal : route -n add “network/prefix” “gateway” Example : route -n add 10.0.0.0/8 10.16.1.1 To print the routine table, use the following command : netstat -nr

Category: Mac

Mac : Flush local dns cache on OSX

MacOSX run a local named caching server.  In some reason you may need to refresh it manually to get a resent updated DNS record. Under Mac OSX 10.8 and above, use the following command using the terminal : sudo killall -HUP mDNSResponder Under Mac OSX 10.5 and 10.6, use : sudo dscacheutil -flushcache Under Mac… Read More »

Category: Mac

Mac : How to disable named on OSX Server

To permanently disable local dns server on a MacOSX Server simply run the following command as root : sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/org.isc.named.plist You will be prompted to enter the administrative password next and you’re done!

Category: Mac

Mac : Change the hostname

Changing the hostname can be done through the GUI or console. Go to System Preferences > Sharing. On top of the window, click on Edit to change the computer name. The command line for the console is the following : sudo scutil –set HostName “your_hostname”

Category: Mac

Mac : Make ISO image from command line

This procedure is about creating a ISO image file from CD/DVD using the command line on a Mac OS X. First, you can retrieve information about the media with the following command : drutil status Then, the disk must me unmounted to proceed : diskutil unmountDisk disk1   Ok, let’s make the ISO file now :… Read More »