def set_locale(ctx, locale='ru_RU'):
    """Generates and sets given UTF-8 locale.

    Default: ru_Ru

    """
    ctx.sudo('locale-gen "%s.UTF-8"' % locale)
    ctx.sudo('dpkg-reconfigure locales')
    ctx.sudo('update-locale LC_ALL=%(locale)s.UTF-8 LANG=%(locale)s.UTF-8' %
        {'locale': locale})
