Adding Emojis to your Mac terminal

If you have to ssh to work and have the local system and get confused every now and then. Then you might add some visual indicators in the bash shell so you can easily spot where you are!

1. Open your .bash_profile and add the following line.

PS1="\h  🍀  \W "

To Open emoji’s in Mac, you need to go to ‘Edit’ > ‘Emojis & Symbols’ and add your desired emoji. Be it in twitter, notes or anywhere this is the way to do in a Mac.

2. Save the bash_profile file,

3. Reopen terminal and BOOM!

Note: while Adding PS1=” ” remember that you shouldn’t have a space between = and “.

This artical was inspired by one of Ruby programmers having vidcast. And idea is borrowed from http://itsras.blogspot.com/2013/04/os-x-daily-customize-command-line-by.html

Let me know what other emoji’s you like the most to have them on terminal.

Cheers!

Installing TMUX.

This post outlines the way to install tmux in Mac OSX

Disclaimer: At the time of writing this article I have just gone as far as installing tmux and thats it!

    1. If you want to install tmux you can do that by downloading it at this link: http://tmux.github.io/
    2. You have to read the README doc which tells how to install it.
      tmux depends on libevent 2.x. Download it from:
      
      	http://www.monkey.org/~provos/libevent/

      libevent site seemed hard to parse and I couldn’t get a way to install it after downloading the project.

    3. So in order to install libevent:
      1. cd to the libevent project folder
      2. Run ./configure && make
      3. Run sudo make install

      http://cloudspace.com/blog/2009/01/13/installing-libevent-on-mac-osx/

    4. Now install tmux as told in README
      $ ./configure && make
      $ sudo make install
    5. …. and may be you are done.

Installing TMUX using homebrew:

I did it this way coz I found brew was more easier to do

      1. $ brew update and $ brew doctor
      2. Install libevent first:
        $ brew install libevent You will be prompted to link libevent after installing, do that if so
      3. Then install tmux:
        $ brew install libevent
      4. If you get the permissions error saying /usr/local is not writable do change the persmissions:
        sudo chmod -R g+w /usr/local
        http://stackoverflow.com/a/12748803/981616
      5. Then install tmux
        $ brew install tmux

To learn about tmux and its shortcuts visit this page: https://gist.github.com/MohamedAlaa/2961058

https://danielmiessler.com/study/tmux/

Understanding the PATH variable

I was reading about rbenv and found the best way of describing what PATH means to newbies and thought it should make an entry to my blog ;). The author says as follows:

When you run a command like ruby or rake, your operating system searches through a list of directories to find an executable file with that name. This list of directories lives in an environment variable called PATH, with each directory in the list separated by a colon:

/usr/local/bin:/usr/bin:/bin

Directories in PATH are searched from left to right, so a matching executable in a directory at the beginning of the list takes precedence over another one at the end. In this example, the/usr/local/bin directory will be searched first, then /usr/bin, then /bin.