Solution: Install Chinese font in the server
yum install wqy-unibit-fonts.noarch wqy-zenhei-fonts.noarch -y
Category: Uncategorized
Bypass ERR_CERT_INVALID in Chrome
Open Advanced and press the “proceed to website” button.
If there is no “proceed to website” button, type “thisisunsafe” on chrome.
Change severity list in Mantis
Add the below line into config_inc.php to change the options in the severity list.
$g_severity_enum_string = ’10:feature,30:text,40:tweak,50:minor,60:major,70:crash,80:block’;
Or remove the severity field completely by adding the below array into config_inc.php.
$g_bug_report_page_fields = array(
‘additional_info’,
‘attachments’,
‘category_id’,
‘due_date’,
‘handler’,
‘os’,
‘os_version’,
‘platform’,
‘priority’,
‘product_build’,
‘product_version’,
‘reproducibility’,
// ‘severity’,
‘steps_to_reproduce’,
‘tags’,
‘target_version’,
‘view_state’,
);
Refer to the config_defaults_inc.php file for the details.
Reference:
https://mantisbt.org/forums/viewtopic.php?t=1193
Install Phantom on CentOS
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar xvf phantomjs-2.1.1-linux-x86_64.tar.bz2
sudo cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin
Reference:
http://sameerhalai.com/blog/how-to-install-phantomjs-on-a-centos-server/
Install Composer on OS X
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/
vim ~/.bash_profile
alias composer=”php /usr/local/bin/composer.phar”
Reference: https://www.abeautifulsite.net/installing-composer-on-os-x
CentOS-5 is now past EOL
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
vim /etc/yum.repos.d/CentOS-Base.repo
Comment out the mirrorlist directives. In each enabled section add baseurl=http://vault.centos.org/5.11/os/$basearch, baseurl=http://vault.centos.org/5.11/updates/$basearch, etc.
Reference: https://unix.stackexchange.com/questions/359902/yum-update-error-on-centos-5-6
Find Public IP
curl ident.me
Add HTTP2 Support to cURL
Install nghttp2
yum -y groupinstall “Development Tools”
yum -y install libev libev-devel zlib zlib-devel openssl openssl-devel git
cd /var/tmp
git clone https://github.com/tatsuhiro-t/nghttp2.git
cd nghttp2
autoreconf -i
automake
autoconf
./configure
make
make install
Set library search path
echo ‘/usr/local/lib’ > /etc/ld.so.conf.d/custom-libs.conf
ldconfig
ldconfig -p| grep libnghttp2
Install cURL
cd /var/tmp
git clone https://github.com/bagder/curl.git
cd curl
./buildconf
./configure –with-nghttp2=/usr/local
make
make install
Check cURL Feature
./src/curl -V
Check HTTP/2 response
./src/curl –http2 -v
Reference:
http://takeshiyako.blogspot.hk/2015/09/curl-http2.html
https://serversforhackers.com/video/curl-with-http2-support
Limit Access Log Size
vim /etc/logrotate.d/httpd
/var/www/vhosts/xxx/logs/*.log /var/www/vhosts/yyy/logs/*.log { ... }
Bootstrap Validator with Multiple Checkboxes
Workaround:
// Checkbox validation $form.on('validate.bs.validator', function(e) { $(this).find('input[type=checkbox]').each(function() { validate_checkbox($(this).attr('name')); }); }); $('.form-group').on('click','input:checkbox',function(){ validate_checkbox($(this).attr('name')); }); function validate_checkbox(name) { if ($('input[name="' + name + '"]:checked').length < 1){ $('input[name="' + name + '"]').prop('required', true); } else { $('input[name="' + name + '"]').prop('required', false); } }
Reference:
https://github.com/1000hz/bootstrap-validator/issues/201
(Comments from rikbamo on Aug 31 2016)