Skip to main content

git log, Make It Beatiful

Another developer I work with just showed me a much nicer git log command experience. It gives pretty colours, the commit id, the author and much more.

The idea comes from Filipe Kiss' blog however the solution I use was submitted in the comments of the blog post by LordMonkey

The following command creates an alias lg for the git log command.

git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"

git lg will then result in something similar to


I have blurred text to protect privacy

Comments

Popular posts from this blog

Change the Colour of Emacs Shell Prompt and Font Highlighting

The project I'm currently working on is Linux based, and I just can’t get my head around vi no matter how hard I try. Fortunately I have root privileges, so Emacs to the rescue :) We are using CentOS so installing is as easy as sudo yum install emacs   One of the many reasons I really like Emacs is you can run a shell inside Emacs. Press Alt – x Type shell Press enter NB the Alt key in Emacs is often called the Meta key and the key combination above would be shortened to M – x This allows me to split the Emacs window and have the shell in the bottom half and what I working on in the top half, see the image below. To switch between the shell and what I’m working on I press M – O (that’s Alt and the letter O and not the number zero, Alt zero will unsplit the screen) If like me you’re running Emacs inside Putty the first thing you might notice is the shell prompt is in dark blue on a black background. Not only is this very difficult to read but it c

How to Pretty Print JSON and XML from the Command Line

As developers we often need to take minified JSON and XML and pretty print it so it is human readable. A multitude of websites provide a free service where you can enter minified JSON or XML and it will format it the data so it is human readable. The problem is this can lead to leaking data causing security incidents. The solution is to write a couple of bash scripts to pretty print. A big thanks to Campovski 's answer on stackoverflow for the JSON and Ben Noland 's answer on stackoverflow and Anton I. Sipos ' comment for the XML I took these answers a little further and created a bash script that accepts arguments so you can pretty print A file The result returned form an API A string Data piped in Both scripts have the same usage Format a file with the -f flag JSON ./pretty_json.sh -f <name_of_file> XML ./pretty_xml.sh -f <name_of_file> Format the return value of an API with the -u flag JSON ./pretty_json.sh -u www.api.com XML ./pretty_xml.sh -u

Turning Off SSLv3 in Apache and IIS8, AKA Putting Down the Poodle That Bites

Poodle is a security vulnerability that has been found in SSLv3. Since SSL is over ten years old, and the only browsers that support it as the strongest version of encryption are IE6 and older, in my humble opinion it is safe to turn it off.  Let's start with the easy one, Linux, in particular CentOS. NB you will most likely need to be root or be part of the sudo group to make the following changes 1)     Open the ssl.config file with your favourite text editor. In Red Hat based distributions like CentOS you should find it in /etc/httpd/mods-available/ssl.conf 2)     Find the line starting with  SSLProtocol 3)     Change it to  SSLProtocol all -SSLv2 -SSLv3 This will allow all ciphers expect SSLv2 and SSLv3 4)     Save ssl.conf and exit your text editor 5)     Restart Apache by running the command service httpd restart 6)     Use a tool like sslscan to check all SSLv2 and SSLv3 ciphers are rejected or fail. An example of this would be ssl