Want to change our Web Site


Catching up

It has been a really long time since my wife and I have had a few moments to update the web site for our company. I once read an interview in a magazine where one of the questions they asked a business owner was what is your pet hate? his answer was updating my web site. At the time I thought this was really odd, but as time flies by and the weeks turn into months I have realised that I think I have been rescheduling that job over and over as well. It has actually been quite a few years since I have properly updated our website. Most of it was coded by me in HMTL and PHP. Problem is… it was mostly written in notepad and vi.

I have decided to try a new way of authoring the web site, as I think part of the reason of postponing updates is from frustration of using ordinary editors and web interfaces that seem to take forever, time to change all that.


The Integrated Content Environment (ICE)

I have installed the Integrated Content Environment (ICE). ICE is produced by the University of Southern Queensland. This system converts Word and Open Office documents into XHTML, PDF and lots more as you can see on their website. I am involved on a project as USQ that uses ICE to create the entire web site. On this particular project we are working on perfecting a news stand page. It has JSON feeds from our projects Twitter API’s and feeds from other services such as the the projects WordPress Blog.

Another great feature of ICE is it can post Word and Open Office documents using ATOM and SWORD protocols. For example you can create and publish a word processing file (like I am doing now) and post it to your WordPress blog complete with images and formatting, yes you are reading an Open Office document ala ICE and ATOM.


Expected time of arrival

At this stage it has been relatively easy to install and configure ICE2 on a server running Ubuntu. All that is left is to create the look and feel using a combination of XHTML and CSS. My method for doing this is to start with Firefox, then put in hacks to suit the other browser types. I have been silly enough to take on another programming subject at USQ starting this week, so between that, running the stores, looking after 2 kids and working full time I should have this all up and running in a week or two. I will keep you posted.

How to attach large files to command line email

Exim4

Exim4 is the mail transfer agent that I am using on this Ubuntu machine. I was unable to find a way to attach a compressed file when sending an email using the mail command.

Of course you can pump a text file into the message using < but that just inserts the contents of the file literally inside the message.

Mutt to the rescue

I installed Mutt using the Synaptic Package Manager and ran a test. Basically the command looked something like this.

mutt -s "Backup of data" -a file_name email@my.place.edu.au

This worked really well… until I realized that there is a limit to the file size you are able to attach. This turned out to be a exim4 setting rather than a Mutt setting.

Increasing the message size limit

I went to the /etc/exim4/exim.conf file and added the following line

MESSAGE_SIZE_LIMIT = "10000M"

The default is 50M, not very big enough for the huge tar.bz2 files that I will be sending.

After making this change I had to run the following command

sudo update-exim4.conf

Word of warning

By opening the message size limit too large you are pretty much allowing any size email to come in, this may mean that your mail server could clogged up say in the case of a DOS attack. In my case this is a private machine address behind a gateway and does not receive any mail so this is not a concern to me.

Adding new hard drive to (Ubuntu) home subversion server

Fitted 500 Gig hard drive to machine
Booted into BIOS and auto detected new drive
sudo fdisk -l (and note the name of the new drive, in my case sdb)
sudo mkdir /mnt/nameofnewmountpoint
sudo chmod 777 /mnt/nameofnewmountpoint
sudo mkfs.ext3 /dev/sdb
sudo gedit /etc/fstab
Added the following line (seperate each field with a tab)
/dev/sdb /mnt/nameofnewmountpoint ext3 defaults 0 0
Mounted the drive without rebooting
sudo mount -a
df to see results

Media Center Using Plex and OSX

File Server is as follows

  • AMD Dual Core 64 Bit Processor
  • 2 X 500 GB Hard Disk Drives
  • Gigabyte GA-MA78GS3H Motherboard

Control Unit is as follows

  • MacBook

Software is as follows

Operating Systems

  • Ubuntu 8.04 on file server
  • OSX on Control Unit

Software

  • Samba on file server
  • Plex on Control Unit

Directions

File server

  • Install 8.04 Ubuntu
  • sudo apt-get install samba smbfs
  • sudo gedit /etc/samba/smb.conf
  • Add the following lines under the authentication section

security = yourLinuxUser
username map = /etc/samba/smbusers

  • Add a samba user

sudo smbpasswd -a <sambaUser>(MakeThisSameAsYourLinuxUser)

  • Edit samba users file

sudo gedit /etc/samba/smbusers

  • Add the following line

<YourLinuxUser> = “<sambaUser>”

eg. homeuser = homeuser

Control Unit

  • Install plex from http://elan.plexapp.com/
  • Go to Videos Menu and click add source. Select browse then “Add network Location” follow the steps
  • If you want to remove a source highlight the source and press “c” This allows extra choices.

How to install OpenSim on Ubuntu 7.10 (Gutsy Gibbon)

cd /etc/apt
sudo vi sources.list
add the following URL to the file
deb http://fr.archive.ubuntu.com/ubuntu hardy main universe
Open the Synaptic Package Manager, search for and download the following.
subversion
nant
mono-gmcs
libmono-microsoft8.0-cil
libmono-system-runtime2.0-cil
libgdiplus
libmono-i18n2.0-cil
cd ~
svn co http://opensimulator.org/svn/opensim/trunk opensim
cd opensim
./runprebuild.sh
nant 
Then change directories
cd bin
mono OpenSim.exe
Download a viewer  
http://secondlife.com/support/downloads.php
extract the viewer
tar -xvjf SecondLife.tar.bz2
cd SecondLife
./secondlife.exe -loginuri http://localhost:9000/ -loginpage http://localhost:9000/?method=login

Handy “ls” arguments on *nux

I am constantly checking logs when software testing. Some software creates a new log file every time there is an new event. This sends me crosseyed trying to figure out which is the latest log that I want to view.

Here is the trick

type “ls -ltr”

l = List (Single column and easy to view)

t = Sort by time

r = Reverse the order of the search (So that the log you want is listed last, just above your prompt)

How to kill an application in Ubuntu without knowing the PID

It is very rare for me to experience a lock up on an Ubuntu machine. However when a program hangs for whatever reason and hogs all of the system resources it gets a bit frustrating. It would be nice to be able to kill the application quickly and move on with the work you were doing.

When a program hangs and you want to kill it, open a terminal and type xkill. This will turn the mouses cursor into a cross X. From here simply click on the window of the application that is hanging and viola… it disappears immediately minus the hourglass, blue screen or spinning beachball.

java.net Connection Exception : connection refused

Update: This is a link to the post that contains the instructions we were following http://oxfordrepo.blogspot.com/2008/02/creating-web-application-from-scratch.html

We were setting up mysql for installing repository software as web interface for fedora.

As part of the process mysql was required, but we got stumped at the following error during the installation of Fedora:

java.net Connection Exception : connection refused and a stack trace.

This error indicated it was more a connectivity issue than software. To fix this we tried the following:

mysql -h 127.0.0.1 –user=user –password=pass databaseName

this gave us a similar error:

ERROR 2003 (HY000): Can’t connect to MySQL server on ‘127.0.0.1’ (110)

To fix this problem we modified the firewall to accept ALL traffic to localhost (on loopback)

# Allow unlimited traffic on loopback
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

It now connects and we can continue installing :)

Setting up a cron job to update Ubuntu machine

I wanted to use the cron system to update an Ubuntu machine everyday and send me emails with the results.

In order for the Ubuntu machine to send email from the cron job it needs to have the email in the command line set up see this post

We decided to write a shell script to do the job and then have it called by the cron job. This is an example of the script ( the -y option answers yes to questions that would be asked) You must make sure that the script is excecutable ie type “chmod 755 script.sh”

#!/bin/bash
proxy=http://proxy.url.com:8080
export http_proxy=$proxy
apt-get -y update
apt-get -y upgrade
updatedb

We are using the crontab that belongs to root (to access this “su” and then “crontab -e”) as the update commands must be performed as root.

Below is an example of our cron job, not you can send the results of the job to more than one person if you seperate each email address with a comma

MAILTO=me@here.com.au, you@there.com.au
# m h dom mon dow command
01 01 * * * /path/to/shell/script.sh