Centro de InnovaCXión del BCP

29 December 2016 on software and agile.

Hace unos días atrás particé en unos de los #devHangOut de DevAcademy para comentar sobre el Centro de InnovaCXión del BCP. Acá comparto los videos:


¿Listo para adoptar metodologías ágiles?

14 July 2016 on software and agile.

Esta de moda escuchar de metodologías ágiles y muchas empresas quieren comenzar a usarlas pero… ¿Qué debes saber antes de sumergirte en ese mundo?


Mac OS X Terminal Customization: Colors

23 December 2015 on software and opensource.

The out-of-the-box configuration of the Terminal application in Mac OS X is quite simple/plain. If you don’t use it frequently, it will be ok to leave it in that way. However, if you continuously open Terminal, it will be great to customize it so you can be more productive.

By default, this is how Terminal application looks like (Basic Profile):

01

As you can see, it is based just in black text and white background but you can give more life to Terminal using colors and this article will explain how to customize it according to your own tastes.

Mac OS X Terminal

First, let’s change the default profile to other one . To do so, open a new Terminal and go to Terminal -> Preferences -> Profiles. In my case, I like the Pro Profile (cool name!) because it looks like an old terminal with white text and black background.

01

Besides changing the profile, you should consider enabling the following options in Text Tab:

  • Antialiases text: To apply text smoothing. It is specially useful with some kind of monitors but you can leave it enabled any way.
  • Use bold fonts: To use bold for emphasis. Must be enabled.
  • Allow blinking text: To allow text to flash on and off. Highly recommended.
  • Display ANSI colors: To display text using the colors embedded in some terminal emulator standards. Must be enabled.
  • Use bright colors for bold text: To add emphasis to bold text with color. Must be enabled.

Configuring BASH

Now it is time to configure the BASH prompt; that means, change the environment variable $PS1. Let’s check its default value:

optimus:~ modlost$ echo $PS1
\h:\W \u\$

The prompt shows the hostname (\h), colon (:), current directory base name (\W), username (\u) and # or $ symbol ($). You can find more information about all the backslash-escape especial characters available for this variable in the unix man page for BASH section PROMPTING. In this case, we are going to use these options:

  • \u: The username of the current user.
  • \h: The hostname up to the first ‘.’.
  • \w: The current working directory, with $HOME abbreviated with a tilde.
  • $: If the effective UID is 0, a #, otherwise a $

In my experience a simple (short) prompt works best and Debian distribution defines one by default that I really like. Take a look at it executing the following command:

optimus:~ modlost$ PS1='\u@\h:\w\$ '
modlost@optimus:~$  

Looks great but it will be better with colors. To help you decide which color you would like, you can use this shell script to print the 16 ANSI color codes. Execute it in a Terminal using your prefered profile so you can decide which colors are best for you.

01

Now you can choose where you want to change colors coping those codes in $PS1. Debian distribution define a nice colors, let’s use the same:

modlost@optimus:~$ PS1=‘\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[m\]\$ ‘

01

To make these changes permanent you should define $PS1 in .bash_profile because Terminal starts login shells. At the end of the next section you will find a complete ~/.bash_profile.

Configuring ls and grep commands

If you use the Terminal a lot, it is probably that ls is one of your most used commands so adding color will be awesome. To do that, you will have to define a new enviroment variable LSCOLORS containing a string that has the following structure:

  1. directory
  2. symbolic link
  3. socket
  4. pipe
  5. executable
  6. block special
  7. character special
  8. executable with setuid bit set
  9. executable with setgid bit set
  10. directory writable to others, with sticky bit
  11. directory writable to others, without sticky bit

Each one of those items contains two characters, one for the foreground and the other for the background. The color codes you can use are:

  • a black
  • b red
  • c green
  • d brown
  • e blue
  • f magenta
  • g cyan
  • h light grey
  • A bold black, usually shows up as dark grey
  • B bold red
  • C bold green
  • D bold brown, usually shows up as yellow
  • E bold blue
  • F bold magenta
  • G bold cyan
  • H bold light grey; looks like bright white
  • x default foreground or background

For Pro Profile that uses dark background, this could be one good color combination:

modlost@optimus:~$ LSCOLORS=ExFxBxDxCxegedabagacad

But it doesn’t work unless you add the -G option in every ls execution, so the best way to do that is defining aliases:

modlost@optimus:~$ alias ls='ls -G'
modlost@optimus:~$ alias ll='ls -l'
modlost@optimus:~$ alias la='ls -A'
modlost@optimus:~$ alias l='ls -CF'

Execute them to test the configuration:

01

Another quite common command is grep and it also supports colors, you just need to define the following alises:

modlost@optimus:~$ alias grep='grep --colour=auto'
modlost@optimus:~$ alias fgrep='fgrep --colour=auto'
modlost@optimus:~$ alias egrep='egrep --colour=auto'

Execute a little example and you will see how useful is enabling colors in grep:

01

So the final ~/.bash_profile is the following:

# PROMPT CONFIG
export PS1="\[\e]0;\a\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[m\]\$ "

# COLOR COMMANDS
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -G'
alias grep='grep --colour=auto'
alias fgrep='fgrep --colour=auto'
alias egrep='egrep --colour=auto'

# ALIASES
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'

Configuring Vim

Finally, if you use Vi Editor a lot, you should create a ~/.vimrc file with the following content:

syntax on
set background=dark

And the result will be the following:

01

Next Steps

Now your Mac OS X Terminal Application has a lot of colors and that will help you every day and make you more productive.

Happy Hacking!!!!


Photostream: Wong Parade

29 July 2013 on photography.

The last week, I attended for the very first time the Wong parade (Corso de Wong), a quite popular parade here in Lima - Perú. That’s why, I grabbed my camera and took a few shots…

0 1 2 3 4 5 6 7 8 9 10 11 12 13


Modlost.net Facebook & Google+ pages

05 January 2013 on software and opensource.

A few months ago, I was discussing about social media in business with some friends, when someone asked me: “Why you don’t have a Facebook or Google+ page for your blog?”. My honest answer was: “Because of my laziness”. I know that creating a page is too simple but the real challenge is to maintain it with content, so I was thinking about it for a few weeks before I created them, just as proof of concept.

social.png

And at the end of the last year, the proof of concept ended with a plan: I can maintain it with content that I find in the web and don’t require a blog post or article, I’m an avid reader so I always have something to share. So I invited you to join my Facebook & Google+ pages; you will find Software Development, Music and Photography content.

Happy hacking!!!

Module Lost Google+ Page

Module Lost Facebook page

Module Lost | Promote Your Page Too
n


Inspirational videos

02 January 2013 on software and architecture.

A new year has come and, for sure, you have a lot dreams or ideas around your head. Maybe you have them for years without doing anything to make them real, but the 2013 could be different. Watch these videos and let your heart beat and begin this year motivated to do something.

Happy hacking!!!!

Steve Jobs - Stanford

Neil Gaiman - University of Arts

Randy Pausch - Achieving your childhood dreams


Photostream: Horses

06 October 2012 on photography.

0

1


404, the story of a page not found

01 October 2012 on software and architecture.

In this short talk, Renny Gleeson presents a different way to use the classic HTML 404 Error Page. He proposed to have friendlier messages in the web and also use them to capture users/clients interest.�It is something to consider in the next web projects, isn’t it?.

Finally, he left this quote that could be useful when you are defining an HTML 404 Error Page.

“A simple mistake can tell me what you aren’t. Or remind me why I love you”


The power of happiness

02 September 2012 on personal.

0

Over the last years, I’ve been interested in happiness because there is a lot of information that you can apply in your life, it is better to try something that works for others than starting from scratch. Furthermore, trying new things makes your life exciting because you learn new stuff about you. That’s why, I’m always looking for new information reading books, articles and papers; trying some ideas in my life and, sometimes, writing about what I found in my website.

This time, I’m going to share with you about the book The Power of Happiness: A Comprehensive Guide to Daily Joy and Well-Being by Timothy McKinney. In my opinion, it’s a great book with a lot of useful information that you can apply in your life. For sure, after reading it, you will end with a lot of next actions and things to try, like me.

The most important thing I learned from Timothy’s book is that life isn’t supposed to be easy (Chapter 11). It sounds simple but I’ve never thought of it that way. I used to assumed that I was unlucky when some events happened in my life but that’s not true. Life is not easy! So you can better enjoy the challenge of living assuming that it won’t be easy and also practicing non-attachment.

I also found a relationship with Pragmatic Thinking & Learning by Andy Hunt. Both agree that you can rewire your brain (Refactoring your wetware in Andy’s book). So if you want to be happier you should rewire your brain by changing your attitude and having happy thoughts. In such a way, your brain will rewire itself for happiness.

In conclusion, I highly recommend this book, it’s easy to read and you won’t stop because all the information is very interesting and useful for you life.

Haz click aquí para leer la versión en español


El poder de la felicidad

02 September 2012 on personal.

0

Durante los últimos años, he estado muy interesado en la felicidad porque hay mucha información que puedes aplicar en tu vida, es mejor probar algo que funcion en otros que comenzar de cero. Además, probar cosas nuevas es emocionante porque aprendes sobre ti mismo. Por eso, siempre estoy buscando nueva información leyendo libros, artículos y papers; probando algunas ideas en mi vida y, algunas veces, escribiendo sobre lo que encuentro en mi website.

Esta vez, voy a compartirles sobre el libro The Power of Happiness: A Comprehensive Guide to Daily Joy and Well-Being by Timothy McKinney. En mi opinión, es un excelente libro, con mucha información útil y aplicable en la vida. De seguro, después de leerlo, terminarás con muchos siguientes pasos y cosas para probar, como me pasó a mi.

Lo más importante que aprendí con el libro de Timothy es que la vida no se supone que sea fácil (Capítulo 11). Suena simple pero nunca pensé así. Por lo normal, asumía que no tuve suerte cuando sucedieron algunos eventos en mi vida, pero esa no es la verdad. La vida no es fácil! Por eso, puedes disfrutar mejor el reto de vivir asumiendo que esta no será fácil.

También encontré una relación con el libro Pragmatic Thinking & Learning by Andy Hunt. Ambos comparten que puedes renovar tu cerebro (“Refactorizar tu wetware” in el libro de Andy). Así que si quieres ser más feliz debes re-enlazar tu cerebro cambiando tu actitud y teniendo pensamientos felices. De esa forma, tu cerebro mismo se re-enlazará para ser más feliz.

En conclusión, recomiendo este libro; es fácil de leer y no te detendrás porque toda la información es muy interesante y util para tu vida.

Click here to see the english version


Page: 1 of 12 Next