Chroot grub2

Today I forgot my root password, it must be Alzheimer. Anyhow here is the quick recipe to reset it. On the grub boot screen type ‘e’ for edit. Next edit the line starting with linux, at the end add init=/bin/bash it should look like this.

linux /boot/vmlinuz-version root=UUID=hex rw quite init=/bin/bash

Next hit Ctrl-X to boot, you should land on a prompt without having to type your password. Next enter the following two commands:

mount -o remount,rw or mount -a
passwd

Enter the new password twice, type the following:

sync
reboot

You should be all set!

Block domain or email addr. in postfix

In /usr/local/etc/postfix/access_sender, add email or domain which you want to block.

debelan88@gmail.com reject_unverified_sender

To reject and send explanation message, that mail server wont accept the mail, you must use reject_unverified_sender not REJECT. REJECT rejecting the mail without explanation message.

after add desirable domain or address, you need to update access sender database:

postmap hash:access_sender

– YOU MUST BE IN THE DIRECTORY WHERE IS ACCESS SENDER FILE

If you don`t have in main.cf strings about error messages you must add them on hand.

unknown_local_recipient_reject_code = 550
unknown_client_reject_code = 550
unknown_address_reject_code = 550
unknown_hostname_reject_code = 550
unverified_sender_reject_code = 550
unverified_recipient_reject_code = 550

Cacti spine snmp responce time

Ако има графики които , не чертаят след поставянето на spine и при лога има грешка от сорта:

03/20/2014 04:44:25 PM – SPINE: Poller[0] Host[256] TH[1] DS[2833] WARNING: SNMP timeout detected [500 ms], ignoring host ‘192.168.55.140’

Влизаш в настройките на хоста и увеличаваш snmp timeout-a 🙂

Cacti Spine

Add in crontab these 2 scrypts to rebuild poller cache and reindex hosts in databse

27 3 * * * www /usr/local/bin/php -q /usr/local/www/html/cacti/cli/rebuild_poller_cache.php > /dev/null 2>&1
52 3 * * * www /usr/local/bin/php -q /usr/local/www/html/cacti/cli/poller_reindex_hosts.php -id=All > /dev/null 2>&1

Минимални настройки на php.ini – Колкото повече, толкова повече!

max_execution_time = 180 ; Maximum execution time of each script, in seconds
max_input_time = 180 ; Maximum amount of time each script may spend parsing request data;
max_input_nesting_level = 64 ; Maximum input variable nesting level
memory_limit = 512M ; Maximum amount of memory a script may consume
short_open_tag = On
upload_max_filesize = 24M
post_max_size = 24M

Минимална конфигурация на my.cnf – за препоръчване да се ползва тази от статс-а, защото е преправена (направена)

[mysqld]
# MOST IMPORTANT FOR SPINE/BOOST PERFORMANCE
tmp_table_size = 512M
max_heap_table_size = 512M

# SOME TUNING
key_buffer = 256M
max_allowed_packet = 16M
myisam_sort_buffer_size = 32M
net_buffer_length = 8K
query_cache_size = 128M
read_buffer_size = 1M
read_rnd_buffer_size = 32M
skip-external-locking
sort_buffer_size = 128M
table_open_cache = 1024
table_definition_cache = 1024

# ENABLE LOGGING SLOW QUERIES
log_slow_queries
long_query_time = 2
log_queries_not_using_indexes = 1

# DISABLE BIN LOG
#log-bin=mysql-bin
#binlog_format=mixed

Слага се boost plugin за cacti. Прави се папка, в която да кешира rra-тата