Install And Configure Teleport On Centos 7 / RHEL 7

Published on Author gryzli

Gravitational Teleport is a nice tool for centralizing and securing accesses to hosts and services on your infrastructure.  In the following how-to I’ll explain how to:  Install Teleport Community Edition server under Centos 7  Install Teleport CE client under Centos 7  Configure your first access user  Configure an access limited user  Some hints for better… Continue reading Install And Configure Teleport On Centos 7 / RHEL 7

How To Use GeoIP2 (mmdb) Database With Perl

Published on Author gryzli

This article is the result of my struggles to properly use GeoIP v2 database within Perl.    TL;DR  The FASTEST way to use the database is by installing and utilizing the “MaxMind::DB::Reader::XS” perl module.  And here is a tiny example: use MaxMind::DB::Reader::XS ;  use Data::Dumper;  my $geoip_country = MaxMind::DB::Reader::XS->new( file => ‘/usr/share/GeoIP/GeoIP2-Country.mmdb’ ); print Dumper… Continue reading How To Use GeoIP2 (mmdb) Database With Perl

Rotating Indexes in ElasticSearch with Curator

Published on Author gryzli

At certain point in time, you will want to rotate (delete) your old indexes in ElasticSearch. Most of the time people are using time based naming convention for their index names like: index_name-Year-Month-Day or index_name-Year.Month.Day. Tools like Filebeat/Logstash can also use such naming conventions. Before you go and write your own script that will do… Continue reading Rotating Indexes in ElasticSearch with Curator

Detailed CPU Usage Overview With psacct

Published on Author gryzli

If you ever asked yourself the following questions, this might be the right place for you: How to check how much cpu is consuming each system user ? How to check how much cpu is consumed by each command ? Check when a command has been executed and how much cpu it did ? How… Continue reading Detailed CPU Usage Overview With psacct

Linux Admin Daily Usage

Published on Author gryzli

Shell   Calculate the size of all files from a given type/extension Recently I need something for doing such calculations and end up with the following command line (found on stackexchange), which will calculate the size summary for all “*.jpg” files in “some_directory”. find some_directory/ -type f -name ‘*.jpg’ -exec du -ch {} + |… Continue reading Linux Admin Daily Usage

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:   root@localhost# cat ss.txt BEGIN ID:45 LS:33 END BEGIN ID:50 LS:33 END BEGIN ID:47 LS:33 END BEGIN ID:55 LS:35 END   Now consider we want to delete the BEGIN/END block,  containing “ID:45”: [gryzli@localhost temp]$ cat ss.txt… Continue reading Sed – Deleting Multiline Patterns

Installing perlbrew on Centos/Rhel/Fedora

Published on Author gryzli

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 gryzli

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