Magento ignores email-inline.css (Transactional Emails)

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)

I created a few custom emails and it didn’t work. The following code doesn’t work (it excludes the email-inline.css):

$mailTemplate->sendTransactional(
$templateID,
Mage::getStoreConfig(Mage_Customer_Model_Customer::XML_PATH_REGISTER_EMAIL_IDENTITY, $storeId),
$customer->getEmail(),
$customer->getName(),
array(
‘customer’ => $customer,
‘shipping’ => $customer->getPrimaryShippingAddress(),
‘billing’ => $customer->getPrimaryBillingAddress(),
‘store’ => Mage::app()->getStore(

$this->getCustomerStoreId($customer)
),
),
$storeId
);

___________________________________________________

This is the code that you want to use:

$storeId = $this->getCustomerStoreId($customer);
$templateID = Mage::getModel(‘core/email_template’)->loadByCode(‘your code’)->getId();

$mailer = Mage::getModel(‘core/email_template_mailer’);
$emailInfo = Mage::getModel(‘core/email_info’);
$emailInfo->addTo($customer->getEmail(), $customer->getName());
$mailer->addEmailInfo($emailInfo);

// Set all required params and send emails
$mailer->setSender(Mage::getStoreConfig(Mage_Customer_Model_Customer::XML_PATH_REGISTER_EMAIL_IDENTITY, $storeId));
$mailer->setStoreId($storeId);

$templateParams = array(
‘customer’ => $customer,
‘shipping’ => $customer->getPrimaryShippingAddress(),
‘billing’ => $customer->getPrimaryBillingAddress(),
‘store’ => Mage::app()->getStore(

$this->getCustomerStoreId($customer)
),
);
$mailer->setTemplateId($templateID);
$mailer->setTemplateParams($templateParams);
$mailer->send();

Posted in Magento, PHP | Leave a comment

XDebug not working Ubuntu PHP 5.6

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)

I faced the issue that Ubuntu with PHP 5.6 didn’t load xDebug.
I installed xDebug by entering:

sudo apt-get install php5-xdebug

First issue that I encountered was that the xdebug.ini was not added to apache.
Enter:

find / -name ‘xdebug.so’ 2> /dev/null

xdebug.ini:

[xdebug]
zend_extension = “/usr/lib/php5/20121212+lfs/xdebug.so”
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000

zend_extension = “/usr/lib/php5/20121212+lfs/xdebug.so” replace by the output of:

find / -name ‘xdebug.so’ 2> /dev/null

Place xdebug.ini in:

/etc/php/5.6/apache2/
/etc/php/5.6/mods-available/

You could also try:

php5enmod xdebug

Anyway it was not loading even if everything is ok.
So I researched further and found out why it’s not loading. In order to display why it’s not loading just add:

display_startup_errors = On

In your php.ini.

After that check /var/log/apache2/error_log:

Xdebug requires Zend Engine API version 220121212.
The Zend Engine API version 220131226 which is installed, is newer.
Contact Derick Rethans at http://xdebug.org/docs/faq#api for a later version of Xdebug.

So I guess we’ve to compile our own:

wget https://xdebug.org/files/xdebug-2.5.0.tgz
tar xfvz xdebug-2.5.0.tgz
cd xdebug-2.5.0
phpize

Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212

./configure
make

Libraries have been installed in:
/var/tmp/xdebug-2.5.0/modules

make install

Installing shared extensions:     /usr/lib/php5/20121212+lfs/

That didn’t work either. PHP version used by phpize is:
20121212 not 220131226

Uninstalled php5-dev and installed matching php5.6-dev:

sudo apt-get install php5.6-dev

Now looks good:

phpize

Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226

make clean
make
make install

Installing shared extensions:     /usr/lib/php/20131226/

adjust path in /etc/php/5.6/mods-available/xdebug.ini

and great, it’s finally working:
php -v
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans

FINALLY got it working 🙂

Posted in Linux, PHP | Leave a comment

phph

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)

Array

Posted in Allgemein | Leave a comment

Jail shell centos

VN:F [1.9.22_1171]
Rating: 9.7/10 (3 votes cast)

Install rssh and edit config:

1.) Secure root:
sudo yum install rssh

2.) Config RSSH
# /etc/rssh.conf
logfacility = LOG_USER

allowscp
#allowsftp
#allowcvs
#allowrdist
#allowrsync

Rssh user creation:
http://www.cyberciti.biz/tips/linux-unix-restrict-shell-access-with-rssh.html

3.) Create the sftp init script
Let’s call it /etc/init.d/sftpod. Just because. Make sure it is root owned, with octal mode 0755. Its contents follow.

#!/bin/bash
#
# chkconfig: 35 60 25
# description: OpenSSH chrooted sftp only daemon
#
# Note that /usr/sbin/sftpod is simply a symlink to /usr/sbin/sshd;
# You are going to need to CREATE that symlink before using this script.
#

pidfile=’/var/run/sftpod.pid’

case “${1}” in

start  ) exec -a /usr/sbin/sftpod /usr/sbin/sshd -f /etc/ssh/sftpod_config
;;
stop   ) kill -9 $(cat ${pidfile})
;;
restart) ${0} stop
sleep 3
${0} start
;;
*      ) echo “Usage: ${0} (start|stop|restart)”
;;

esac

exit 0

4.) Create the sftp config file

Let’s use the naming referred to in the init script, /etc/ssh/sftpod_config. Contents:

Port 9022
Protocol 2
AddressFamily inet

SyslogFacility AUTHPRIV
LogLevel INFO

PermitRootLogin no

RSAAuthentication no
PubkeyAuthentication no
RhostsRSAAuthentication no
HostbasedAuthentication no
PasswordAuthentication yes
PermitEmptyPasswords no
ChallengeResponseAuthentication no
KerberosAuthentication no
GSSAPIAuthentication no

UsePAM no

PidFile /var/run/sftpod.pid

ChrootDirectory /home/chrooted
Subsystem sftp internal-sftp

Notes:
1.)
/home/chrooted owner must be root with right permissions I guess it was 755 or 750 otherwise you’ll get a restriction error!

2.)
Lock user from regular ssh:
In /etc/ssh/sshd_config
DenyUser xyz

Posted in Linux | Leave a comment

Batch (.bat) copy paste commands

VN:F [1.9.22_1171]
Rating: 9.0/10 (1 vote cast)

Today we was working on compiling an application using Mingw MSYS.
After a few minutes we found out that you can’t copy paste a command by default. Searching the net didn’t help as well.

Finally we got an idea:
http://support.microsoft.com/kb/282301

It could be activated by opening the options menu by right clicking the window:
shellshell_2And that’s it 🙂 Now you could copy & paste in your shell / .bat 🙂
This instruction works with any bat file.
To show you thanks simply rate this post or give it a google +1. Thanks

Posted in C++ General | Leave a comment

Root access Buffalo Linkstation

VN:F [1.9.22_1171]
Rating: 9.0/10 (1 vote cast)

First of all you need a tool called “acp_commander”. It’s a small java commandline script. So you’re going to need java installed. You could simply check if you have it installed by entering “java” in your cmd.exe.

The following commands worked well with Buffalo Linkstation Pro (firmware 1.64) installed:

Execute them at your own risk!

exchange 192.168.0.104 into the ip of your linkstation,
exchange “password” into the password that you use for the web interface
exchange “newpasswd” into the password that you like to use

java -jar acp_commander.jar -t 192.168.0.104 -ip 192.168.0.104 -pw password -c “(echo newpasswd;echo newpasswd)|passwd”

java -jar acp_commander.jar -t 192.168.0.104 -ip 192.168.0.104 -pw password -c “sed -i ‘s/UsePAM yes/UsePAM no/g’ /etc/sshd_config”

java -jar acp_commander.jar -t 192.168.0.104 -ip 192.168.0.104 -pw password -c “sed -i ‘s/PermitRootLogin no/PermitRootLogin yes/g’ /etc/sshd_config”

java -jar acp_commander.jar -t 192.168.0.104 -ip 192.168.0.104 -pw password -c “/etc/init.d/sshd.sh restart”

After that the Linkstation was able to be accessed by putty (root:newpasswd).

 

Posted in Personal | Leave a comment

Buffalo Linkstation change language

VN:F [1.9.22_1171]
Rating: 9.5/10 (2 votes cast)

The default language of buffalo NAS is Japanese to change it follow these steps:



Don’t forget to rate his post!

Posted in Allgemein | Leave a comment

Linkstation duo red light

VN:F [1.9.22_1171]
Rating: 9.7/10 (3 votes cast)

If you’re in a hurry scroll down to “how I fixed it“.

Today we revived two hard drives that we ordered for using our “Buffalo Linkstation Duo“.
After building them in and following the instructions it didn’t work. What happened actually was that a red light appeared at function.

The Linkstation takes a few minutes to start up. You could see it by looking at the leds. When it starts the blue light blinks. After it’s done starting the light turn blue permanently.

At that point holding the function button doesn’t install the firmware in any way. Inserting the CD and trying to install it will lead into “setup could not be completed” but you could run the software and see the output. In my case I a note that the Linkstation is in EM-Mode.

Ok enough storry telling now let me tell you how I fixed it:

Make sure that you know what you’re doing. You’re responsible. Unplugging the power cable at the wrong time may cause a bad state of your firmware which require some effort to fix.

1.) Download the windows firmware update tool from buffalo:
http://www.buffalo-technology.com/en/ls-wxl-linkstation-duo-downloads.html

2.) Make some modifications in the LSUpdater.ini:
add this at the bottom:

[Flags]
VersionCheck = 0
NoFormatting = 1

[SpecialFlags]
Debug=1

3.) Open it and access the options menu by clicking the icon:
4.) Open Debug and check the following boxes:
5.) Wait and don’t unplug the power!
In my case it took about 15 minutes. The info/error led blinks orange while the flashing is in progress.

6.) Result:
7.) Give this post a 10 star rating!!!

Hope this is helpful and what you’re looking for.

Default login details:
Username: admin
Password: password

Posted in Personal | Leave a comment

How I fixed my S1200BTL / Amber blink or on / Screen or graphic problem / BMC fix

VN:F [1.9.22_1171]
Rating: 9.5/10 (2 votes cast)

Before you start reading my story and doing it by your own you should really know what you’re doing. I’ll take no warranty if you damage your hardware!

I had a lot of issues with one of my home servers. In fact I was thinking of shipping it back. But finally after spending some time reading manuals I fixed it:

1.) My main issue was that I get “84F2 Baseboard Management Controller failed to respond”. The server sometimes took about 5-8 minutes before I get any screen output. (At that state four green LED’s are on / two in the up and two in the down).

2.) Aside from that I had some serious issues with the onboard video. Sometimes the output started “strange”. Sometimes stripes appeared then letters disappeared or switched to a total unreadable state which didn’t switch to readable again. So I thought that the problem must be the onboard graphic chip.

3.) Adding to that one status LED blink amber or sometimes stays on amber.

I took care of number 2 the easy way. I went to the malls and bought a PCIe graphics card and build it into my system. That worked well now my screen was readable all the time.

Then I started to read the intel manual (G13326-003_S1200BT_TPS_v1_0.pdf) in detail to take care of issue 1 and 3. I put the name of the PDF in there because there’re a lot of pdf’s that wouldn’t help in that case. E.g. the “Quickstart” provided by intel wouldn’t help you at all with that,…

I found out that the amber light + graphic output are connected in some way. They both come from the BMC chip. The BMC also regulates the FAN speed so if you’ve fans that spin at maximum speed it might also be fixed with my solution.

So I started taking a look at the jumpers and found:
J1E2: CMOS Clear
J1F2: ME Force Update
J1F1: Password Clear
J1F3: BIOS Recovery
J4A2: BMC Force Update

First of all I did a CMOS clear to be sure that my settings didn’t cause any of my issues.
Refer to the intel manual how to do it.

Then I set J4A2 and flashed my system with the newest firmeware by using a usb stick.
When you flash it you’ll be asked about your FAN settings and if you’ve several features. You should all answer it correctly otherwise the status LED will blink amber or stay on.
Aside from that be informed that CPU FAN & SYSFAN 4 must be installed.

After doing the restart my system seems to pass the 84F2 problem but the amber light stays blinking so I decided to use SELVIEWER

To use SELVIEWER you should download DOS SELVIEWER + make a bootable usbstick:

Make sure you’re working as administator and assume X: is the usb sticks drive letter
Delete all partitions on your stick
Create one primary partition and mark it as active
Format that partition using FAT32
syslinux\syslinux.exe -fma X:
xcopy usb-root\* X:\ /E/H/I
create a new folder and copy SELViewer.exe + needed SEL files in it
Reboot
press [Enter] at syslinux boot: prompt
double press [Enter] while your asked to change date and time
then navigate to your SELViewer folder and start selviewer
your done! have fun!
bootstick.zip

Thanks to:
http://goebelmeier.de/bootstick/
for providing the Freedos Image.

Finally I had SELVIEWER running and could check why the amber light is on.
I could see something like:

“FAN x32 getting lower”
“FAN x32 getting critical”
I don’t remember the exact term but was something like.
I removed some fans to find out which fas in x32,… The strange thing with it is that FAN x32 spined proper. Anyway I replaced him and that fixed the last issue.

Now I’ve a very fine system running without issues 🙂
Hope this post it helpful for someone else.

Have a nice day, thanks for reading!

Posted in Personal | Tagged , , , , , , , , | Leave a comment

In honor Kim DotCom Megaupload / Megavideo

VN:F [1.9.22_1171]
Rating: 8.5/10 (2 votes cast)

A few days I was trying to watch some videos hosted at Megavideo the video didn’t load. I just thought it’s another issue of my provider. But then the next day I read in the news that Kim DotCom was arrested and the websites has been suspended by the FBI. That’s a sad week. One of the world’s biggest websites for online streaming and file-sharing is down.

It’s the next big strike against online streams after “kino.to” a website for online streams. In case of kino.to it went well. After a week a new website called kinox.to appeared. Sure for some people the story of kino.to didn’t go well they got arrested and have a pending case.

In case of Kim DotCom it’ll be taking a very long time and it isn’t said that he’s really responsible for this but the music industry reached their target already. As I see it for them it doesn’t matter how the case ends. There target was to stop those sites even if just for a limited time.

I’ll be keeping an eye on it and being excited to know what will be the outcome. To honor the services of Megaupload / Megavideo I’ve embedded the MegaUpload song:

For the people who don’t know Kim. The corpulent man with the headset is him.

corpulent

Posted in Personal | Leave a comment