Magento snippets
- Read more about Magento snippets
- Log in to post comments
# clear cache
foreach ( Mage::helper( 'core' )->getCacheTypes() as $type => $label ) {
echo $label .
# clear cache
foreach ( Mage::helper( 'core' )->getCacheTypes() as $type => $label ) {
echo $label .
cat < /etc/cron.d/magento_cron
MAILTO=YOUR@EMAIL.COM
*/5 * * * * root /var/www/cron.sh
EOF
chmod u+x /var/www/cron.sh
Links
http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/how_to_setup_a_cron_job
If not already purchased, then DON´T buy this crappy Epson B-300 / B-308 / B-310 / B-500 / B-508 / B-510 printer. The printer are very short-lived. After about 1-2 years and ~10,000 pages unusable, paper jam, ink leaking, complete damage... The same problems occurred by FOUR! Business Inkjet printers. I have expected a little bit more from a "business printer" in the € 500 price range. Shame on you Epson!
Automatic installation script
<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/hardware/install.epson-business-inkjet.sh";
echo "wget $URL -O - | bash -";
echo "
"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $URL); $result = curl_exec($ch); curl_close($ch); htmlspecialchars($result); echo "
";
?>
create printer
sudo lpadmin -p Epson_B-310DN -v socket://192.168.1.14:2501 -E -P /usr/share/cups/model/ekpxb310.ppd
sudo lpadmin -p EpsonColorOben -v lpd://YOUR_PRINTER_IP:515/PASSTHRU -E -P /usr/share/cups/model/ekb500dn.ppd -o DefaultInputSlot=Front
sudo lpadmin -p ZertifikateOben -v lpd://192.168.1.13:515/PASSTHRU -E -P /usr/share/cups/model/ekb500dn.ppd -o MediaType=EPHOTOGLOSSY -o PrintQuality=BestPhoto -o InputSlot=Rear -o PageSize=A5 -o PageRegion=A5 -o ImageableArea=A5 -o PaperDimension=A5 -o OutputPaper=A5
# create DIN A5 printer
wget http://dl.dropbox.com/u/4170695/ppd/Epson-B-500DN-A5.ppd -P /tmp
lpadmin -p Zertifikate -v socket://EpsonColor:9100 -E -P /tmp/Epson_B-500DN_A5.ppd
Commercial alternative TurboPrint
wget http://www.turboprint.info/tp2/turboprint_2.23-1_amd64.deb -P /tmp
sudo dpkg -i /tmp/turboprint_2.23-1_amd64.deb
HowTo convert image to AdobeRGB1998.icc
http://www.panticz.de/Adobe_ICC_Profiles
Links
http://download.ebz.epson.net/dsc/search/01/search/searchModuleFromResult
http://avasys.jp/eng/linux_driver/
http://linux.avasys.jp/customerservice/pips3x_ubuntu804_e.html
http://dl.dropbox.com/u/4170695/ppd/Epson-B-500DN-A5.ppd - PPD DIN A5 only
http://dl.dropbox.com/u/4170695/ppd/Epson-B-500DN.ppd - PPD
<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.proftpd.sh";
echo "wget $URL -O - | bash -";
echo "
"; $c = curl_init(); curl_setopt($c, CURLOPT_URL, $URL); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); echo htmlspecialchars(curl_exec($c)); curl_close($c); echo "
";
?>
Create new ftp user
adduser ftp_user_1 -shell /bin/false -home /var/www/ftp_user_1/
# add ftp user to grup
adduser ftp_user_1 ftpuser
# clear user dir
rm /var/www/ftp_user_1/.*
Links
http://www.thomas-krenn.com/de/wiki/FTP-Server_unter_Debian_einrichten
http://www.debian-administration.org/article/228/Setting_up_an_FTP_server_on_Debian
<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.postfix.sh";
echo "wget $URL -O - | bash -";
echo "
"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $URL); $result = curl_exec($ch); curl_close($ch); htmlspecialchars($result); echo "
";
?>
Links
http://www.gtkdb.de/index_33_727.html - SMTP Relay HowTo
<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.dovecot.sh";
echo "wget $URL -O - | bash -";
echo "
"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $URL); $result = curl_exec($ch); curl_close($ch); htmlspecialchars($result); echo "
";
?>
/etc/dovecot/conf.d/10-master.conf
inet_listener imaps {
port = 993
ssl = yes
}
openssl req -new -x509 -nodes -out /etc/dovecot/dovecot.pem -keyout /etc/dovecot/private/dovecot.pem -days 1095 -newkey rsa:4096
Links
http://wiki2.dovecot.org/SSL/DovecotConfiguration
http://wiki2.dovecot.org/SSL/CertificateCreation
http://ebalaskas.gr/wiki/dovecot/DovecotSSL
http://wiki.ubuntuusers.de/Dovecot
https://help.ubuntu.com/11.04/serverguide/C/dovecot-server.html
http://wiki.dovecot.org/MainConfig
http://www.howtoforge.com/dovecot_mail_server_sieve_virtual_users
<?php
$URL="https://raw.githubusercontent.com/panticz/magento/master/scripts/delete_unused_images.sh";
echo "
"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $URL); $result = curl_exec($ch); curl_close($ch); htmlspecialchars($result); echo "
";
?>
Links
http://www.magentocommerce.com/magento-connect/defcon2/extension/1147/image-clean/reviews#review_6087
http://stackoverflow.com/questions/4339699/delete-unused-product-images-in-magento
Show (full) description on the product list page
# enable description attribute in product listing
admin > Catalod->Attributes-> Manage Attributes
description attribute
Set "Used in product listing" to "Yes"
Save
# edit tamplate
./app/design/frontend/default/default/template/catalog/product/list.phtml
<?php echo nl2br($this->htmlEscape($_product->getShortDescription())) ?>
<?php echo nl2br($this->htmlEscape($_product->getDescription())) ?>
# Link
http://marius-strajeru.blogspot.com/2009/11/show-description-in-product-list-page.html
Install stable version
<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.xbmc.sh";
echo "wget $URL -O - | bash -";
echo "
"; $c = curl_init(); curl_setopt($c, CURLOPT_URL, $URL); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); echo htmlspecialchars(curl_exec($c)); curl_close($c); echo "
";
?>
install unstable version
wget http://installit.googlecode.com/hg/install.xbmc.sh -O /tmp/install.xbmc.sh
bash /tmp/install.xbmc.sh -u
Unofficial PVR repository
sudo add-apt-repository ppa:lars-opdenkamp/xbmc-pvr
XBMC standalone
sudo apt-get install -y xbmc xbmc-standalone
Configuring a Wii Remote
http://www.mini-itx.com/projects/xbmc-ion/module/6
Nero Download
http://www.nero.com/enu/downloads-linux4-trial.php
<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.nero.sh";
echo "wget $URL -O - | bash -";
echo "
"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $URL); $result = curl_exec($ch); curl_close($ch); htmlspecialchars($result); echo "
";
?>
Extract Nero DOS bootimage
mkdir /tmp/nero
dpkg -x /tmp/nerolinux-x86_64.deb /tmp/nero
ls -l /tmp/nero/usr/share/nero/DosBootImage.ima