In GIT you may finish with a bunch of escape characters (ESC) when invocating colors for “git log” and “git diff”.
ESC[31m-{ESC[m
ESC[31m- Oid res = InvalidOid;ESC[m
ESC[31m- Relation rel;ESC[m
ESC[31m- StringInfo buf;ESC[m
ESC[31m- char *storageName = NULL;ESC[m
ESC[31m- int prefix = 0;ESC[m
ESC[31m-ESC[m

This is due to the default pager which is “less”, because it cannot interpret correctly the escape characters.
There are a couple of ways to avoid that.

The first one is to change the pager to “more”.
git config --global core.pager more

The second one is to append an additional command with “less -r”.
git diff --color | less -r
git log -p --color | less -r

And you get a nice colored output.

Here is another solution which is more portable to my mind, and it is the one I use.
git config --global core.pager "less -r"
This directly appends the modified less command when git pager is invocated to print correctly escape characters.

In one word, Arch Linux is AWESOME. It is the first distribution of Linux that I use giving me the feeling that I control everything in my environment. Among its strengths, its package manager pacman makes everything very flexible and once you migrate to it, you don’t need to worry about support time or anything like for Ubuntu distributions or most of the major distributions.

However setting up an Arch environment is honestly a pain for noobs.
So, based on my *painful* experience, I created some manuals that can be used to install an ArchLinux environment using XFCE as Desktop.
So here is the list of manuals.

Those manuals are not perfect, but give good guidelines of my migration experience. Enjoy!

With ImageMagick package (image manipulation library) installed on a Linux machine, it is possible to split a huge image file into smaller tiles with such kind of command:
convert -crop $WIDTHx$HEIGHT@ huge_file.png tile_%d.png

With the following parameters.

  • $WIDTH, the width of each tile splitted
  • $HEIGHT, the height of each tile splitted

Here is an example to split a file into tiles of size 16×32 pixels:
convert -crop 16x32@ huge_file.png tile_%d.png

When creating files in Windows, those files will have the DOS format.
This creates annoying ^M characters at the end of lines, which can be seen in patches or diff files.

In order to localize them, use this command:
find . -not -type d -exec file "{}" ";" | grep CRLF
It will give an output like this for dos files:
./example.txt: ASCII text, with CRLF line terminators

Then open them in emacs, and launch that command:
M-x set-buffer-file-coding-system RET undecided-unix
M-x means escape and X.
RET is return.
Then save your file and you are done.

Modifying the format name of dump file in a Linux system can be made with sysctl like this.
sysctl -w kernel.core_pattern=core.%e.%p
However, making this modification command-based will not make it effective at next reboot.

In order to make the modification permanent, you need to edit the file /etc/sysctl.conf. Here the core file has the executable name %e and the process ID %p.
kernel.core_pattern = core.%e.%p

Here is a list of the possible keywords usable:

  • %p, PID of dumped process
  • %u, (numeric) real UID of dumped process
  • %g, (numeric) real GID of dumped process
  • %s, number of signal causing dump
  • %t time of dump, expressed as seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC)
  • %h, hostname (same as nodename returned by uname(2))
  • %e, executable filename (without path prefix)
  • %c, core file size soft resource limit of crashing process (since Linux 2.6.24)
©2010-2013 Michael Paquier All content is ©Copyright of Otacoo.com 2010-2013. Privacy Policy - Terms of Use