You are here

unix

Mac OS edit /etc/hosts and DNS Cache Flush

In Mac Os when you edit the /etc/hosts file either by adding a new entry or changing an existing one, the changes are not reflected immediately.
So you think:
- This is simple! All I have to do is close the Terminal and open a new one!
And then you realize it did NOT work.
Since you are a smart person, you might think:
- Well, all I have to do is log out and back in! Still simple!
Only to realize again that it did NOT work.

Basic Vi Editing - Most used commands

Every developer has heard of 'vi' at least once in their life. That empty screen with a flashing cursos can be a little intimidating at first. After a few attempts of typing your text and nothing is echoed back to the screen, than it becomes really intimidating. :)
To help those out there who want to be able at least to quit vi editing without closing their Terminal window, here are a few tips and basic commands.
The first thing you should know about vi is that it has two modes of operation:

How to create Bash Aliases in Mac Os

Being a flavor of Unix (in some level) it is possible to set some aliases in your Mac Os shell.
All you have to do is open your Terminal and type the commands below, or something else that suits more your taste.

  • vi ~/.bash_profile
  • Once the file is open in vi, just add the following lines (well you do know how to do basic vi editing, right?)

HOW-TO Move and Import Subversion Repositories - dump them

A few weeks ago I wrote an article on how to install Subversion and Apache in a Windows environment and another article about how to install those in a Linux environment.

Which binary file am I running in Cygwin?

If you want to find out which of the binary versions of some file you are running under Cygwin you can try two commands: "which" and "type".
 
type -a ruby
 
Should return something similar to:
 
16:55:17 ~$ type -a rubyruby is /usr/bin/rubyruby is /bin/rubyruby is /usr/bin/rubySo would this:
 
which ruby
Cheers!

Cygwin Personal Setup

Some time ago I wrote a post on my blog on how to setup the looks of your Cygwin bash shell using rxvt. Well, I normally add a few more settings to my environment just to make it more useful.

For instance, I add the following lines to my ~/.bash_profile with some aliases to make it easier with directory surfing.

alias ls='ls --color=auto' alias ll='ls -lsa' alias l='ls -la'

It is also useful to set some preferences for vi, and this is done in the ~/.vimrc file:

Subscribe to RSS - unix