import RPi.GPIO as GPIO from time import sleep PIN18 = 12 PIN25 = 22 GPIO.setmode(GPIO.BOARD) GPIO.setup(PIN25, GPIO.IN) GPIO.setup(PIN18, GPIO.OUT) LEDON = False while 1: try: if GPIO.input(PIN25): if LEDON == True: print “– PIN25 ON” LEDON = False GPIO.output(PIN18, False) else: print “– PIN25 OFF” LEDON = True GPIO.output(PIN18, True) sleep(1) except KeyboardInterrupt: GPIO.cleanup()…
Month: November 2013
Magento – rules to fix catalog price rule price
ReferĀ http://www.pacificwebtechnology.com/blog/magento-rules-to-fix-catalog-price-rule-issue/ 1. Make pricerule.php in root folder <?php require_once ‘app/Mage.php’; // if your are not root folder then write the proper path like publichtml/magento/app/Mage.php Mage::app(‘default’); $catalogRule = Mage::getModel(‘catalogrule/rule’); $catalogRule->applyAll(); Mage::app()->removeCache(‘catalog_rules_dirty’); ?> 2. Make cron job 0 0 * * * php /home/~/public_html/pricerule.php