sobota, 30 kwietnia 2016

PHP Selector cheatsheet

Getting current PHP for a user:

selectorctl --user-current --user=UU

selectorctl --user-current --user=UU


Change PHP version for user:

selectorctl --set-user-current=5.3 --user=UU

selectorctl --set-user-current=5.3 --user=UU


Enabling some extensions for a user:

selectorctl --enable-user-extensions=pdo,phar --version=5.3 --user=UU

selectorctl --enable-user-extensions=pdo,phar --version=5.3 --user=UU

Disable is done in the same way.


List user extensions:

selectorctl --list-user-extensions --version=5.3 --user=UU

selectorctl --list-user-extensions --version=5.3 --user=UU


Replace option in users php.ini:

selectorctl –-replace-options=log_errors:on,display_errors:on --version=5.3 --user=UU

selectorctl –-replace-options=log_errors:on,display_errors:on --version=5.3 --user=UU

sobota, 9 kwietnia 2016

Debian 6 archive repo + ignore outdate

echo 'Acquire::Check-Valid-Until "false";' >/etc/apt/apt.conf.d/90ignore-release-date

sources.list

deb http://archive.debian.org/debian-archive/debian/ squeeze main contrib non-free
deb http://archive.debian.org/debian-archive/debian/ squeeze-lts main contrib non-free

środa, 23 marca 2016

Debian Squezze repo

deb http://archive.debian.org/debian-archive/debian/ squeeze main contrib non-free
deb http://archive.debian.org/debian-archive/debian/ squeeze-lts main contrib non-free

aptitude -o Acquire::Check-Valid-Until=false update

wtorek, 24 listopada 2015

CloudLinux MySQL SQLSTATE[HY000] [2002] No such file

Sprawdzamy czy ścieżka do datadir MySQL znajduje się w

/etc/cagefs/cagefs.mp

jeśli nie to dodajemy i remount all w cagefs

cagefsctl --remount-all

piątek, 13 listopada 2015

MegaCLI

MegaCli -AdpAllInfo -aAll

View information about the battery backup-up unit state

MegaCli -AdpBbuCmd -aAll

View information about virtual disks Useful for checking RAID level, stripe size, cache policy and RAID state:

MegaCli -LDInfo -Lall -aALL

View information about physical drives

MegaCli -PDList -aALL

To see information about the patrol read state and the delay between patrol read runs:

MegaCli -AdpPR -Info -aALL

To find out the current patrol read rate, execute

MegaCli -AdpGetProp PatrolReadRate -aALL

To reduce patrol read resource usage to 2% in order to minimize the performance impact:

MegaCli -AdpSetProp PatrolReadRate 2 -aALL

To disable automatic patrol read:

MegaCli -AdpPR -Dsbl -aALL

To start a manual patrol read scan:

MegaCli -AdpPR -Start -aALL

To stop a patrol read scan:

MegaCli -AdpPR -Stop -aALL

If your system is not connected to a UPS, you should disable the physical disk cache in order to prevent data loss.

MegaCli -LDGetProp EnDskCache -LAll -aALL

To enable it (only do this if you have a UPS and redundant power supplies):

MegaCli -LDGetProp DisDskCache -LAll -aALL

Detail about disks:

MegaCli -ShowSummary -aALL

Check patrol read warnings:

MegaCli -AdpEventLog -GetSinceReboot -warning -fatal -a0

wtorek, 27 października 2015

Centos 7 wybór kernela

Listowanie możliwych do wyboru:

awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg

ustawienie:

grub2-set-default 2

chroot-prepare

#!/bin/bash

#
# bind-mount /proc, /sys and /dev
#


mountpoint=${1:-/mnt}


# usage
#
if [ "$1" = "" -o "$1" = "--help" ] ; then
  echo "Usage:  $(basename $0) <mountpoint (default=/mnt)>"
  exit 0
fi


# bind-mount proc sys and dev
#
for fs in proc sys dev ; do
  mkdir -p $mountpoint/$fs
  mount --bind  /$fs  $mountpoint/$fs
done

if [ -d $mountpoint/run ]; then
  mkdir $mountpoint/run/lock
fi

wtorek, 15 września 2015

zabbix tty sudo

suoders

Defaults:zabbix !requiretty
Cmnd_Alias ZABBIX_CMD = /sbin/fuser, /usr/sbin/lsof, /usr/sbin/dmidecode, /sbin/mii-tool, /sbin/ethtool, /usr/bin/ipmitool, /usr/sbin/iptstate, /usr/bin/ocaudit, /usr/sbin/smartctl, /usr/sbin/smartd
zabbix   ALL = (other_user)  NOPASSWD: ALL
zabbix   ALL = (root)        NOPASSWD: ZABBIX_CMD