Make DWM more friendly to Netbeans 8.2 Nightly

Java’s applications could make some additional quests in dwm, like blank-windowed UI.

It could be happens due to this.

To fix blank-windowed UI you’ll need to add the following line in your ~/.xinitrc:export _JAVA_AWT_WM_NONREPARENTING=1

Another issue is related to configuration of Netbeans. In my case, plugins were required for jdk installed in non-standard folder.

So, the solution was to change netbeans_jdkhome variable in /etc/netbeans.conf:netbeans_jdkhome="/usr/lib/jvm/java-1.8.0-openjdk-"

Ref urls:

suckless: dwm, st and missed terminus font

After upgrading on Fedora 26 I’ve got wrong font in my dwm and st. It was painful to look at.

During investigation, I’ve found that there, firstly, font terminus name has been changed from “Terminus” to “xos4 Terminus”. So, that could be solved by changing font name in dwm and st configs, it’s easy.

Secondary, fontconfig-devel package provides incorrect include directory in pkg-config’s file. The bug is reported to redhat:

The patch:--- /usr/lib64/pkgconfig/fontconfig.pc 2017-07-23 17:52:51.844365570 +0300 +++ /usr/lib64/pkgconfig/fontconfig.pc 2017-07-23 18:09:14.221529256 +0300 @@ -1,7 +1,7 @@ prefix=/usr exec_prefix=/usr libdir=/usr/lib64 -includedir=/usr/include +includedir=/usr/include/fontconfig sysconfdir=/etc localstatedir=/var PACKAGE=fontconfig

Rebuild. Done.

Looks like, I missed something on my home machine, but in the latest commit on have no dependency in fontconfig.h


Dig a Python’s regex trench… or not.

Let’s talk about not so clearly viewed but important thing as regex execution sequence.

Let’s imagine, we have a list of strings:

sarr = [ 'kitty.env', 'doggy-bone.env', 'dog-plum.env', '', 'dog-pass-bone1.env', 'dog-shout.env', '', 'doggy-pitstop.env', ];

and we need to match any string ‘^dog.*\.env$’, but not contained ‘-bone[0-9]*’

So, the matches sould be: 3rd, 6th and 8th strings

Referer docs: python’s regex

The first what cames into the head is the following:

>>> [re.match(r'^dog.*(?!-bone[0-9]*)\.env$', s) is not None for s in sarr] [False, True, True, False, True, True, False, True]

“Whuuuut?” it was my first reaction. A few minutes later with colleague’s help, we’ve found the solution, here it is:

>>> [re.match(r'^dog(?!.*-bone[0-9]*).*\.env$', s) is not None for s in sarr] [False, False, True, False, False, True, False, True]

Seems, as you can guessed, python’s regex have sequentially processing of conditional rules

So, in the first case using human words:

1) Does string is starts with 'dog'?
2) Keep in mind any-characters sentence, mark them.
3) Does string contains '-bone[0-9]*'?
    No? OK.
    Yes? I could quit, BTW, it got match to previous rule, then OK.
4) Does string ends with '\.env'

When the second could reads as:

1) Does string starts with 'dog'?
2) Does string contains any sentence '.*-bone[0-9]*'? Yes? This isn't our case, quit.
3) Does string ends with sentence '.*\.env'?

That’s it. I hope, this post helps you or you’ve got a new piece of knowledge.


New blog’s home and cpu managment

The story has a beginning in 2013. Me and my friend got node (aka physical server) in data center for free by marketing company for a year.

Time was going, a year has ended, but DC owners didn’t do anything with it. So, we lived on node until a couple weeks ago they are remembered about and were asked us to renew the contract with a charge or they’ll shut the server down.

Continue reading

Upgrade Fedora… manually.

Fedora’s manual (any many other copy-paste blogs, damn) describes the following steps to upgrade system:

sudo dnf update --refresh sudo fedup download --releasever=24 --allowerasing sudo fedup reboot

Guys, don’t worry about “fedup” it’s just an alias script to “dnf system-upgrade”

I did that steps, reboot finished aaaand.. nothing! F23 on the board yet.
Sure, the post not about happy end and easy way (:

Continue reading

TAR: Speed up compression on multicore systems

This is a little tip to speed up creating tar archive.

By default tar using gzip to compress and if you look at htop output, gzip use only one cpu.

Tar have an argument –use-compress-program, which allow us to set another gzip-ing program.

The most known mutlithreading gzip alternatives is pigz.

So, the tar usage should looks like:

tar --use-compress-program=pigz -cf ...

Under the cut you found the compression time difference between gzip and pigz Continue reading