RSS
 

Archive for the ‘Linux’ Category

Which Technology To Choose?

03 Jan

Since this seems to be interesting for a lot of developers, I thought I’d share my thoughts:

Introduction

Which technologies to choose is getting increasingly more difficult for developers, web and embedded alike. Questions like “Why Java?”, “Why HTML 5 (HTML + JavaScript + CSS Modern Extensions)?’, “Why C++?”, “Why PHP?”, “Why Python?” or “Why not something else?” are not easy to answer. There are many advantages and disadvantages in using any of these programming languages and environments. Within these languages there are even more possibilities of choosing development tools called frameworks. When talking of frameworks, I mean jQuery (JavaScript), OpenLayers (JavaScript), (Geo)Ext (JavaScript), Twitter Bootstrap (HTML5), Drupal (PHP), Symfony (PHP), Java EE, Wicket (Java), Hibernate (Java), GWT (Java -> JavaScript), just to name a few I’ve had the pleasure (and pain) to work with. More and more I’m coming to the following conclusions:

Choosing The Path Of Least Resistance

Maximum Gain With Minimum Pain

This has always been my main goal with the development tools I choose. After all, computers are there to make our lives easier and not harder. You might be surprised of some of the choices I’ve made with OS and tools. While choosing the Windows or MacOS platforms seems like the easier path, Linux and yes, the command line, actually have proven easier or at least more powerful by now. So, what seems the easiest at first might be harder in the long run and vice versa. Also, Linux tooling for web or any kind of development is far better documented, supported and a lot cheaper (free). So, if you are like me (and most other people) and have more time than money, it is probably worth your while to learn and invest (time, at least) into Open Source. It has had a great return in terms of moral and now even monetary rewards. There are companies out there that invest their staff’s’ time and resources into Open Source. Among those not least Google and Facebook, the biggest Internet companies in the world!

Frameworks

Frameworks might in fact make life harder rather than easier. Sure, I use many framework in my work, but sometimes it seems like learning and choosing a framework sometimes takes longer than writing your own and using it. At least attempting to write your own framework(s) has proven as a good exercise for learning how to use them and vice versa, choosing a framework and using it might give you ideas on what to do and more importantly on what not to do. Now, I haven’t written my own complete framework as yet, but I have started doing so. I guess once you start your own framework, you are never finished. The main framework I am working on since about 2 years has been a client side spatial portal application framework called the LcrToolkit (Landcare Research Toolkit, used on http://ourenvironment.scinfo.org.nzhttp://smap.landcareresearch.co.nz and others to come out soon). Thinking back now, I could have come up with a more original name for it, but that is just a side note. It is a very specialised framework for putting up spatial portal applications. Learning to use a framework is a big time commitment, whether this is Microsoft .NET, PHP (Symfony, Drupal, …) or Java’s many frameworks. So, if it were for saving time, some people say, use .NET, because some people believe the ads that the time investment will be minimal. This (in my opinion) is wrong! Learning PHP and JavaScript frameworks can be achieved much faster, because these languages (at least the basics) are very simple AND they are openly developed with tons of documentation and since they are free, there is a lot more support from developers and advocates. Not only do these developers innovate and support free products because they are super nice people and want to make the world a better place, they develop Open Source products, because these products live longer and if they are good, attract a lot of developers. This is not only because Open Source is better, but also because developers get credit for what they have achieved. Furthermore, Open Source is very competitive and therefore secure. To get your name out there as an Open Source developer, you have to be (one of) the best. That means you have to compete, BUT always in a friendly and respective manner. To be the best, you have to be prepared to fail to succeed. You have to be open to being corrected and that is not always easy to handle. To get back to Frameworks: There are a lot of them out there and I have named a few already. It seems like there are simply too many. The more I research frameworks, the more time I could spend trying them all out. The possibilities are endless. So, one must put a vigorous filter into ones research. Lately, I’ve been wanting to implement a testing framework inside the LcrToolkit and eventually went with qUnit (JavaScript), not because I think it is the best, but simply because I do not have time to try them all. qUnit is simple, well documented and works just fine. Surely, there must be more advanced testing frameworks for JavaScript, but qUnit is easy to pick up and that is the main criteria these days for me. Things like Hibernate and JPA don’t really appeal to me. They are bloated, take a lot of time to learn and don’t really gain you anything. The only benefit you get from ORMs is that you are “independent” of a particular database management system. Just use PostgreSQL for Christ’s sake. It is the most advanced database out there, and yes I mean the most advanced DBMS. It is superior to even Oracle and far better than MySQL or Oracle’s DBMS. Not that Oracle is a bad company… anyway, I’m missing the point. Frameworks: There are so many that one cannot grasp all of them. I’ve been a bit of a grasshopper on frameworks. I’ve worked with Drupal, Joomla, CiviCRM, GWT, Wicket and all of the above and have taken away that frameworks are great, BUT cannot replace good developers. You need to be thinking all the time about security, look and functionality of your app, whether it is a web app, website or even “just”  an embedded program.

To be continued… ??

 

SMTP Postfix Server Setup for your home development

18 Mar

EDIT:

This is much easier if not trivial to achieve with your ISP’s smtp server and configuring postfix as a smart host and simply supplying your ISP’s smtp server as the smart host. A simple:

sudo apt-get install postfix

and then configuring you server as a smart host relaying mail to smtp.yourisp.com.

If you already installed postfix, you can follow the following:

Note that You might not want to use dnsexit if security is a concern for you. I stumbled upon this now (28 July 2012) and realised that if you use dnsexit, you are basically giving them your credentials. So, be warned. I used my own server for this.

Source: http://www.dnsexit.com/support/mailrelay/postfix.html

This document describes 5 easy steps to setup your Postfix email server as smarthost to relay on DNS Exit mail relay server for all email sending.

The mail relay service from dnsExit.com can be found at here

1. Create password maps file (it assigns username/passwords to
specified mail servers). You can choose any name, let's say it
is /etc/postfix/relay_passwd. It's content should be as follows:
 relay.dnsexit.com USERNAME:PASSWORD 

 Note: Replace USERNAME and PASSWORD with your DNS EXIT mail
relay username and PASSWORD.   

2. Set proper permissions for that file:
# chown root:root /etc/postfix/relay_passwd
# chmod 600 /etc/postfix/relay_passwd     

3. Create hash from maps file (remember to do it each time
you change your maps file):
#  postmap /etc/postfix/relay_passwd   

4. Configure your /etc/postfix/main.cf:
relayhost = [relay.dnsexit.com]  # this is the important line!
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/relay_passwd
smtp_sasl_security_options =    

Note: If your ISP blocks outgoing port 25. You can choose to
use alternative SMTP ports by appending the port at the end:
relayhost = [relay.dnsexit.com]:26

5. Reload or restart your postfix:
# /etc/init.d/postfix restart

The thing to note here is that you can easily use your ISP’s smtp server as the relayhost. You can find out easily what your ISP’s smtp server is by going to their support pages.

 
2 Comments

Posted in Howto, Linux

 

Howto: Install Apache Tomcat 6 on Ubuntu 11.10

21 Feb
  1. Download Tomcat 6 from http://tomcat.apache.org/download-60.cgi or a mirror listed there.
  2. Extract it in the /usr/local directory:
    cd /usr/local/
    sudo tar xvfz ~/apache-tomcat-6.0.35.tar.gz # or wherever you downloaded tomcat to
    sudo ln -s apache-tomcat-6.0.35 apache-tomcat-6 # or whatever your tomcat version is

This post is incomplete, but might get you going. More docs can be found @ http://www.eclipse.org/forums/index.php/t/272457/

 
No Comments

Posted in Howto, Java, Linux

 

Ubuntu on Asus N53S(V)

08 Oct

To install Ubuntu with a working NVIDIA card on this laptop. Follow these instructions:

  1. Follow https://help.ubuntu.com/community/Asus_N53
  2. Add this to your modules blacklist in /etc/modprobe.d/blacklist.conf:
    blacklist nouveau
    blacklist fbcon
    blacklist vga16fb
  3. Run 3D Graphics intensive applications like Google Earth with
    optirun google-earth
  4. Optional: Mount Windows NTFS partition in /etc/fstab:
    /dev/sda5       /d      ntfs    noexec,nosuid   0       0

Edit: You might not need to add the blacklist. I’ve just setup 11.04 64 bit and did not black list the drivers and it works! Remember to NOT enable the additional drivers in this setup because it will override your Intel Drivers, which are good because you can still run 3D apps but with less power consumption.

 
 

Howto: Solving problem with logrotate

25 Dec
/etc/cron.daily/logrotate:
 
error: error running shared postrotate script for /var/log/mysql.log
/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log
 
run-parts: /etc/cron.daily/logrotate exited with return code 1

Have you been getting this cryptic error message before?

Here is how to get rid of it:

View /etc/mysql/debian.cnf. Look for

user     = debian-sys-maint
password = newpass

Log into mysql as root

mysql -uroot -p
SET PASSWORD FOR `debian-sys-maint`@`localhost` = PASSWORD('newpass');
SET PASSWORD FOR `debian-sys-maint`@`%` = PASSWORD('newpass');
FLUSH PRIVILEGES;

Log out and it should be fixed.

 
No Comments

Posted in Howto, Linux

 

Howto: Postfix aliases setup email account

25 Dec

Edit /etc/postfix/virtual.cf .

vim /etc/postfix/virtual.cf

Add line:

user@example.com localusername

postmap /etc/postfix/virtual.cf

vim /etc/aliases

Add line:

localusername: someother@othersite.com

newaliases

 
No Comments

Posted in Howto, Linux