False Gems

Some thoughts without any particular direction

I have no issues with a systemd and have no right or arguments or authority to criticize such a huge tool and all involved human efforts. It's a tool and it does its work.

For my cases, it's an over-complicated tool though. I'd prefer to use a simple as is init.d when I need a simple thing working on a simple server.

To go even further I'm considering moving my VPS to a FreeBSD. There is no tricky stuff there and it will fit my needs nicely and let me keep a simple environment at the same time.

Another platform and another attempt to begin to write something. I will try to migrate here some older posts (not all though) in time. Or, maybe it will became not so technical place and will contain some thoughts, but I'm afraid which I have not much. Will it be a topics with a vote idea or just a public journal? Will I convert posts from to the gemini mirror?

Did not write a line of code for a week. And it didn't happen since school, I think. Nothing. No urgent need to go back to the keyboard, so far.

Centos 6 isn't able to get its full updates since May 10th, 2017 and there are no even Maintainance updates since November 30th, 2020. For most of us that version of Centos, released July 20th, 2011 is objectively outdated but still, a huge amount of servers are using it and there are no plans or opportunities to migrate it further.

Read more...

TLDR :w !sudo tee %

Read more...

There is a very convenient way to store files inside CouchDB and be able to get them directly from it.

Read more...

I make a decision to learn the Czech language and to procrastinate I've made up a problem for myself:

I need a deck for the Anki with the most frequently accrued words in that language.

Read more...

There is a way to get information about any process (with according permissions) using filesystem operations only. You need no additional tools besides what you already have on your system. In most cases cat will be enough.

Read more...

So, this will be my attempt to start and proceed with #100DaysToOffload. I'm not sure that I will have enough ideas or material to make really useful content and it could happen that there will appear posts like that: just random thoughts with not much sense.

My initial plan is to publish one post in 3 days and I think it is enough to come up with some idea and write not completely garbage text. Even this text takes more time than I expected but the process should improve soon.

Also, I believe, that it would be a good enough way to practice English writing skills. There will be not so many readers of that to be offended by its grammar or style. I'm still using grammarly just to be sure that there is no obvious misspelling and stuff. If you have any comments though, I will be glad to hear them.

My previous posts here are pretty crappy and contain only some code snippets. I've not decided yet, will be they rewritten as a new post, which could be considered as cheating, or just edited. Also, there is a question about how to store snippets. Right now it is built-in as a gist but maybe it will be better to move into the post as code block.

Wish me persistence and stubbornness.

def currency(value, group_sep=' ', decimal_sep='.'):
    """Format currency by digits.

    >>> currency(100)
    '100.00'
    >>> currency(3.1415)
    '3.14'
    >>> currency(31415)
    '31 415.00'
    >>> currency(3141500.1)
    '3 141 500.10'
    >>> currency(31415000.1)
    '31 415 000.10'
    """
    head,tail = ('%.2f'%value).split('.')
    l = len(head)
    return group_sep.join([head[r-3:l+r] for r in xrange(0,-l,-3)][::-1]) + decimal_sep + tail

Gist