Friday, September 28, 2012

Returning to Java

In my early years of coding, I learn several programming language for my career. I'm doing VB, Borland Delphi, before finally settled with Java. So in my final years in uni, I done a lot of work in Java, including my final year project. In the same time, a new framework emerge and advertised as Java killer: .NET Framework with C# Language - which I also learn. Then I joined my first company (after graduated), which is a Microsoft partner and is one of .NET early adopter. That's how I ends up in .NET (or Microsoft) world for 10 years, although I keep doing several side projects or just learning view tricks in Java/Linux.
Finally, view months ago, a friend convinced me to join his startup, and I have freedom or at least a say in choosing which technology that will be used in this new enterprise. I pulled the trigger to use this chance to re-join Java world. Here's some of points on the journey on redefined myself as Java programmer:

  • I choose Netbeans as IDE, instead of Eclipse and Intellij IDEA. My problem with Eclipse is to use Maven and Tomcat, I need to install and enable several plugins - manually, which for Netbeans the plugins available automatically. For Intellij IDEA, the reason of not using it is because if I can get things "free" with Netbeans, why I need to pay for Intellij IDEA. Yes, that's really a lame excuse, the community/free version already give enough. But at the end, I must say that Netbeans team really done a good job to bring Netbeans this far. I'm a happy user of this fantastic IDE.
  • In choosing of programming stack, Spring framework is the (likely) sole candidate, and for web stack, we evaluate several available options like JSF, ZK, and Vaadin (even GWT). At the end the framework of choice is JSF, since this is the official web framework for Java EE (although we not going to Java EE direction - EJB thingy), and Primefaces is really bring JSF to the new level.
  • We choose Ubuntu as our primary Linux distro. I already work with this distro for quite some times, and it's maybe the "easiest" Linux distro out there, which is means "easy" for system admins (which is our end users sysadmin) to maintain their own systems.
Let see how far we can go from here!

Tuesday, September 4, 2012

Set A Static IP On Ubuntu

To change my IP address on Ubuntu from DHCP to static IP, I do following step. First, open file /etc/network/interfaces. I'm not a fan of vi/vim, I'm using nano (or editor in MC)
sudo nano /etc/network/interfaces

You will find something like this:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

To make it static, I change to (based on my network):
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.191
netmask 255.255.255.0
gateway 192.168.1.1

Restart the interface:
sudo ifdown eth0
sudo ifup eth0

And with ifconfig, voilĂ :


But, I still have problem later:


The system cannot resolve DNS. To resolve this, I re-edit /etc/network/interfaces, and add entry of dns-nameservers. So the complete /etc/network/interfaces will looks like:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.191
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1

Done, restart the interface again (ifdown and ifup), now I can browse internet.