Monthly Archives: September 2008

Building cake application (Part II)

Tuesday (day 2)

I really hate to start working early in the morning. I’ve always trying to delay this step by reading some news, checking mails, etc. But job need to be done and I had to go downtown, so I’ve started early today.

Building external user interface
I’ve started with the external user interface, incl. login, logout, change passwords, I’ve also decided to move fields Name and E-mail from this page to the profile page etc. Most of the things went quite well, but there were some “problems” with autoRedirect var in the Auth component. Well they weren’t real problems, but wrong redirects while the user switch from profile to another /i.e. admin to regular user/. To avoid this I’ve decided to set that variable to false, and the login redirect will be fixed to a landing page. Anyway, the application is not so big and keeping the last place is not very critical. πŸ™‚
Continue reading

Building cake application (Part I)

Monday (day 1)

In that post these posts I am going to describe my working process and problems which I’ve met during the development of small CakePHP application. I am not going to go in details neither I will post any code snippets. It will be something like diary of the working process. So, let’s start.

The scope
It’s an Experts database with 2 parts:

  • External part – where all users could register and fill their resumes and field of qualifications
  • Administration part – administrators could provide the search in the resumes and mainly in the field of knowledge.

Continue reading

UPS shutdown script

No, this is not CakePHP code snippet! πŸ™‚

So, I had experience with an UPS Inform GUARD Standby SERIES 1500AP recently. It took me a while to understand that this is not the right model for the server ups solution, but anyway, this give me opportunity to understand something for this part of the hardware which I haven’t had change to touch.

The whole problem is that this ups doesn’t have Auto restart functionality, so if the power is down I can shutdown it, but on the power-on it doesn’t start up automatically, so the next power crash the server is doomed.

According with this I couldn’t manage to find single package which could work properly with this UPS. The nut package clam to support it, but in fact the driver recommended as working was not working at all.

Finally I managed to get signals from the ups with powstatd which is quite low level software. Ok, there are some additional files, but they cannot work with the upstart in Ubuntu. What I managed to get from it was status change in a file with following states: OK, FAIL and LOW.

So, in order to turn these states in actions I just wrote a small bash script, which doing different things on each state change.
Continue reading

Postfix – SMTP – PAM – MYSQL Server Troubles

Hey guys,

I had few days fight with a mail server. I am trying to configure my dedicated server and mail server is an important part in this setup. It was hard, because I am not SysAdmin and I didn’t have any clue at all.

Anyway finally I managed and I am very proud with this installation.
I am not going to describe the whole process, because there are many how-tos. These are the articles which I followed during the install:

http://flurdy.com/docs/postfix/ – this one I followed
https://help.ubuntu.com/community/Postfix
http://postfix.wiki.xs4all.nl/index.php?title=Virtual_Users_and_Domains_with_Courier-IMAP_and_MySQL

Everything was fine except that I couldn’t send mails through authenticated smtp. πŸ™

Following these articles the problem wasn’t sorted and I start digging over the net about the solution.

The error in the SquirrelMail was:
Authentication failed
535 5.7.8 Error: authentication failed: authentication failure

Which meant that the passwords doesn’t match, but in fact I didn’t have a clue what could cause the error. When I test the login with telnet I had the following response:

#telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 my.server.com ESMTP Postfix (Ubuntu)
250-my.server.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH NTLM CRAM-MD5 DIGEST-MD5 LOGIN PLAIN --Note this row
250-AUTH=NTLM CRAM-MD5 DIGEST-MD5 LOGIN PLAIN --Note this row
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

I’ve read in a forum /unfortunately I can’t remember where it was because I visited probably 10000 pages and tutorials/ that in the /etc/postfix/mail.conf instead of:

smtpd_sasl_path = /etc/postfix/sasl:/usr/lib/sasl2

The variable should be:

smtpd_sasl_path = smtpd

after changing this authentication start working as a charm. I’ve removed this setting completely and the system still works perfectly. What was the difference? When I test with telnet I’ve seen:

#telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 my.server.com ESMTP Postfix (Ubuntu)
250-my.server.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN --Note this row
250-AUTH=LOGIN PLAIN --Note this row
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

So, the difference is that auth method is different. The problem was exactly in that setting and by removing it everything start working. So the advise: don’t set this variable – it cause troubles!

Update: this article is really straight forward and making smtp authentication really easy!

Hopefully this will hope someone!

CSS Menu builder

Today I found a new service which could help to designers and developers while they creating the menus for their projects. The site is: www.cssmenubuilder.com and as far I can check from the site’s blog it’s quite new – about a month, but it provide very good service to it’s visitors.

So what is it? As the domain says it’s an online menu generator. The site provide 3 main types of menus: Horizontal and Vertical Menus as well as Breadcrumbs bars. The combinations are unlimited – see what the author said:

Please check out our 30+ horizontal menus, our 700+ vertical menus combinations and our breadcrumb menus that consist of more than 200+ combinations, in total the site offers more than 1000 menu combinations not including the endless color combinations.

Briefly what I like and what I miss in that site:

  • Great service for people which are too busy to spend hours for building menus. I could say I am one of them πŸ™‚
  • It’s free, no need to register.
  • Ability for live preview of the menu while doing it.

There is only one thing which missing and it’s multilevel menus, let’s hope this functionality will be available soon.

I definitely will use this service for my future projects. Why don’t you try yourself?
The site: www.cssmenubuilder.com