sakana

very short memo

add favicon

You can configure favicon for your blog.

Prepare your favorite icon and place it under _static directory.

$ file _static/skyhigh71.ico
_static/skyhigh71.ico: MS Windows icon resource - 1 icon

And point newly deployed icon file in conf.py.

# Change your favicon (new favicon goes in _static directory)
html_favicon = 'skyhigh71.ico'

customize tinkerer page continued

language

LANG environment variable of my shell is configured to ja_JP.UTF-8.

$ echo $LANG
ja_JP.UTF-8

Therefore I first thought that I have to set LANG=C upon building html so as to obtain English output.

$ LANG=C tinker -b

But it’s confirmed that language parameter in conf.py is valid for “en” as well. value “en” does not work. You will encounter error stating that “loading translations [en]... locale not available” sorry...

language = "en"

And if you would like to configure, say, German as default language of your blog, then configure it as “de”.

language = "de"

But localization is not perfect, for example, date seems to be yielded based upon LANG. So you would better to set LANG upon building html.

$ LANG=de_DE.utf8 tinker -b

theme

You can select theme among following options and set theme in theme in conf.py.

  • flat (default)
  • modern5
  • minimal5
  • responsive
  • dark

post per page

Sometimes you find that default post per page (10) seems to be too long. You can configure post per page by posts_per_page parameter.

# Number of blog posts per page
posts_per_page = 3

how to yield core file

By default, gdb is given on ubuntu desktop, so you can enjoy debugging applications (if you like :-)).

$ which gdb
/usr/bin/gdb
$ gdb -v
GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu

But it seems that core file of application is not yielded (quite natural). Here is a memo to describe procedure how to configure system to yield core file.

ulimit

Core file size is set to size zero.

$ ulimit -a
core file size          (blocks, -c) 0

You can change size to some value by ulimit command. If you would like to set permanently, then configure its value in /etc/security/limits.conf.

*               soft    core            unlimited

In this case, soft limit for default entry is set to unlimited. For details, please refer to man page of limits.conf.

core file pattern

By default, application failures will be reported back to developers via apport.

application failure is passed to apport application via pipe as described in /proc/sys/kernel/core_pattern file.

$ cat /proc/sys/kernel/core_pattern
\|/usr/share/apport/apport %p %s %c

Therefore you change output location of core file by manipulating core_pattern file. Following is the sample to configure core files will be yielded under /var/cores directory with file name of core.<executable_name>.<PID>.<timestamp>.

$ sudo mkdir /var/cores
$ sudo chmod a+w /var/cores
$ sudo bash -c "echo /var/cores/core.%e.%p.%t > /proc/sys/kernel/core_pattern"

permanent change

Above change will be lost upon system reboot. So as to make change reflected over reboot, add following line in /etc/sysctl.conf.

kernel.core_pattern=/var/cores/core.%e.%p.%t

Please be noted that apport will overwrite this kernel parameter as follows (/etc/init/apport.conf).

echo "\|/usr/share/apport/apport %p %s %c" > /proc/sys/kernel/core_pattern

This phenomenon seems to have already been discussed in bug #1080978.

As temporary measure to avoid this overwrite, let us disable apport for now (/etc/default/apport).

#enabled=1
enabled=0

summary

Now you will see core files. Enjoy your debugging life.

By the way, repetition of application failure will consume disk space. Please be careful and monitor free disk space.