П'ятниця, липня 29, 2016

Останні записи

Опублікував Автор: Створено: в Uncategorized

https://ma.ttias.be/enable-disable-service-at-boot-on-centos-7/

This post will show you how to enable or disable a service to start on boot, on a RHEL or CentOS 7.

Check if the service starts on boot

You manage your services on RHEL/CentOS 7 through systemctl, the systemd service manager.

...
Переглядів: 233
0

Опублікував Автор: Створено: в Uncategorized
фаервол в LinuxДоброго времени, читатели и гости моего блога. C этой статьи начну серию статей о подсистеме Netfilter/iptables в Linux. В данной статье приведу основные понятия работы netfilter в Linux. Для понимания данной темы, обязательно советую ознакомиться со статьями Основные понятия сетей,Настройка сети в Linux, диагностика и мониторинг и Настройка и управление сетевой подсистемой Linux (iproute2).
Переглядів: 45
0

Опублікував Автор: Створено: в Uncategorized

https://access.redhat.com/solutions/255093

 

Issue

  • We're planning to purchase and roll out a bunch of new servers loaded up with solid-state disks in hardware-raid configurations and want to get some definitive answers from Red Hat regarding the statements below from the RHEL 6 Storage Administration Guide, i.e., does any of it apply to hardware raid?

    In addition, keep in mind that MD (software raid) does not support discards. In contrast, the logical volume manager (LVM) and the device-mapper (DM) targets that LVM uses do support discards. The only DM targets that do not support discards are dm-snapshot, dm-crypt, and dm-raid45. Discard support for the dm-mirror was added in Red Hat Enterprise Linux 6.1.

    Red Hat also warns that software RAID levels 1, 4, 5, and 6 are not recommended for use on SSDs. During the initialization stage of these RAID levels, some RAID management utilities (such as mdadm) write to all of the blocks on the storage device to ensure that checksums operate properly. This will cause the performance of the SSD to degrade quickly.

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/ch-ssd.html

Переглядів: 93
0

Опублікував Автор: Створено: в Uncategorized

echo writemostly >  /sys/block/md127/md/dev-sde1/state

You can enable "write-mostly" for a RAID component in the following way:

echo writemostly > /sys/block/md6/md/dev-sdc6/state and disable it this way:

echo -writemostly > /sys/block/md6/md/dev-sdc6/state If for some reason you cannot set a component of a RAID1 to "write-mostly", you can kick it from the array and re-add it with the write-mostly flag active. This will temporarily lower your redundancy level. Backup before doing this is recomended.

To set /dev/sdc6 from the last example to "write-mostly" would work as follows:

To kick, first set it to "faulty":

mdadm --fail /dev/md6 /dev/sdc6 Then kick it:mdadm --remove /dev/md6 /dev/sdc6 Then add it again:mdadm --add /dev/md6 --write-mostly /dev/sdc6 Wait for the RAID1 resync to complete, and /dev/sdc6 will now only be read when needed.

Переглядів: 85
0

Опублікував Автор: Створено: в Uncategorized

https://www.prosinger.net/upgrading-postfix-centos-6-x/

 

(updated Feb 29th 2016)

One problem that can comes up with the fantastic Centos Linux distro is that it sticks to the proven but also old packages. I needed some newer features several times. The only (good) way to upgrade Postfix to the newest package is to build it up from the source.

First, we need the link to the newest package (take a look here). In my case, it’s 2.11 stable, so let’s download it:

cd wget http://cdn.postfix.johnriley.me/mirrors/postfix-release/official/postfix-3.1.0.tar.gz tar xvf postfix-3.1.0.tar.gz cd postfix-3.1.0Now we need to isntall the development packages and the dependencies. These are the packages that I needed but You might need to install more, depending on which features You want to compile into it. For a standard featured Postfix MTA with SASL and MySQL support you’ll need the following:

yum install libdb-devel db4-devel cyrus-sasl cyrus-sasl-devel openssl openssl-devel pcre pcre-devel openldap openldap-devel mysql-develLet’s celan up the makefiles now, and build new ones (because by the supplied makefile Postfix won’t be compiled with SASL and SQL support), and at the end let’s build the whole package:

make clean make tidy make makefiles CCARGS='-fPIC -DUSE_TLS -DUSE_SSL -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DPREFIX=\\"/usr\\" -DHAS_LDAP -DLDAP_DEPRECATED=1 -DHAS_PCRE -I/usr/include/openssl -DHAS_MYSQL -I/usr/include/mysql -I/usr/include/sasl -I/usr/include' AUXLIBS='-L/usr/lib64 -L/usr/lib64/openssl -lssl -lcrypto -L/usr/lib64/mysql -lmysqlclient -L/usr/lib64/sasl2 -lsasl2 -lpcre -lz -lm -lldap -llber -Wl,-rpath,/usr/lib64/openssl -pie -Wl,-z,relro' OPT='-O' DEBUG='-g' makeThe last step (build) will take a while, depeding on the CPU power of Your Linux box. At this moment, if it maneges to build without errors, you’ll have a ready to upgrade package. If not, you will need to yum groupinstall “Development Tools” and retry.

Regarding the arguments about building the makefile (step 3 above), depending on the features You want built in the new Postfix package please refer to the chapter 4.4 of the Postfix documentation. Basically, I never needed anything more than this, except that sometimes I want to use PgSQL instead of MySQL, then you will need to yum install postgresql-devel package and insert the correct arguments when creating the makefile.

One more note: creating the makefile in this example is done for Centos 6.x x64. If you are building for the 32-bit verion you will have to replace all the /usr/lib64 arguments with /usr/lib.

If everything is errorless, perform the update:

make upgradeDone. Please also read the suggested articles during install about the new features, and sugested changes to the master.cf and main.cf files.
Regarding the package, since You done it by compiling from the source, the RPM package will stay at version 2.6.x but when you finally do a service postfix restart you will see:

Dec 3 09:23:56 one postfix/master[31460]: daemon started — version 3.0.3, configuration /etc/postfix

Good luck!

...
Позначки: postfix
Переглядів: 413
0

Опублікував Автор: Створено: в Uncategorized
916 echo -e -n "\x50" > /dev/ttyUSB0
917 echo -e -n "\x51" > /dev/ttyUSB0
918 echo -e -n "\x04" > /dev/ttyUSB0
919 echo -e -n "\x51" > /dev/ttyUSB0
920 echo -e -n "\x04" > /dev/ttyUSB0
921 echo -e -n "\x51" > /dev/ttyUSB0
922 echo -e -n "\x04" > /dev/ttyUSB0
923 echo -e -n "\x50" > /dev/ttyUSB0
924 echo -e -n "\x04" > /dev/ttyUSB0
925 echo -e -n "\xff" > /dev/ttyUSB0
926 echo -e -n "\x04" > /dev/ttyUSB0
927 echo -e -n "\xff" > /dev/ttyUSB0
928 echo -e -n "\x04" > /dev/ttyUSB0
929 echo -e -n "\x50" > /dev/ttyUSB0
930 echo -e -n "\xff" > /dev/ttyUSB0
931 echo -e -n "\x04" > /dev/ttyUSB0
932 echo -e -n "\xff" > /dev/ttyUSB0
933 echo -e -n "\x04" > /dev/ttyUSB0
934 echo -e -n "\x50" > /dev/ttyUSB0
935 echo -e -n "\x04" > /dev/ttyUSB0
936 echo -e -n "\x51" > /dev/ttyUSB0
937 echo -e -n "\x04" > /dev/ttyUSB0
938 echo -e -n "\x51" > /dev/ttyUSB0
939 echo -e -n "\x04" > /dev/ttyUSB0
940 echo -e -n "\x51" > /dev/ttyUSB0
941 echo -e -n "\x04" > /dev/ttyUSB0
942 echo -e -n "\x50" > /dev/ttyUSB0
943 echo -e -n "\x04" > /dev/ttyUSB0
944 echo -e -n "\x50" > /dev/ttyUSB0
945 echo -e -n "\x51" > /dev/ttyUSB0
946 echo -e -n "\x04" > /dev/ttyUSB0
947 echo -e -n "\x50" > /dev/ttyUSB0
948 echo -e -n "\x04" > /dev/ttyUSB0
949 echo -e -n "\x50" > /dev/ttyUSB0
950 echo -e -n "\x04" > /dev/ttyUSB0
951 echo -e -n "\x50" > /dev/ttyUSB0
952 echo -e -n "\x04" > /dev/ttyUSB0
953 echo -e -n "\x50" > /dev/ttyUSB0
954 echo -e -n "\x04" > /dev/ttyUSB0
955 echo -e -n "\x50" > /dev/ttyUSB0
956 echo -e -n "\x51" > /dev/ttyUSB0
957 echo -e -n "\x04" > /dev/ttyUSB0
958 echo -e -n "\x50" > /dev/ttyUSB0
959 echo -e -n "\x04" > /dev/ttyUSB0
960 echo -e -n "\x50" > /dev/ttyUSB0
961 echo -e -n "\x51" > /dev/ttyUSB0
962 echo -e -n "\x04" > /dev/ttyUSB0
963 echo -e -n "\x51" > /dev/ttyUSB0
964 echo -e -n "\x04" > /dev/ttyUSB0
965 echo -e -n "\x51" > /dev/ttyUSB0
966 echo -e -n "\x04" > /dev/ttyUSB0
967 echo -e -n "\x51" > /dev/ttyUSB0
Переглядів: 506
0

Опублікував Автор: Створено: в Uncategorized

 

root@ismo:~# dmesg |grep command [    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-2.6.32-25-generic root=UUID=b59249ce-9490-400d-a435-4c6669cb53ed ro splash libata.dma=0

 

[root@sol-fttb ~]# hdparm -tT /dev/sdf

/dev/sdf:
Timing cached reads: 17890 MB in 2.00 seconds = 8953.05 MB/sec
Timing buffered disk reads: 320 MB in 3.01 seconds = 106.40 MB/sec
You have new mail in /var/spool/mail/root
[root@sol-fttb ~]# hdparm -tT /dev/sdg

/dev/sdg:
Timing cached reads: 17310 MB in 2.00 seconds = 8662.82 MB/sec
Timing buffered disk reads: 300 MB in 3.12 seconds = 96.25 MB/sec
[root@sol-fttb ~]#

...
Переглядів: 678
0

Опублікував Автор: Створено: в Uncategorized

hdparm -I /dev/sdf

NCQ (англ. Native Command Queuing — апаратна установка черговості команд) — технологія, що використовується в SATA-пристроях починаючи з SATA/300 для підвищення швидкодії. Пристрої з підтримкою NCQ здатні приймати декілька запитів одночасно та реорганізовувати порядок їх виконання для досягнення максимальної ефективності (продуктивності) з урахуванням внутрішньої архітектури пристрою (мінімізуючи кількість переміщень головок та очікування потрібного сектора на треку). NCQ підвищує продуктивність завдань, пов'язаних з довільним читанням, обробкою даних від двох і більше джерел, одночасну роботу декількох програм. (Типове навантаження для сервера — одночасне виконання запитів від декількох клієнтів).

You may disable NCQ, and use normal READ/WRITE DMA commands, by setting the queue depth to 1:

...
Переглядів: 643
0

Опублікував Автор: Створено: в Uncategorized

cd /usr/local/lib/node_modules/mysql

mkdir mysql

cd mysql

...
Переглядів: 662
0

Опублікував Автор: Створено: в Uncategorized

iptables -L -n -v -x --line-number (подивитися якісь там таблички з байтами і нумераціє...)

 

iptables -N TRAFFIC_ACCT_IN (додати ланцюжок TRAFFIC_ACCT_IN)

...
Переглядів: 679
0

Опублікував Автор: Створено: в Uncategorized

http://www.catonmat.net/blog/traffic-accounting-with-iptables/

A few years ago I worked as a Linux system administrator at a small (few hundred users) Internet service provider. Among all the regular system administrator duties, I also had the privilege to write various software and tools for Linux. One of my tasks was to write a tool to record how much traffic each of the clients was using.

The network for this provider was laid out in a very simple way. The gateway to the Internet was a single Linux box, which was a router, a firewall and performed traffic shaping. Now it had to be extended to do traffic accounting as well.

...
Переглядів: 685
0

Опублікував Автор: Створено: в Uncategorized

http://www.cyberciti.biz/faq/debian-ubuntu-centos-rhel-install-apcups/

My Linux nas server connected to APC SmartUPS using usb cable and I would like to detect a power failure. If power is not restored my server must shutdown when the battery is exhausted. How do I configure and use my APC SmartUPS under Debina / Ubuntu / RHEL / CentOS / Fedora / Scientific Linux operating system for power management?


Linux comes with GPL licensed open source apcupsd server ( daemon ) that can be used for power mangement and controlling most of APC's UPS models on Linux, BSD, Unix and MS-Windows operating systems. Apcupsd works with most of APC's Smart-UPS models as well as most simple signalling models such a Back-UPS, and BackUPS-Office. During a power failure, apcupsd will inform the users about the power failure and that a shutdown may occur. If power is not restored, a system shutdown will follow when the battery is exhausted, a timeout (seconds) expires, or runtime expires based on internal APC calculations determined by power consumption rates.

...
Позначки: apc ups
Переглядів: 652
0

Опублікував Автор: Створено: в Uncategorized

маємо блок безперебійного живлення apc suA1000I

приєднали два однакових  машинних акумулятори

 Varta 6СТ-45 BLACK dynamic (B20)

...
Переглядів: 636
0

Опублікував Автор: Створено: в Uncategorized
Переглядів: 633
0

Опублікував Автор: Створено: в Uncategorized

можна подивитися на приклад чату https://github.com/socketio/socket.io/tree/master/examples/chat

але щоб недуже загубитися в двох сторінках коду є простий приклад який на ссервері пише в консоль а на браузері в консоль браузера

https://habrahabr.ru/sandbox/90655/

...
Переглядів: 749
0

Опублікував Автор: Створено: в Uncategorized

Recently, on my CentOS server, I had my system error log at /var/log/messages flooded with a whole heap of lines like the one below.


server01 atd[13653]: File a0001001567d06 is in wrong format – aborting

Naturally, this continued until the server ran out of disk space and died. I couldn’t work out how the issue actually originated however, I managed to fix the issue by deleting the at job that was failing.

The following commands fixed the problem for me.

First of all use atq to find out the job number.

# atq a0001001567d06
You should get a response similar to the one below. The first number is the job number you need to run the next command.

16 2012-09-04 00:38 a root
Using the job number from above, run atrm to remove the troublesome job

# atrm 16
Problem solved!
Переглядів: 609
0

Опублікував Автор: Створено: в Uncategorized

# node -v
v0.10.23

обновлюємо версію

sudo npm cache clean -f

...
Переглядів: 648
0

Опублікував Автор: Створено: в Uncategorized

Завдання перенаправити вхідну пошту для конкретних поштових скриньок на якийсь транспорт

наприклад на PHP скрипт

Метод 1

...
Позначки: postfix
Переглядів: 1044
0

Опублікував Автор: Створено: в Uncategorized

методика звідси http://flashboot.ru/files/file/270/

1 ) взнаємо чіп \

http://disk.pp.ua/files/ChipGenius_v4_00_0022_RC3.rar

...
Переглядів: 1783
0

Опублікував Автор: Створено: в Uncategorized

можна еревірити як грузиться сайт з різних серваків

http://www.alertra.com/

Переглядів: 1718
0