How to deal with mysqldump error 23: out of resources when opening file

So earlier today I was doing a mysql dump of a large database. And I got this error: mysqldump: Got error: 23: "Out of resources when opening file './xxxx/xxxx' (Errcode: 24)" when using LOCK TABLE A quick google reveals that it’s because the number of files that MySQL is permitted to open has been exceeded. So I counted how many files our database has: ls /var/lib/mysql/dbname/ -l|wc -l The result is 8350 files. Then checked the limit by executing this in phpmyadmin: SHOW VARIABLES LIKE 'open%' It gives me a result of 1024, so I opened /etc/my.cnf and added [mysqld] open_files_limit = 10000 Unfortunately this didn’t do the job! Some further digging landed me on Read More

PPTPD VPN server installation and configuration

This howto describes the steps in how to setup a PPTP VPN on Centos, Fedora, Debian, and Ubuntu with basic RSA authentication. Before the installation make sure to have your Yum repos updated with the Epel repos. CentOS and Red Hat Enterprise Linux 5.x  wget && sudo rpm -Uvh epel-release-5*.rpm CentOS and Red Hat Enterprise Linux 6.x wget && sudo rpm -Uvh epel-release-6*.rpm CentOS and Red Hat Enterprise Linux 7.x  wget && sudo rpm Read More

PHP can not connect RDS MySQL on an Amazon EC2 RHEL box

So I decided to use Amazon RDS for my blog. It’s fairly simple to set up RDS, but somehow I couldn’t get PHP to connect to RDS. Wordpress kept throwing this error: “Error establishing a database connection”. So I thought maybe my RDS security group settings are not correct? I opened the RDS instance to and I was able to connect using mysql cli anywhere, including the RHEL box, but WP still gave me the same error. I then tried php mysql connection to RDS on another linux box and it worked! OK, so that means somehow php mysql connection is not working on the RHEL box, what can be causing the problem? After a few Google searches, one post drew my attention, Read More

Git – How to avoid typing your password repeatedly

There are at least three ways to avoid typing your password repeatedly when using git. First solution requires to use KDE wallet, second solution doesn’t require additional tools and third is not the safest one. First way – use KDE wallet To store passwords in the KDE wallet you need to install ksshaskpass package: $ sudo apt-get install ksshaskpass Then configure git to use it: $ git config –global core.askpass /usr/bin/ksshaskpass Alternatively you can use GIT_ASKPASS environmental variable: $ export GIT_ASKPASS=`which ksshaskpass` Use secure protocol: $ git clone –verbose https://[email protected]/git/personal_repo.git Second way – Read More

Set up SSH keys – avoid typing password every time

On the local machine, type the BOLD part. The non-bold part is what you might see as output or prompt. Step 1: % ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (~/.ssh/id_dsa): (just type return) Enter passphrase (empty for no passphrase): (just type return) Enter same passphrase again: (just type return) Your identification has been saved in ~/.ssh/id_dsa Your public key has been saved in ~/.ssh/ The key fingerprint is: Some really long string % Step 2: Then, paste the content of the local ~/.ssh/ file into the file ~/.ssh/authorized_keys on the remote host. RSA instead of DSA If you want something strong, you could Read More


解决办法: 1. 修改rTorrent配置文件,我的配置文件位置是在 /opt/etc/rtorrent.conf ,在最后一行加上一句: encoding_list = zh_CN.UTF-8 这个并没有解决我的问题,文件名依然乱码,后来查资料才发现需要改挂载参数。 2. 因为我是SAMBA挂载的NAS,在挂载的时候需要加一个参数iocharset=utf8: mount -t cifs // /tmp/ -o rw,iocharset=utf8,username=shawn,passwo rd=password 参考资料: Read More

PPTPD源码安装 Install PPTPD from source code

今天花了一晚上倒腾VPN服务器,因为是用的CENTOS,没法直接apt-get install pptpd,虽然网上有RPM包,但最后还是选择了源码安装,过程中碰到很多问题,在此总结一下: 1. make install后默认没有安装服务,需要自行创建/etc/rc.d/init.d/pptpd,写入代码如下: #!/bin/sh # # Startup script for pptpd # # chkconfig: 345 85 15 # description: PPTP server # processname: pptpd # config: /etc/pptpd.conf # Source function library. . /etc/rc.d/init.d/functions # See how we were called. case "$1" in start) echo -n "Starting pptpd: " if [ -f /var/lock/subsys/pptpd ] ; then echo exit 1 fi daemon Read More

ERST: Failed to get Error Log Address Range

Question I noticed X8 DP series motherboard showing “ERST: Failed to get Error Log Address Range” message during the RHEL/CentOS 6.2,6.3 version while booting. What is this problem related to? Answer For “ERST: Failed to get Error Log Address Range” this type of event message, you can do one of following items to get workaround. 1. Disable ACPI with command “acpi=off” in boot grub 2. Disable WHEA option from enable to disable in BIOS setup menu The reason is WHEA requesting ACPI 4.0 table support. Recently, X8 DP series do not support ACPI 4.0 feature (only ACPI 3.0). This is why you will see this warming message shown up during Read More


刚刚有客户反应网站无法打开,进服务器看了下,原来HTTPD死掉了,尝试service httpd restart但无法启动,检查/var/log/httpd/error.log后发现这个错误有很多条: [Thu Feb 14 11:04:02 2013] [error] (17)File exists: Cannot create SSLMutex with file `/var/log/httpd/ssl_mutex’ 于是rm -rf ssl_mutex,然后再尝试重启httpd,问题解决! Read More