vimrcfu – shared knowledge of vimrc

Dear all contributors to vimrcfu,

thank you very much for all my sleepless nights this week.  I’ve almost forgot how my bed looks like.  On the other hand, I’ve learned a tonne and have significantly rearranged my vimrc and related files, expanding it with new bits and pieces.

The sleep I can get back.  The awesome features of Vim at my fingertips now – couldn’t have happened without you.

You rock!

Best regards,

yours truly.

VimGolf – fun way to learn Vim

VimGolfVimGolf – a quick and fun way to learn Vim text editor.  There is a whole lot of different challenges for all levels – from novice to expert – that will test your knowledge of Vim trickery.

You can also review the solutions provided by other people, from shortest to the most readable.

ASCII vs. ANSI

Browserling does it again:

ascii-ansi

For those of you not old enough, here are the ASCII and ANSI Wikipedia pages.  Back in a day we used these for cool art, fancy user interfaces, email signatures, games and more.  Have a look at some cool examples of ASCII art.  Now imagine those “images” colored with the breathtaking variety of 8 colors and you’ve got yourself a true 90’s rainbow explosion.

ansi-color-table

You’d probably be surprised to learn that a lot of these have survived to modern day, and are still used in command line user interfaces.

P.S.: And if you think that this stuff is ancient, have a look at typewriter art example.

Install Ansible 2.0+ on Amazon AMI

Today, while upgrading some of my Ansible roles I’ve hit the problem.  Some of the newer roles require Ansible 2.0.  My Amazon AMI machine that runs the playbooks was still on version 1.9.  EPEL repository doesn’t seem to have the newer Ansible version yet.  Gladly, Google brough in this StackOverflow thread, which suggested installing Ansible with pip, not with yum.  This helped a lot:

rpm -e ansible
pip install ansible

It actually brought in Ansible v2.2 (see also Ansible v2.1), which is even better.

Easier AWS CLI with Docker

Here is a handy blog post that shows how to simplify the installation and running of the Amazon AWS command line commands, using Docker.  With the Dockerfile like this:

FROM python:2.7
ENV AWS_DEFAULT_REGION='[your region]'
ENV AWS_ACCESS_KEY_ID='[your access key id]'
ENV AWS_SECRET_ACCESS_KEY='[your secret]'
RUN pip install awscli
CMD /bin/bash

One can build the image and run the container as follows:

$ docker build -t gnschenker/awscli
$ docker push gnschenker/awscli:latest
$ docker run -it --rm -e AWS_DEFAULT_REGION='[your region]' -e AWS_ACCESS_KEY_ID='[your access ID]' -e AWS_SECRET_ACCESS_KEY='[your access key]' gnschenker/awscli:latest

Obviously, DO NOT hardcode your Amazon AWS credentials into an image, which will be publicly available through DockerHub.

Once the AWS CLI works for you, you can add the command to your bash aliases, to make things even easier.