Category Archives: Mac

Mac : MacPorts selfupdate failed on OSX Mavericks

Upgraded to Mac OSX Mavericks lately? Well, you’ll need to update MacPorts once you’re done to keep it working. To update MacPorts, just do the following command in Terminal :

The terminal will keep working running a bunch of scripts by itself, then you end up with the following output error :

This… Read More »

Mac OSX : Get full system information through terminal

Gathering information through the GUI option “About this Mac” can be annoying and not reveal all the information you wanted. Fortunately, there is an existing command line that can provide what you are looking for. Terminal can be launched through : Go > Utilities > Terminal Then several commands exist to either gather full system… Read More »

Category: Mac

Linux : Search and replace across multiple files

To search and replace across multiple text file on a Linux/Unix system, use the following command :

So, as example, let’s assume you want to replace an IP address in multiple Bind zone file (using the extension .hosts) and replace IP address 10.10.1.1 for 192.168.1.1 :

Mac : How to convert Windows text file to unix

Windows text editors add a tailing character ( ^M ) for line break. To get a real Unix flat file without theses characters, simply run the following command in terminal :

Category: Mac

Mac : How to Page up and Page down in terminal?

Using the full size desktop Apple keyboard, simply hold down SHIFT key + Page up or Page down. With a MacBook Pro, there is no such keys (Page up/Page down)… Just hold down function key ( fn ) + SHIFT + ARROW UP and/or DOWN.

Category: 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 :

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 :

Example :

To print the routine table, use the following command :

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 :

Under Mac OSX 10.5 and 10.6, use :

Under Mac OSX 10.4 and below, use… Read More »

Category: Mac