Regex (PCRE) matching row with excluded words

Published on Author gryzli

Recently I had a task to match a given row, only if it contains words, different than a predefined non-matching word list.    Here is the example: Let say we have the excluded words: “bad_word1|bad_word2” We must match a row only if there words, different than the bad words from above   That should match:… Continue reading Regex (PCRE) matching row with excluded words

Configuring KeepAlive with Apache RewriteRule [P] Proxying

Published on Author gryzli

Apache can be used for proxying requests with mod_proxy to a certain backend/upstream server. Here is how a simple proxy configuration looks:

The Problem The problem with this configuration is that Apache will create new TCP session to backend (192.168.1.1:8080) for every new request it receives. This might look as an innocent detail at… Continue reading Configuring KeepAlive with Apache RewriteRule [P] Proxying

Sed – Deleting Multiline Patterns

Published on Author gryzli

Here is an easy way to delete multiline patterns with sed.   Let say we have the following pattern:  

  Now consider we want to delete the BEGIN/END block,  containing “ID:45”:

  And here is some explanation of the command run above:

 

Nginx – Configuring reverse proxy + caching

Published on Author gryzliLeave a comment

Here are some useful steps, how to configure nginx reverse proxy + caching.      1) How does Nginx  proxy cache works ?        In the scheme above we are considering that we have Apache upstream/origin server and in front of it Nginx which does reverse proxying + caching of Apache response.   … Continue reading Nginx – Configuring reverse proxy + caching

Protect from CVE-2016-5195 (DirtyCow) on Centos 7/RHEL7/cPanel/CloudLinux

Published on Author gryzli2 Comments

On october 19 2016, the Dirty Cow vulnerability went public (which is kernel privilege escalation vulnerability) . From what I have read and test, the exploit is working only on Centos 7/ RHEL7 / Cloudlinux 7 distros . I don’t know for other distros, because I’m not interested in them. How to protect yourself from… Continue reading Protect from CVE-2016-5195 (DirtyCow) on Centos 7/RHEL7/cPanel/CloudLinux

Centos 5 Yum Is Throwing [Errno -3] Error performing checksum

Published on Author gryzliLeave a comment

If you happen to encounter this problem, you could try the following fixes:   1| If you are using “custom” repository If you are using custom repository, which is made by newer version of “createrepo” , there is a big chance that you repodata checksums are generated with sha256. Centos 5’s yum doesn’t support sha256… Continue reading Centos 5 Yum Is Throwing [Errno -3] Error performing checksum

Installing perlbrew on Centos/Rhel/Fedora

Published on Author gryzliLeave a comment
Installing perlbrew

Why you may need perlbrew ? Perlbrew gives you the ability to maintain multiple perl versions, each having different set of install perl modules. The concept is not any new, we have already seen such things in Python (virtualenv) or Ruby (rvm). Basically you get the following benefits (as state in the perlbrew site also):… Continue reading Installing perlbrew on Centos/Rhel/Fedora

Centos/RHEL/Fedora Create Your Own YUM Repository

Published on Author gryzliLeave a comment

If you have learned how to build your own rpm packages (or want to use custom already built ones) , you maybe want to use your own yum repository for installing these packages. In the following how-to I will show you how to easily setup a yum repository. Prerequisites 1| Install createrepo First you need… Continue reading Centos/RHEL/Fedora Create Your Own YUM Repository

Centos/RHEL/Fedora Build RPM Package From Scratch

Published on Author gryzliLeave a comment
Build custom RPM on centos/rhel/fedora

Why to create your own RPM Package ? In the following post, I will explain how one could easily build RPM package from a custom files. Let say you have added some custom scripts or files and you want to create RPM of them, here is how to do it.   How to build your own… Continue reading Centos/RHEL/Fedora Build RPM Package From Scratch

Systemd – systemctl list-unit-files timeouts

Published on Author gryzliLeave a comment

The problem Recently I’ve started to occasionally see systemctl to timeout, while executing “list-unit-files”. The problem itself looks very annoying and the first thought I had was: “systemd is bugged out, the server must be restarted” In my current case, the problem is observed on a Centos 7 box. If you “restart” the server you… Continue reading Systemd – systemctl list-unit-files timeouts