Wednesday, January 30, 2013

How to add new link in menu to new CMS page created in magento

Magento 1.5x cheatsheet series
So, you created new link in your fresh magento installation. Maybe you wrote simple FAQ or billing and shipping information for your customers. And now there is no tool to create link to your newly written masterpiece. As far as my research took me, there actually is no such tool built into magento. Little bit of coding on other hand, can solve this problem quickly.
All you have to do is edit file top.phtml.
If you edit built in theme of magento, then location of file is: /app/design/frontend/base/default/template/catalog/navigation
if you work on your own theme, then file should be in folder:

Once you open file for edit, you should locate code
 <div class="nav-container">     
  <ul id="nav">      
  <?php echo $_menu ?>  
   you add code of your new menu object here  
And code to add is:
 <a href="<?php echo $this->geturl('about-magento-demo-store') ?>">   
 <?php echo $this->__('About Us')?></a>   
Where 'CMS PAGE IDENTIFIER' is to be changed out with your page identifier. Page identifier in CMS is URL Key, for instance About Us is 'about-magento-demo-store'.
So full code of menu with one object which would connect to CMS page "about us" would be:

  <div class="nav-container">     
  <ul id="nav">     
   <?php echo $_menu ?>   
   <a href="<?php echo $this->geturl('about-magento-demo-store') ?>">   
   <?php echo $this->__('About Us')?></a>   

Thursday, January 17, 2013

Kona Sutra bicycle

One of my passions is also cycling, especially touring and bicycle travel. So from time to time I might also write a word or two about my cycling adventures or gear or other things related to cycling.

Ready for adventure
I love cycling. I learned to ride bicycle when I was about 4 years old and never stopped till now. I evolved over BMX to Mountain Bikes and never fancied racing cycles. I was used to go over stairs, over curbs, over roots etc. And never stop or step off bicycle. So naturally I saw thin tires as a big problem. I know that you can ride faster on thin tires, but I was willing to lose some energy through tires for comfort of going over obstacles (easier or at all).

Touring by Danube river - Donauradweg
But one of my big loves is touring and for last 12 years I was doing it on a Steppenwolf Timber bicycle. I still love this bike, since it survived a lot and never let me down. Alhtough lately there is some serious problem with LX shifters which still waits for solution.
Anyways, last time I went for a longer ride my neck hurt like hell and after few days, I hardly moved my head.  You can imagine that that was a big problem,especially when riding on car roads.
Since then I was looking to replace bicycle for more comfortable one. My first tought was trekking bicycle. But somehow I did not find one that I would really fall in love with. So I continued to ride my truthful wolf. Then I came over Trek 520 which seemed nice machine. But problem was that such bike is not in stock in our country and I just could not order it “blindly”. So I put my dream about touring bicycle aside for some time. But then I stroke gold - our Kona distributor had last year (2011) Sutra in stock and for quiet nice price. So, I had to go and take a look. After checking it out and trying it out little bit, I had to “sleep it over”. But Sutra put a hook in me instantly. So few days later I called to a shop and ordered flat pedals (did I mention that I do not like SPDs?) and next day english green Kona sutra became my preciousss.

First of all please keep in mind that till recently I was die hard mountain bike rider and some of my comments might be funny to you.

So my first responses:
  • very comfortable
  • on asphalt way faster than my wolf (wolf had Ritchey Speedmax 2.1 tires) - I can travel same distance with less effort and faster. But Timber does accelerate faster, since it is lighter and has smaller wheels. Not to mention more agressive position. Especially since I put it on Schwalbe 1.5 marathon plus tires.
  • hmmm, where is front suspension? I feel road holes I never noticed before
  • I expected disc brakes to be more efficient - guess more breaking in is needed (my wolf has LX cantilever brakes)
  • hmmm, should I carry bike over these steps? (sure I did)
  • I am still not 100% sure about handlebar - on one hand it offers many positions which means more comfort, BUT (yeah that but again) in my favourite position brake handles are not under the tips of my fingers, as I was used on mountain bike
  • shifters on the end of handlebar are different but to me it is not a problem, since I don’t shift gears that much
  • weight - bike is quite heavy - approx. 15 kgs if I am not mistaken. But it does not feel as heavy bike once on a road, especially because I do not jump with it or do any other crazy stuff I am used to do with mountain bike
Handling on macadam - you can drive it on macadam. For now I am very cautious, since I am not so used to handlebar and it “floats” way easier than my mountain bike with wider tires.
So far I am really happy with my choice and have serious suspicion that mountain bike will be used for shorter outings and harsher terrain. But my main touring bike will be definitely Kona Sutra.

Above was written shortly after I purchased Sutra. After first few thousand kilometers I have more comments for anyone interested:
I actually really love handlebar. It might not allow so fast responses as MTB handlebar, but it offers various handling positions which helps tremendously on longer tours.

hanling on macadam - since ,my writing and many kilometers I feel quiet sure on macadam. As long it is not too bumpy it is completely fine.
Disc brakes are really nice once you get used to it.
Regarding Sutra, I think it is really good bicycle and will probably serve me for a long time.

Monday, November 26, 2012

DIY simple NAS on budget

Please note, that this is not intended as detailed plan how to do NAS.  But you might find useful idea or two when reading my rant.


OK, I admit - it happened to me also. WD Passport which was used as external drive, started to die. Seems it was slow and painful death, since at first it became terribily slow and it took ages for it to be available in operating system. For all, that are not familiar with WD Passport, it is external HDD that connects to computer trough USB. Thing was just out of warranty. After I opened it, there was WD green 1TB HDD in there. I hoped that controller could be used with another hard drive, but it seems that is not so simple for my specific model. I am not completely certain why, since I did not have much time to investigate this further. But I suspect, that there is "special" partition on HDD that make possible to use controller with HDD. So new HDD without this partition won't work with USB controller.
Anyway, as soon as problems were evident, I connected this drive to computer running Fedora operating system and right away OS informed me that S.M.A.R.T. status of device looks bad. Microsoft: why don't you add this functionality in a Windows operating system? I think it would save user or two a lot of time.
Anyway, what is done is done. Next step was copying everything from faulty HDD to another one in order to save data. It took about 3 weeks of day to day copying to save few 100 GB of data, but in the end, everything important is saved! YES!

OK, since this was sort of lesson to me, I decided to get myself NAS to use it as backup for important data. After further price checking and check of computer parts "inventory" at home I decided to built NAS by myself. And that is also good opportunity to defend my collecting of old computer parts at home! ;-)
Also, since data safety is most important I went for mirroring of 2 drives in my NAS.

So, what I had at home?

  • 2GBs of RAM
  • Athlon 64 X2 5000+
  • mini ITX motherboard IEI Kino-690AM2
What I needed?
  • Hard drives
  • system drive
  • power supply
  • chassis
After little investigation I decided to go with WD RED HDDs, which were developed especially for NAS and RAID.
For system I have chosen 4GB USB thumb drive.
Power supply I have chosen FLEX ATX from Seasonic - model SS-250SU.
So, once I had all hardware, I started to think about chassis. Since this was budget project I wanted to spend as little as possible. So in the end I decided to built extremely simple chassis by myself.

Top view - you can see part of HDD cage here
I  used 3mm sandwich panel, known also as  aluminium composite plate. This was lying around and material is very easy to work with and it is strong enough for what I used it for. I simpy cut two panels and screwed motherboard and power supply on one panel. For HDDs I took HDD cage from old computer chassis I had lying around. I had to cut it little bit, but in the end it does its job very good. Both panels are joined together with long screws and I made spacers from alu tube.

Connections view - you can see tiny USB drive

I admit that my computer parts are not most power saving and definitely I would chose passively cooled motherboard if I would buy components. But since this is primarily meant as backup storage it does not run all the time. I just turn it on when I need it. Because it is capable of WOL, I can put it in remote location in apartment and as long as there is network connection and power, it will work. So it is not silent and it its power consumption is not greatest. On the other hand it was cheapest solution for me, since I had few components at hand already and I was able to built chassis for peanuts. Good news is also, that motherboard has dual Gb LAN ports, so if I upgrade home network, everything will work faster.
Regarding NAS software, I used FreeNAS. It is quiet easy to set up, even for first time user, as myself. Interesting thing was, that altough I set RAID in BIOS, FreeNAS found 2 hard drives and I had to set both drives as Mirror in FreeNAS settings. I also had some minor problems with user rights, but managed to solve them quickly.
So far I am happy with my solution and hope it will work longer and more reliably as WD passport HDD.

Spacer can be also used as handle to carry NAS.

Wednesday, July 18, 2012

CPU hunger or how I met Mr. Wordpress

One of my hobbies is also web page design and developement. I also like idea of open source, so I tend to use joomla as my main web page platform. But sure, there are instances, when some other solutions are more suited to users.
So, lately,  customer had need for more "blogging" approach to a web page. So, I decided to give a try to a Wordpress. Installation was super easy. Administrator section is straight forward and really "click'n play". So, I created nice theme, choose needed plugins and we were up and running in no time! Users found adding articles very easy, translation in our language was available from a start. I created nice simple tutorial for users and tought this is done deal!
Man, was I wrong.
After a few months, I got mail from hosting company that CPU usage is too high for this page and they limited CPU usage. So, we had a lot of "page non available" problems etc.
So, research started.
First thing I noticed is, that customer added a lot of galleries on a front page and it seems that plugin I chose made a mess of CPU. So, firstly I removed plugin. Actually I could not do it trough administrator console, since page was not acessible. I simply removed folder with plugin trough FTP. Wordpress is "smart" enough that it notice plugin folder missing and does not make any fuss of it. So, at least this is good. And that is also one hint for all you avid readers.
Anyway, after deletion of plugin, page was at least acessible again and CPU usage went down little bit. Next thing I learned is, that wordpress comes with absolutely no caching or any web page optimization. So I installed additional plugin which take care of optimization. And I replaced galllery plugin with another one, which seems to do fine.

So, what to write in conclusion?
On one hand it seems Wordpress could use some code optimization and they should built some sort of caching in it. But on the other hand it is extremly user friendly. Which is big +.
Use with caution.

Wednesday, November 30, 2011

Motherboard P5LP-LE in HP and Compaq

In past I was big supporter of HP products, especially computer systems. But in last year I lost my trust in their products. Firstly, my home workstation from HP started to malfunction. It was high class product - i7 920 with 1TB HDD and 8 GBs of RAM. It was really nice computer which offered a lot of bang for a buck. Unfortunatelly I write in a past tense - one day I started to get BSODs in Win7. After some further research I found that is known problem with i7 processors. A lot of users managed to solve such errors with settings of voltage for processor. But HPs motherboard did not have such options in BIOS. Also, it was just little bit out of warranty, so no luck for me. To make story short - I threw that junk into a dumpster and got myself proper components and built my machine from scratch. And I intend to do that in afuture, becouse of things like that.
Anyway, back to newest findings, that some other might benefit. P5LP-LE motherboard. I know it is old machine, but at work I have Compaq machine that has this MOBO built into. Lately I was working on some processor intensive software and I got green light to upgrade computer as much as possible. Surely, I quickly found web page with listed specifications for this M/B.
Processor upgrade information state:
Core 2 Duo E6x00
Core 2 Duo E4x00
Pentium D 9x0 Dual Core
Pentium D 8xx Dual Core
Pentium 4 6x1 series
Celeron D 3xx series

So, I simply checked on-line stores and surely quickly found processor.
I was thrilled, since it is 3.2 GHz processor vs current E4300 1.8 GHz processor. I was eagerly waiting delivery of CPU and as soon as time ermited I built new CPU in a machine. I connected all together and ... NOTHING. Black screen, vents were spinning, thats all. Ok, I figured I should update BIOS to get support for a new CPU. After searching I found my Compaq computer on HP support page. After I choose my OS (Win XP) I did not get any BIOS upgrade to download. I remembered that computer came with preset vista OS, so I choose this one, and sure enough there was BIOS update available. I downloaded exe file and use RAR to extract its content to a folder. There was *.ROM file that is actual BIOS code and program Winflash. With Winflash I simply updated BIOS from my WinXP OS, which is not supported?
Anyway, everything went smoothly and I again built my new CPU in a machine. But still, computer was not working.
So, back to research and internet forums...
And, conclusion is - Intel made two E6700s processors. The one, that would function with P5LP-LE M/B has 4MB cach, 2,66 GHz and was introduced in 2006. It was made in 65nm technology and has code name Conroe. The one I got was introduced in 2008, is made in 45nm and has code name Wolfdale.
So, if only HP would state on its support site, that processor must be Conroe, or if Intel would employ person to think of new model names...
Well, I would not loose my precious time over nothing and you would not read this...

Friday, February 22, 2008

Setting Raid on HP Pavilion a6115 Desktop PC win XP

Recently friend of mine purchased computer HP Pavilion a6115. This was his enter into dual core processing world, since his last machine was quiet old. He also decided to use 2 500 GB HDD in RAID 1 array.

He got nice and shiny hp box. He soon realized, that Vista OS is just not what he hoped for, so he opted for more familiar and faster Windows XP System. It turned out, that HP does not support XP out of the box, so we had to do it other way. Even Motherboard mentioned as Asus P5LP-LE was not found on Asus web page.
So few trials and errors were needed to sucessfully set RAID and install Win XP.
Well let's start from beginning...

Strangely, but that's how things work even today, for setting windows on RAID array you should use Floppy with dedicated drivers.
Pavilion does not have such drive, which is not surprising... Second thing as mentioned before, XP drivers are not directly available from HP support pages.

But, after going trough computer specification:, it is clear that you need to use Intel drivers for Onboard RAID controller: ICH7-DH - 945G chipset. In order to install win xp to RAID array, you have to get 32-bit Floppy Configuration Utility for Intel® Matrix Storage Manager. Download available here This program from Intel creates floppy with drivers to install during win xp installation (F6 option). But since there is no floppy available, I will show you little trick...
First of all you need software that will emulate floppy drive:
After running and setting this program, you should see Floppy drive icon in Windows XP under My Computer.
When "floppy drive" is available, run Intel floppy configuration utility. It will automatically create all files etc.
After this is done, next step is to add these drivers into installation CD for WIn XP. (Remember, we don't have Floppy drive nor Floppy available :-)
One of the easiest ways to add drivers to installation disc is to use program nLite.
This is very powerful tool to manage WinXP installation cd - you can add various data, remove unnecessary software etc.
To proceed, Win XP installation disc is needed. Please check for detailed information how to integrate drivers into installation. When finished, you must create new Bootable ISO image and burn it on blank CD-R.
You can now install windows XP on Pavillion a6115 with RAID enabled.

All software used is freely available from WWW, except Win XP.

Good luck!