Записи с тэгом ‘Linux’

How to monitor Linux network quality for different directions

Wednesday, December 7th, 2016

The legends have two problems. They are not believed in or they are believed in too much.

Alexey Pehov «The Sentinel»

tcp-retrans

Sometimes we might need to know if the network connection between our host and other peers is good enough. The main quality attributes of the network connection are badwidth (quite easy to explore) and the packet loss rate (quite difficult to explore). Of course we can monitor the overall TCP retransmit rate (for example using something like netstat -s | grep -i retrans), build the graph and stare at it. But we'll never know which direction is loosing the packets and where is the problem itself.

I have not found the ready-to-use solution and created my own. You can see the results right here on the screenshot.

 

(more…)

Метки: ,
Категория: Linux, Perl | Нет комментариев »


Generate RPM SPEC changelogs in Git

Tuesday, November 8th, 2016

You have to be a bit of a liar to tell a story the right way.

Patrick Rothfuss «The Name of the Wind»

rpm-gitThis little note will be useful for those who is lazy enough for dealing with changelogs in RPM spec-files and lazy enough to implement own solution. I will present the script to work from inside the git repository. It can check if the changelog complies the current version and update the changelog accordingly if needed. No git tags are needed.

There are two variants of the script. One is for running on the build server (Jenkins/Bamboo/TeamCity…) right before building the RPM. And the second one is the post-commit hook. Second option can be useful if your build server has no write access to the repository or if you'd like to keep git history cleaner (this option doesn't create extra commits).

The script needs rpmspec utility to be installed. So if you are using some non-RH distro just look for the needed package. In Ubuntu you need the package named 'rpm'.

(more…)

Метки: ,
Категория: Linux | Нет комментариев »


How to pack Java Cryptography Extension (JCE) to JDK RPM

Friday, July 22nd, 2016

I don’t have problem. I am part of problem.

Daniel Keyes «The Minds of Billy Milligan»

jce

Let's imagine you have hundreds of hosts where you automatically install or update HotSpot JDK from the RPM-repository. For example, by RPM dependencies while installing or updating some another software. You maintain your repository by yourself and you'd like to have JDK and JCE in one RPM package.

Then this tiny article will help you.

(more…)

Метки:
Категория: Linux | 1 Комментарий »


How to query MS SQL Server database from Linux CLI

Wednesday, June 15th, 2016

We have no need of other worlds. We need mirrors. We don't know what to do with other worlds.

Stanisław Lem «Solaris»

SQLServerLinuxSo let's assume that we need a small keyhole to look into SQL Server database and query some data from it. Maybe we'd like to automate some reporting stuff or to make some web GUI with some information stored in MSSQL. And of course we don't want to deal with Windows.

Fortunately there is such a project as FreeTDS. It gives us a driver for using with ODBC engine. I will show how to configure it and how to retreive some data right from MSSQL. 

Everything written below is true for the case of RHEL/CentOS 7.

(more…)

Метки:
Категория: Linux | Нет комментариев »


Links between Oracle and PostgreSQL, or There and Back Again

Thursday, September 24th, 2015

“I should like to know about risks, out-of-pocket expenses, time required and remuneration, and so forth” — by which he meant: “What am I going to get out of it? And am I going to come back alive?”

J.R.R.Tolkien «The Hobbit, or There and Back Again»

hobbit

Please don’t wait for any revelations from this article. This is just a compilation of some notes about configuring links between Oracle Database 11.2 and PostgreSQL 9.4. Everything written below is true for the case of Linux (RHEL/CentOS 7 to be exact) and I cannot guarantee its operability on other platforms or versions.

So let’s get to the point. In the first part of the article I will show how to configure the DB link from Oracle to PostgreSQL using ODBC driver and Oracle Heterogeneous Services (HS) agent. In the second part I will show how to access Oracle databases from PostgreSQL using foreign data wrapper (oracle_fdw).

(more…)

Метки: , ,
Категория: Linux, Oracle | 5 Комментариев »


Fcgiwrap, or How to run CGI-scripts without Apache and mod_cgi

Tuesday, August 25th, 2015

This buzz is not without the reason.

Soviet cartoon «Winnie the Pooh»

pooh-buzz

It’s definitely a bad idea to get Apache running only for executing some lightweight CGI-scripts. And it’s definitely a good idea to use Nginx where possible. But Nginx while being a perfect reverse proxy just cannot run GGI because of its event-based paradigm. This is the situation where the strengths become weaknesses. But we can still deal with this by virtue of some third-party tools like fastcgi wrappers. One of such tools is fcgiwrap server and in this post I’ll show how to build it and how to use it.

(more…)

Метки: , ,
Категория: Apache, Linux, Nginx | Нет комментариев »


Про Oracle, ASM, iSCSI и ядро 2.6.39-400

Monday, January 19th, 2015

Накормить дрянью так, чтобы все были в восторге – в этом кулинария схожа с политикой.

Святослав Логинов «Многорукий бог далайна»

oracle-bad Опять заметка про Oracle и опять в стиле "баги атакуют". Может, кому-нибудь пригодится. Итак, есть Oracle 11g, RAC (хоть это и не имеет значения) и группа дисков, получаемых по iSCSI и скормленных в ASM. Пока всё неплохо, но тут переходим к ключевому моменту: всё это работает на RHEL5 с UEK-ядром из ветки 2.6.39-400.

В какой-то момент становится понятно, что, если остановить iSCSI-таргет, с которого мы получаем диски, то, несмотря на normal redundancy и на наличие нескольких failgroups, инстанс ASM умирает, прихватывая с собой весь clusterware. Надёжность летит к чертям, кластер может упасть от любого чиха.

(more…)

Метки: ,
Категория: Linux, Oracle | Нет комментариев »


Автоматическое выкачивание новых серий любимых сериалов

Friday, November 7th, 2014

Извините! Я почему вредный был? Потому что у меня велосипеда не было! А теперь я сразу добреть начну.

м/ф «Трое из Простоквашино»

bicycleНекоторое время назад на некоторых ресурсах (в основном на Хабре) на глаза несколько раз попадались посты о том, как организовать автоматическое скачивание новых серий, которые появляются на сериальных торрент-трекерах. В основном речь шла о ресурсе lostfilm.tv, и суть метода состояла в периодическом парсинге RSS-ленты, обнаружении ссылок на новые серии нужных сериалов, скачивание торрент-файлов и подкладывании их в некоторое место, откуда их может забрать в работу торрент-клиент.

Идея показалась мне интересной, а реализация – скучной, так что мысль о своём велосипеде в фоновом режиме жила в голове несколько месяцев, а недавно за пару дней реализовалась в рабочий вариант.

 

(more…)

Метки: ,
Категория: Linux, Perl | 2 Комментариев »


Расширение Linux Raid

Friday, October 31st, 2014

Счастье классиков в том, что они мертвы.
Наше и ваше счастье в том, что они мертвы.

Акутагава Рюноскэ «Слова пигмея»

raidНебольшая заметка про то, как увеличить размер программного RAID после, например, замены дисков на более ёмкие. Пусть мы заменили диски в linux raid:

mdadm –remove /dev/md0 /dev/sda1
mdadm –add /dev/md0 /dev/sdb1

Дождались полного ресинка:

watch -n 10 "cat /proc/mdstat | grep resync"
   [======>…………..] resync = 34.6% (1248559808/3599812864) finish=164.0min speed=238826K/sec

Cкорость ресинка при этом можно увеличить:

echo 50000 > /proc/sys/dev/raid/speed_limit_min
echo 300000 > /proc/sys/dev/raid/speed_limit_max

(more…)

Метки:
Категория: Linux | Нет комментариев »


Сборка Nginx в DEB-пакет

Tuesday, April 8th, 2014

И тут на Ёжика, шурша и осыпаясь, обрушилась тишина.

Сергей Козлов «Ёжик в тумане»

nginx deb package

Нижеследующий текст не претендует на полноту, объективность и, может быть, даже на полезность. Это просто очередной кусок скомканных заметок, которые я для себя оставляю в Evernote, а потом изредка достаю оттуда, разбавляю бестолковыми комментариями и переношу в бложик в беспочвенной надежде, что кому-нибудь пригодится. В данном случае это будет статья по сборке Nginx из исходников в Debian-пакет для размещения его на своём локальном репозитории. Этот навык полезен в том случае, когда Nginx работает на нескольких машинах и хочется удобно обновлять его сразу везде.

Впрочем, и не обязательно иметь несколько машин. Даже если речь идёт об одном сервере, хорошим тоном будет устанавливать программы через менеджер пакетов. В будущем эта привычка сможет оградить от многих проблем и добавить удобства упраления файлами. В Debian/Ubuntu от make && make install стоит отказаться ради душевного спокойствия и очистки кармы.

Так-то в большинстве случаев можно просто ставить Nginx из официальных репозиториев (или даже с LaunchPad'а, где всегда можно найти распоследнюю версию), но Nginx не умеет подключать внешние модули. Хочешь нестандартный модуль – компилируй. Этим и займёмся.

 

(more…)

Метки: ,
Категория: Linux, Nginx | Нет комментариев »