Monthly Archives: September 2018

directadmin custom extension exif with php-fpm

cd /usr/local/directadmin/custombuild
mkdir /usr/local/directadmin/custombuild/custom/fpm
cp -v /usr/local/directadmin/custombuild/configure/fpm/configure.php72 /usr/local/directadmin/custombuild/custom/fpm/
cp -v /usr/local/directadmin/custombuild/configure/fpm/configure.php56 /usr/local/directadmin/custombuild/custom/fpm/

vi /usr/local/directadmin/custombuild/custom/fpm/configure.php56
#!/bin/sh
./configure \
--prefix=/usr/local/php56 \
--program-suffix=56 \
--enable-fpm \
--with-config-file-scan-dir=/usr/local/php56/lib/php.conf.d \
--with-curl=/usr/local/lib \
--with-gd \
--enable-gd-native-ttf \
--with-gettext \
--with-jpeg-dir=/usr/local/lib \
--with-freetype-dir=/usr/local/lib \
--with-libxml-dir=/usr/local/lib \
--with-kerberos \
--with-openssl \
--with-mcrypt \
--with-mhash \
--with-mysql=mysqlnd \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
--with-mysqli=mysqlnd \
--with-pcre-regex=/usr/local \
--with-pdo-mysql=mysqlnd \
--with-pear \
--with-png-dir=/usr/local/lib \
--with-xsl \
--with-zlib \
--with-zlib-dir=/usr/local/lib \
--enable-zip \
--with-iconv=/usr/local \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--enable-sockets \
--enable-soap \
--enable-mbstring \
--with-icu-dir=/usr/local/icu \
--enable-intl \
--enable-exif

./build php n

php -i | grep exif
exif
exif.decode_jis_intel => JIS => JIS
exif.decode_jis_motorola => JIS => JIS
exif.decode_unicode_intel => UCS-2LE => UCS-2LE
exif.decode_unicode_motorola => UCS-2BE => UCS-2BE
exif.encode_jis => no value => no value
exif.encode_unicode => ISO-8859-15 => ISO-8859-15

ssh use multiplexing with rsync

This will increase rsync speed.
vi ~/.ssh/config
host *
controlmaster auto
controlpath /tmp/ssh-controlmaster-%r@%h:%p

ssh user@hostname

In other terminal:
ssh -O check user@hostname
Master running (pid=444444)

#ssh -O stop user@hostname
#ssh -O exit ser@hostname

rsync -avz -e ssh /some/path user@hostname:/some/path

print a stack trace of a running process

gstack PID

Thread 3 (Thread 0x7f196867d700 (LWP 1873)):
#0 0x00007f1988a89c6b in poll () from /lib64/libc.so.6
#1 0x00007f1983965eb9 in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
#2 0x00007f1983965fcc in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3 0x00007f19898e0d1f in QEventDispatcherGlib::processEvents(QFlags) () from /lib64/libQt5Core.so.5

btier cache

Btier is not a cache but tiered storage that automatically moves frequently accessible data to fast(er) device.

wget http://sourceforge.net/projects/tier/files/STABLE_PRODUCTION/btier-1.3.11.tar.gz
tar -xvf btier-1.3.11.tar.gz -C /usr/src

dkms add -m btier/1.3.11
dkms build -m btier/1.3.11
dkms install -m btier/1.3.11
modprobe btier

#dkms remove -m btier/1.3.11 –all # You can remove if build was not successful

dkms status
btier, 1.3.11, 2.6.XXX, x86_64: installed

btier_setup -f /dev/sdaX:/dev/sdbX -cVz 4096
echo 0 >/sys/block/sdtiera/tier/sequential_landing
fsck -y /dev/sdtiera
mount -o discard,noatime,nodiratime /dev/sdtiera /some_dir/path

Works with Centos OS.

If you have error “Error! Could not locate dkms.conf file”

vi dkms.conf
PACKAGE_VERSION=”1.3.11″
PACKAGE_NAME=”btier”
AUTOINSTALL=”yes”
BUILT_MODULE_NAME[0]=”btier”
BUILT_MODULE_LOCATION[0]=”kernel/btier”
DEST_MODULE_LOCATION[0]=”/kernel/drivers/block”
REMAKE_INITRD=”no”
MAKE[0]=”make -Wall -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/kernel/btier modules”

dumps tasks that are in uninterruptable (blocked) state

echo w >/proc/sysrq-trigger

dmesg
[4680785.899872] Show Blocked State
[4680785.900063] task taskaddr stack pid father veid
[4680785.900223] lxc-start D ffff8802eed94640 0 74111 68892 113 0x00000084
[4680785.900228] ffff88008d5b3c18 0000000000000086 0000000000000000 ffff8804212a74c8
[4680785.900233] ffff88008d5b3b98 ffffffff811e374c 00109c9dbec7d9ab ffff8804212a7400
[4680785.900237] ffff8804212a74c8 0000000000000000 0000000216c01c50 00000000000004b4
[4680785.900241] Call Trace:
[4680785.900248] [] ? dispose_list+0xfc/0x120
[4680785.900253] [] fsnotify_unmount+0x1d5/0x270
[4680785.900258] [] ? autoremove_wake_function+0x0/0x40
[4680785.900262] [] fsnotify_unmount_mnt+0x29/0x40
[4680785.900267] [] mntput_no_expire+0xf3/0x110
[4680785.900270] [] release_mounts+0xa9/0xc0
[4680785.900274] [] put_mnt_ns+0x98/0xc0
[4680785.900278] [] ? proc_delete_inode+0x0/0xa0
[4680785.900281] [] mntns_put+0xe/0x10
[4680785.900284] [] proc_delete_inode+0x8e/0xa0
[4680785.900288] [] generic_delete_inode+0xd8/0x1d0
[4680785.900291] [] iput+0xc9/0x110
[4680785.900294] [] dentry_iput+0xa0/0x110
[4680785.900298] [] d_kill+0x3c/0x70
[4680785.900301] [] dput_nocache+0xf6/0x260
[4680785.900304] [] dput+0x10/0x20
[4680785.900308] [] __fput+0x1d7/0x290
[4680785.900312] [] fput+0x25/0x30
[4680785.900315] [] filp_close+0x60/0x90
[4680785.900319] [] sys_close+0xa5/0x100
[4680785.900324] [] system_call_fastpath+0x2f/0x34