Later Ctrl + ↑

Fix: the text hides under the toolbar in Summernote

If you put several Summernote editors in Bootstrap tabs, then after navigating between tabs, the text in the editor hides under the toolbar. At the same time it is enough to scroll the page down or up and then everything falls into place.

We as users can patch it:

$('.yourSelector[data-toggle="tab"]').on('', function (e) {
1 y  

Fix: Option “disableDragAndDrop: true” doesn’t works in Summernote

In my case, this option doesn’t works:

    disableDragAndDrop: true // Не работает...

I think it is a summernote bug. Maybe it will be fixed in new versions or it has already fixed, but I don’t want to update editor now. Therefore I made a dirty hack in my code:

$('body').on('drop', '.note-editable', function() {
    return false;
1 y  

How to remove records from active connections and ip_conntrack by IP

Someone can opens hundreds tabs with autoupdate pages in browser and make lot of persistent open connections to the server. If you want to drop his connections, you have to find him at first:

sudo cat /proc/net/ip_conntrack | grep 'ESTABLISHED' | wc -l
sudo cat /proc/net/ip_conntrack | grep 'ESTABLISHED'
netstat -tulpan | grep 'ESTABLISHED' | wc -l
netstat -tulpan | grep 'ESTABLISHED'

If you found a lot of connections from one IP, check it: (Replace to necessary IP)

sudo cat /proc/net/ip_conntrack | grep 'ESTABLISHED' | grep '' | wc -l
netstat -tulpan | grep '' | wc -l

Look to the web server logs whether the activity is suspicious:

cat /var/log/nginx/access.log | grep ''

Then drop user connections:

sudo cutter
sudo conntrack -D conntrack --orig-src
sudo cat /proc/net/ip_conntrack | grep '' | wc -l
sudo cat /proc/net/ip_conntrack | grep 'ESTABLISHED' | wc -l
1 y  
1 y  

How to setup composer globally

php -r "copy('', 'composer-setup.php');"
php composer-setup.php --install-dir=/usr/bin --filename=composer
php -r "unlink('composer-setup.php');"

How to fix Chromium forgets cookies at reboot

Warn: this topic have hatred.

I had updated Chromium on the other day. You know... some sites didn’t want to show some very useful content like videos of raccoons when you’re using old browser. Even if your browser had updated two months ago. So I had done it. I had updated Chromium and do you know what I had gotten? Nothing bad. It had been continuing its work. But for a while. Did I already said that I like hate flarking updates? After week or two weeks I closed browser and open it again. And it required interference. No, it didn’t frozed up. And it did’t want to hug. It forgot all cookies!

As the matter of fact it is no neccessary to descend deeper than may seem for looking for decision. The solution was on surface.

I dunno why but after flarking updates Chromium decided to change my privacy settings (and may be some options more). In a specific case how browser relates to keeping cookies at reboot.

So only what you need to do it is disable option “Keep local data only until you quit your browser” in Cookies settings which you can find at


How to find IPs with highest count of requests in access.log

First command will show you IPs sorted by number and them count of requests:

cat access.log | awk '{print $1}' | sort | uniq -c

You will be able to find IP masks with highest count of requests:


Next command will show you IPs sorted by count of requests:

less access.log | cut -d' ' -f1 | sort | uniq -c | sort -bg

For example:


How to fix wrong javascript after using Tidy

Almost every time when I updating something I become mean! In newest versions of Tidy (newest – 2015, lol) I found disappoint problem that javascript codes stopped working. Because Tidy converted javascript codes in page e. g.:

    script.onload = () => resolve(script);


            script.onload = () => resolve(script);

Instead of (in early versions):

    // <![CDATA[
            script.onload = () => resolve(script);
    // ]]>

If you have the same problem then don’t worry. Most likely Tidy tidying codes to xml or xhtml format default now. I found due solution this problem -- use option “output-html”:

$code = $tidy->repairString($code, [
    'output-html' => 1,
], 'utf8');
Earlier Ctrl + ↓