CentOS - list all users

cat /etc/password
shows you all existing users.

May 29, 2018

How to create new SVN repository

1. open

/etc/httpd/conf.d/subversion.conf

2. add appropriate section for new repository:

<Location /svn-repository>
DAV svn
SVNPath /srv/svn/repository
AuthType Basic
AuthName "repository Repository"
AuthzSVNAccessFile /srv/svn/svn-acl-conf
AuthUserFile /srv/svn/repository.htpasswd
Require valid-user
</Location>

May 29, 2018

My current MySQL conf file my.cnf


[mysqld]
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
max_allowed_packet = 100M
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
skip-networking


skip-bdb

May 29, 2018

Backup and restore MySQL db

Problem
There are unrecovery problems in Ibdata log files

Solution
# login to mysql:
> mysql -u admin -p

mysql> show databases;

# per each db dump all data

> mysqldump -u admin -p database | gzip -9 > database.sql.gz

# Now Ibdata log files can be deleted

> service mysqld restart

# Restore all dbs from dump files

May 29, 2018

Batch convert upper case file names to lower case

Problem
Need batch convert upper case file names to lower case for jpg files.

Solution
run in shell:

for i in *.JPG; do mv $i `echo $i | tr [:upper:] [:lower:]`; done

May 29, 2018

Get 500 Internal Server Error when log into VZPP (Plesk Control Panel)

Error:
Get 500 Internal Server Error when log into VZPP (Plesk Control Panel)

Solution:

/etc/init.d/psa restart

May 29, 2018

user warning: Can't create/write to file '#sql_362c_0.MYD' (Errcode: 17)

Error:
user warning: Can't create/write to file '#sql_362c_0.MYD' (Errcode: 17)

Solution:
Remove file named #sql_362c_0.MYD from temporary directory that is used by mysql, in our case it is - /var/lib/mysql/

In case error has not disappeared - clear Drupal page cache

May 29, 2018

Install PEAR on shared hosting

PEAR by default is installed into /usr/share/pear which can conflict with current security settings per hosting server.
Pear official howto:
http://pear.php.net/manual/en/installation.shared.php
Install pear on shared web host:
http://www.techrepublic.com/article/application-development-install-pear...

May 29, 2018

Error when import Excel file using Excel Reader class

Got such error:
Wed Feb 17 15:41:07 2010] [error] [client 178.92.0.85] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24 bytes) in /var/www/vhosts/hostname/httpdocs/modules/cckimport/Excel/oleread.inc on line 27, referer: http://hostname/ru/create_price_list

Probably one server has a 64 bit processor. The GetInt4d bit shift doesn't work with 64 bit processors.

May 29, 2018

svn: Can't convert string from 'UTF-8' to native encoding:

Error:
svn: Can't convert string from 'UTF-8' to native encoding

Resolve:
$ export LC_CTYPE=en_US.UTF-8
$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL="C/en_US.UTF-8/C/C/C/C"

May 29, 2018

Pages