今天在 Linuxgem.org 上面发现一篇很有意思的文章,和大家分享。
{Via http://blog.upsuper.org.cn/what-to-do-if-linux-crash/}
Linux 会死机么?我可以很肯定地说,会!要让 Linux 死机很容易,但难的是在死机以后如何安全的让他摆脱死机状态,本文讲述如何从 Linux 的死机状态中挣脱出来。
Linux 死机有很多种情况,最常见的是系统负载过高导致的。如上次介绍的 fork 炸弹就是这个原理,此外还可以运行内存耗用极大的程序(如虚拟机),也会迅速提升系统负载。由于系统负载过高导致的卡死,一定是解决的越快越好!此时必须记住的是,不能再试图依赖任何图形… Read More
Remove crash report files
The apport system creates crash report files in the /var/crash directory. These crash report files cause the error message to appear everytime Ubuntu boots.
$ cd /var/crash
$ ls
_opt_google_chrome_chrome.1000.crash
_usr_lib_chromium-browser_chromium-browser.1000.crash
_usr_sbin_ulatencyd.0.crash
_usr_share_ap… Read More
I have worked in the template\catalog\product\list\toolbar.phtml where you can change the total toolbar design. But there have a function
<?php echo $this->getPagerHtml() ?>
it’s for the pagination. if you want to change pagination html then go to the template\page\html\pager.phtml and you can change it from here.
本文:Magent… Read More
I have found that it is very useful to be able to get attributes from the system and use them in places other than a products category page. I always forget the exact syntax to use so, this is going to be my unofficial cheat sheet.
This is how to get a drop down lists options.
1. Try adding this
$('input', '#submForm').each(function(){
$(this).val() == "" && $(this).remove();
})
OR
$('input:text[value=""]', '#submForm').remove();
before
var serialized = $('#submForm').serialize()
来源:http://stackoverflow.com/a/6240625
You cannot use attribute selector for value as it is a changing property.
2. Use .… Read More
Check out JSColor:
http://jscolor.com/
jscolor is a web color picker component that aims to be super easy both for developers to install and end users to use.
使用:
<script src="jscolor.js"></script>
Color: <input class="jscolor" value="ab2567">
本文:jQuery: jscolor – color picker… Read More
$_product_images = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages();
foreach($_product_images->getItems() as $_product_image) echo $_product_image->getUrl();
// or
foreach($_product_images->getItems() as $_product_image)
echo '<img src="'.Mage::helper('catal… Read More
I just wandering on how I can get the configuration data for my custom module. The configuration can be set from the admin system->configuration and how to pull it in frontend?
解决:
$configValue = Mage::getStoreConfig('sectionName/groupName/fieldName');
sectionName, groupName and fieldName are present in etc/system.xml file of your module.
The… Read More
方法一 : 使用友善的文件
EASY FIX:
Just replace Magento’s prototype.js file with this bootstrap friendly one:
https://raw.github.com/zikula/core/079df47e7c1f536a0d9eea2993ae19768e1f0554/src/javascript/ajax/original_uncompressed/prototype.js
You can see the changes made in the prototype.js file to fix the bootstrap issue here:
https://… Read More
$.browser has been removed from JQuery 1.9. You can to use Modernizr project instead http://jquery.com/upgrade-guide/1.9/#jquery-browser-removed
just put the $.browser code in your js
var matched, browser;
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec(