Ubuntu Remove Exim4

I’ve scoured over the net on how to permanently remove the Exim4 Mail Server from the Ubuntu OS and came across with this one command that did it. The other options that include purge with it didn’t work. So I’m sticking with this one since it is what made it work and I was able to reinstall Exim4 again.

apt-get remove exim4 exim4-base exim4-config exim4-daemon-light

Then just install Exim4 again with this command.

apt-get install exim4

If you are using an account that doesn’t have root access, add the command sudo first.

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(1 votes, average: 5.00 out of 5)
 Loading ...

Javascript dateFormat

Javascript does not have its own built-in function for formatting dates. You would have to create one from scratch. I found this function somewhere in the net. I forgot who the owner of this one is but if you (the owner) come across your function, please do let me know. This was very useful and what I needed. Easy to use, no hassles.

Sample usage would be date_format(new Date(”07/01/2008″), “!mmmm !d, !yyyy”)

function date_format(aDate, displayPat){
  /********************************************************
  *   Valid Masks:
  *   !mmmm = Long month (eg. January)
  *   !mmm = Short month (eg. Jan)
  *   !mm = Numeric date (eg. 07)
  *   !m = Numeric date (eg. 7)
  *   !dddd = Long day (eg. Monday)
  *   !ddd = Short day (eg. Mon)
  *   !dd = Numeric day (eg. 07)
  *   !d = Numeric day (eg. 7)
  *   !yyyy = Year (eg. 1999)
  *   !yy = Year (eg. 99)
  ********************************************************/
 
  intMonth = aDate.getMonth();
  intDate = aDate.getDate();
  intDay = aDate.getDay();
  intYear = aDate.getFullYear();
  var months_long =  new Array ('January','February','March','April',
  'May','June', 'July','August','September','October','November','December')
  var months_short = new Array('Jan','Feb','Mar','Apr','May','Jun',
  'Jul','Aug','Sep', 'Oct','Nov','Dec')
  var days_long = new Array('Sunday','Monday','Tuesday','Wednesday',
  'Thursday','Friday','Saturday')
  var days_short = new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat')
  var mmmm = months_long[intMonth]
  var mmm = months_short[intMonth]
  var mm = intMonth < 9?'0'+ (1 + intMonth) + '':(1+intMonth)+'';
  var m = 1+intMonth+'';
  var dddd = days_long[intDay];
  var ddd = days_short[intDay];
  var dd = intDate<10?'0'+intDate+'':intDate+'';
  var d = intDate+'';
  var yyyy = intYear;
  century = 0;
  while((intYear-century)>=100) century = century + 100;
  var yy = intYear - century
  if(yy<10) yy = '0' + yy + '';
  displayDate = new String(displayPat);
  displayDate = displayDate.replace(/!mmmm/i,mmmm);
  displayDate = displayDate.replace(/!mmm/i,mmm);
  displayDate = displayDate.replace(/!mm/i,mm);
  displayDate = displayDate.replace(/!m/i,m);
  displayDate = displayDate.replace(/!dddd/i,dddd);
  displayDate = displayDate.replace(/!ddd/i,ddd);
  displayDate = displayDate.replace(/!dd/i,dd);
  displayDate = displayDate.replace(/!d/i,d);
  displayDate = displayDate.replace(/!yyyy/i,yyyy);
  displayDate = displayDate.replace(/!yy/i,yy);
  return displayDate;
}

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(1 votes, average: 5.00 out of 5)
 Loading ...

Install Java On Ubuntu

I searched through every Google search results and wondered why after updating my apt-get source list, installing Java in Ubuntu still did not work out. It turned out that my source list were lacking some sources in it. If doing this command

apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin

will give you an error that package is not found, go to the source list at

vi /etc/apt/sources.list

and use your text editor to check if these lines are there.

deb http://us.archive.ubuntu.com/ubuntu feisty main restricted
deb http://us.archive.ubuntu.com/ubuntu feisty universe multiverse

If not, add them. Update apt-get again by typing

apt-get update

and then run the same command to install Java 6.

apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin

Follow instructions during installation. To verify that Java 6 has been installed in your system, type

java -version

This post assumes that you are logged in with an account that has root access. If you do not and you are unable to execute any of these commands, add the command sudo.

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(1 votes, average: 5.00 out of 5)
 Loading ...

Installing Apache Tomcat 6 On Unix-Type Servers

Each Unix-based (I just call them Unix based since these new OS now were non existent at the time that only Unix and later on Linux were around) OS has a package manager command that will do the downloading and installation of the package specified. If you want to do installations the old fashion way … downloading the file, extracting and moving it to the desired location it’s still pretty easy for say, Apache Tomcat 6 Server. Do the following steps.

  • wget http://apache.hoxt.com/tomcat/tomcat-6/v6.0.16/bin/apache-tomcat-6.0.14.tar.gz
  • tar xvzf apache-tomcat-6.0.16.tar.gz
  • Check the Apache Tomcat’s website for any new version and just change the path and filename for it.
  • mv apache-tomcat-6.0.16 /usr/local/tomcat
  • You can place it anywhere you want in the file system. It is a matter of personal preference. In this case, the new folder will be tomcat instead of apache-tomcat-6.0.16
  • cd bin
  • ./startup.sh

This is assumed that you have Java installed. If it is not installed, then Apache Tomcat will not run as it is dependent on the Java Runtime Environment.

Like what you see? Buy me a cup of coffee. Or subscribe to my feeds.


(1 votes, average: 5.00 out of 5)
 Loading ...