Archive for 十月, 2014

预先安装autoconf 和 make yum -y install autoconf make jemalloc的安装 jiemalloc 开源项目网站 http://www.canonware.com/jemalloc/ wget http://www.canonware.com/download/jemalloc/jemalloc-3.6.0.tar.bz2 tar -xjf jemalloc-3.6.0.tar.bz2 cd jemalloc-3.6.0 ./configure --prefix=/usr/local/jemalloc --libdir=/usr/local/lib make && make install make clean cd ../ echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf /sbin/ldconfig 使用jemalloc优化MYSQL数据库 MYSQL或者MariaDB源码编译时添加以下参数: -DCMAKE_EXE_LINKER_FLAGS="-ljemalloc" -DWITH_SAFEMALLOC=OFF 或者编辑mysqld_safe文件直接加载: 查找文件 /usr/local/mysql/bin/mysqld_safe 在# executing mysqld_safe 下面加上 LD_PRELOAD=/usr/local/lib/libjemalloc.so 重新启动MYSQL 使用下面代码自动修改mysql ...

使用jQuery和css可以快速简单实现固定在页面顶端的导航区块效果,默认导航区块正常显示,当用户向下拖动滚动条时,导航区块会始终固定在页面顶端显示,保证用户一直能看到导航区块。 CSS代码: .sticky { position: fixed; width: 100%; left: 0; top: 0; z-index: 999; border-top: 0; } javascript代码: $(document).ready(function() { // grab the initial top offset of the navigation bar var stickyBarTop = $('.navbar').offset().top; // decides weather the navigation bar should have "fixed" css position or not. var stickyBar = function(){ // current vertical position from the top var scrollTop = $(window).scrollTop(); // if scrolled more than the navigation, change its position to fixed to stick to top, // otherwise chan ...