1 Earth. 6.5 Billion Adventures

Anything is Possible

Archive for the ‘howto’ Category

Mac Upgrade Circus

I was called in at 9 this morning for some routine maintenance and an upgrade or two of the computer that Just Works.

Mac Don’t Always Just Work

I started at 9:20am – faced with the 2-year-or-so old Intel Mac Book Pro that was still running OS X Common House Cat Tiger and in desperate need of an upgrade.

The machine was previously used as a photo bank / work horse and was now relegated to the serene pastures of office admin.  The 120GiB harddrive was 100GiB full, and would therefore need a good vacuuming.

Still littering the office from previous Mac upgrades, which didn’t go smoothly at all, I had my 2-step upgrade discs handy.  I’ve read several posts where people have said upgrading from Tiger straight to OS X Snow Leopard was possible, but my mileage varied quite considerably.

So with all 5 or 6 of the various ages of Mac I had to upgrade in the office about 3 months ago, I had to go from Tiger to Leopard to Snow Leopard every time. Not. Fun. At. All.

Bring in the Leopards

Anyhow, the files on this computer had all been backed up, so I could just fire away. I duly slipped the OS X Leopard 10.5 disc into the drive.  The Mac recognised the disc easily enough and a couple of clicks later the disc was humming along nicely and Leopard was being installed.

About 25 minutes later as the progress bar neared 100%, I was thinking to myself how smoothly it was all going. Of course, thoughts like this generates a ridiculously strong electro magnetic pulse, and mere moments after forming this thought in my head, the Mac threw up a non-helpful message to the tune of “Leopard could not be installed on this system. Please restart and try again”.

Luckily the message said please, otherwise I would have been seriously pissed off at just having wasted 30 minutes.

But the fun was just starting. Restarting the iMac it then told me that OS X 10.4 was required for this installation and that OS X 10.4 was not detected on this system. I chose the main drive as the startup disc and restarted the Mac again.

This time it try to boot, but just shut down. I tried a couple of times, but it did the same thing and eventually I realised the harddrive must have gotten wrecked.

How to the get CD out of a Mac that doesn’t boot up

Hit the power button and immediately hold down the mouse button (on the trackpad). After a while the disc will eject.

How to then boot again from the CD of a Mac that doesn’t boot up

Power up the Mac, slip in the CD, hold down the C key.

Eventually I used a retail disc of OS X Leopard to go into Disc Utilities and check the harddrive for errors.

“Oh”, said the Mac, “the disc needs to be repaired”. Wow really? That just works.

I clicked on the Repair button and several more wasted minutes later it apparently didn’t just work as I was told “your disc can’t be repaired. Save as much info as you can and reformat.” Nice one, Apple.

So that’s what I did. I reformatted and started from scratch by running the OS X Leopard 10.5 retail install.  After about 30 minutes of that, I treated myself to an immediate additional 25 minutes by upgrading straight to OS X Snow Leopard 10.6. I was up for even more and thought about immediately installing the patches to bring it up to 10.6.4, but the 900MiB download and a slow Internet connection in the office quickly killed off that idea.

Apple Macs Just Work – Eventually

So at 13:00, the Apple Mac finally just worked.

And the crash, which resulted in the loss of all the installed applications with their files, means that the office is now a superbly uncluttered admin workhorse richer.

Bookmark and Share

Disable, Limit and Delete WordPress Revisions

For me a major WordPress Blog annoyance is the WordPress Revisions feature. It essentially saves a copy of your post or page every time you update it. If you share my frustration, here’s how to stop or limit WordPress Revisions and clean current revisions from your database.

Remember kids: Backup before you try this at home

WordPress is an awesome blogging platform with many useful features, but WordPress Revisions is the one feature I have never said about “oh, wow, I wish I had the previous iteration of this article“.  I back my database up regularly (and so should you), which gives me a backup of my article anyway, so for me it makes sense to disable WordPress Revisions all together.

There are various plug-ins that can handle this for you, and I recommend that you use one of them if you’re not comfortable fiddling around in code.

Otherwise, open your wp-config.php file, which resides in your WordPress root/install directory, and add either one of the following lines before the ?> at the bottom of the file.

To totally disable WordPress Revisions to prevent additional copies of posts and pages being saved, add this:

define('WP_POST_REVISIONS', FALSE);

To limit WordPress Revisions to say 1, 2 or 3 revision copies only, add this and change the number to suit your preference:

define('WP_POST_REVISIONS', 2);

The following line of code will erase all the WordPress Revisions in your blog. I did this, because I don’t want any copies anywhere – it reduced my 7.4MiB database to 3.2MiB, which just shows how much space WordPress Revisions can occupy (and this is a development database, which means it’s still relatively small).

Do you really want to delete all your WordPress Revisions?

Open you favourite MySQL interface software (commandline, PHPMyAdmin, MySQL Workbench – they all work), back up your current database and then enter the following command:

DELETE FROM wp_posts WHERE post_type = "revision";

Your database will now be wiped clean of every single WordPress Revision (but obviously not your actual article or pages). In any case, please take my my advice: back up your database.

And… you’re done!  You should now have a significantly smaller WordPress database, which will speed things up a bit – it really makes a different if your blog is huge, less so if you only have a few entries.

Happy blogging!

Bookmark and Share

How to make OpenERP work on Ubuntu Server 9.10

Yes, the title of this post is a good question.  At the moment I don’t have the answer, but I sure am trying to find it and hopefully, by the end of this post I will have it.

I’ve been trying to do it for the last week, but between my limited knowledge of Linux servers and the totally new world of OpenERP, it’s a learning curve so steep I slip 2 steps back for every 1 forward I manage.

The story so far is that I had the Ubuntu Server running flawlessly, I had the OpenERP server running flawlessly, I even made friends with PostgreSQL, but for the life of me I couldn’t get OpenERP web to talk to the servers enough to successfully create a database and then log in to it.

So at this very moment I’m reinstalling Ubuntu Server 9.10 with nothing more than a mail server, an SSH server and the Samba server.  The rest I’m going to do with what is hopefully the magic bullet – the OpenERP self install script.

Step 1: Install Ubuntu Server 9.10 (8.50am)

I’m doing a pretty much Vanilla install of Ubuntu Server 9.10 32-bit on an ex-Vista laptop.  I’ve said yes to a couple of things:

  • automatic security updates,
  • installing an SSH server (I will manage it from my desktop),
  • the Samba file server and
  • a mail server.

This is all because there is a script out there that will supposedly install OpenERP for me if I have it setup like this. Supposedly.

The install took about 30 minutes, with a fast Internet connection / computer it would likely be faster.

Step 2: SSH to the New Server (9.30am)

I’ve setup my server on a fixed IP address on the office router (for demo purposes 192.168.1.1) and let’s say  my username is ’1earth’.   I launch a Terminal instance and type the following and hit enter:

ssh 1earth@192.168.1.1

The system is working as expected and tells me there are some security updates and upgrades to do.  It’s a bit of schlep as this will take at least another 30 minutes on my slow Internet connect, but for the sake of good system administration I type

sudo apt-get upgrade

Oh nice, it will actually take 50 minutes, so I will gather the rest of the info I need for when it’s done.

Step 3: Follow Installation Instructions for Dummies

If you Google “openerp ubuntu server 9.10 installation” you’ll likely hit one of OpenSourceConsulting’s tutorials. There’s a few old ones, left on there for the SEO ranking no doubt, so make sure you follow the newest one and save yourself hours (if not days) in wasted time.

The tutorial I’m going to follow is OpenERP Installation: All In One For Ubuntu With Updates, with fingers double and triple crossed.

If you’re also trying to install OpenERP on Ubuntu Server 9.10, scroll down and find the “Ubuntu Server (for advanced users not interested in having a GUI desktop)” section. I’m not an advanced user, but it doesn’t bother me if it doesn’t bother you.

Day 1

11.01am – Starting the instructions.

11.38am - It’s been downloading and installing like mad.  According to the instructions I should exit SSH and log in again, however I was now asked for my password and when I entered it, it says “OpenERP will now be installed“. Deviation from the plan. I’m worried.

Nevertheless, I continue and it offers me a choice of Stable or Trunk. I don’t know any better, so I select Stable.

Next it asks me if I want to install the Apache Server (ticked), Extra Addons (not ticked) and Firewall (ticked).  I tick the Extra Addons and thus elect to install everything on offer.

Next it asks me which trunk branches to install and offers a list of unticked items: openerp-spain, magentoerpconnect, report-openoffice, openetl.  I have no clue what any of these are. I assume it’s the Extra Addons I ticked.  I won’t install any of them right now, so I just click OK without ticking anything.

Now it tells me “Enter the DNS name of your URL” and offers openerpweb.com as a default. Dammit, what does this mean? I don’t have a DNS name for my URL. Is it the URL of my server? I use diveserver.dev (which doesn’t exist) and click OK.

Next it offers a list of IP addresses already configured on my Ubuntu system.  The right one is listed. Yay! A feeling of relief. OK to that.

Now it asks for the admin password. Of what? My Ubuntu box or what I want for OpenERP?  I enter one for OpenERP and hit OK.

Ok, now it asks for my SUDO password. I enter it and hit OK.

11.52am Progress bar pops up going left and right and text says “Installing BZR“.  I like the way it’s going so far, it seems positive.

12:01pm OpenERP Server: Downloading latest stable branch from launchpad.net

12:15pmOpenERP Client: Downloading latest stable branch from launchpad.net“.

12:20pmOpenERP Client Web: Downloading latest stable branch from launchpad.net“.

12:26pm OpenERP Addons: Downloading latest stable branch from launchpad.net“. Hmmm, I thought I said no to these.

1.00pm Time for lunch. Hopefully the Addons will be done by the time I get back.

1.56pm – Back from lunch and OpenERP Addons were still installing. I thought it hanged, but then saw that my iMac had downloaded and readied for installation nearly 1GB of updates! I got rid of the iMac prompt and at the same time, it could have been coincidence, the progress bar updated with “DON’T PRESS ACCEPT/OK !!. Downloading and installing Python libraries“.

3.03pm – In the Terminal Window, while the progress bar is still swinging back and forth, it said “Extracting templates from packages: 100%” and then asked for my password.  I typed it and hit return. It line-breaked, but nothing else. Progress bar still swings.

3.51pm – Finally clicked “Cancel” which promptly killed the process. 2 hours is simply more than it should take.  Now I’m going to run ./openerp-allinone-setup.sh again and see what happens.

It’s going through the entire process again, but it skips over everything that’s been done already… and zooms straight past the Python libraries and onto “DON’T PRESS ACCEPT/OK !!. Downloading and installing Postgres Database“. Right, maybe it did hang.

4.26pm – “DON’T PRESS ACCEPT/OK !!. Installing OpenERP Software” with non-disruptive warning message before it switched.

4.32pm – “DON’T PRESS ACCEPT/OK !!. Downloading and Installing Apache

4:36pm – “DON’T PRESS ACCEPT/OK !!. Enabling Firewall settings

5.03pm – Patience is running thin and it’s still enabling the Firewall settings. Surely it doesn’t take 30 minutes? I’m clicking cancel.

Cancel didn’t work, so I CTRL+C’ed the terminal window and it escaped. So, running the script again. It says OpenERP is already installed, do I want to upgrade it.  I said no. Fudge. Let’s see if it works.

It says there should be an OpenERP-README.txt file with further instructions.  I can’t find it with ‘sudo find / -name OpenERP-README.txt’ so I’m going to go through the upgrade process and see what happens. Sigh.

Right, upgrade went quick and it said all’s OK.

5.13pm I go to http://192.168.1.1:8080 and it loads. I feel nothing, this is as far as I got. The proof is in the pudding, or the database creation.

5.14pm Clicking on the Database button takes me to http://127.0.0.1:8080/database and that obviously doesn’t work. Is this a bad setting I made somewhere coming to bite me in the ass, or what’s the story?

6.00pm After 45 minutes more of searching and reading I’m nowhere nearer to the answer than I was before.  Everyone in the office are leaving and so am I.  I’m secretly hoping that after a restart it will work thinking that it’s a stuck cache or something somewhere.

Day 2

9:10am I dreamed about this install last night.  First thing I did was check out my hosts file, but all seems OK.  I downloaded HTTPFox for Firefox so that I can see what traffic my browser sends and receives and where it gets told to go to 127.0.0.1, by OpenERP or what.

Ha! When I click the databases button on OpenERP-Web’s login page, my browser asks for 192.168.1.1, but then is redirected by OpenERP to 127.0.0.1.  A quick Google now using “OpenERP redirects to 127.0.0.1” yields this OpenERP Forum thread, which related to OpenERP 5.0.2.  But let’s try their solution and see if it works for OpenERP 5.0.7 as well.

In my /etc/openerp-web.cfg file tools.proxy.on = True already, so I change tools.proxy.base = ’192.168.1.1′, save and restart both the server and web.

9.30am – Right, that seems to take it to the right server (diveserver.dev – which doesn’t exist, but which the install script automatically added to my server’s hosts file and therefore works).

However, now Firefox is adamant that the security certificate is a problem (annoying, but Firefox is just protecting me) and it won’t let me continue, nor add an exception for it here or manually in the settings box.

I’m going to have to create myself a proper certificate that I can import.  Is nothing easy?

12.10 – I give up.

Creating a certificate didn’t work for me, because Firefox still complains about it not being trusted. I also couldn’t access the site using Safari or Chrome, both giving similar but different reasons to Firefox.  I tried taking the server off SSL, but I obviously don’t know how to do that either.

I’ve wasted enough time doing research on how to get this to work. My OpenERP adventure ends here.

Next, lets try OpenBravo.

Bookmark and Share

Installing Firefox-3.5.tar.bz2 on Ubuntu 9.04

Your problem: you’re running Ubuntu and your current Firefox 3.0.11 is not offering you the much anticipated, very exciting upgrade to Firefox 3.5.  So you’ve downloaded the firefox-3.5.tar.bz2 file and now you want to know how to install it.

Update: If you’ve already installed Firefox 3.5 and now want to upgrade to Firefox 3.5.1 then check out the instructions of How to Upgrade To Firefox 3.5.1 on Ubuntu below. If you’re upgrading from 3.0.11, then just follow the instructions as is.


I’m running Ubuntu 9.04 Jaunty Jackalope and I”m more of a visual user than a command-line user, so I’m going to tell you the way I did.

Rest assured, doing this you will not lose any bookmarks or settings from your current browser. But backup just in case.

  1. If you haven’t yet, download the new Firefox 3.5 from Firefox.com to your desktop
  2. Right-click the file (firefox-3.5.tar.bz2) and choose Extract Here
  3. You will now have a new folder on your desktop called Firefox. Rename it to Firefox-3.5
  4. Open a terminal window (just this once) and type sudo nautilus – this will launch your file browser with root privileges
  5. Navigate to File System -> usr -> lib ( /usr/lib/ ) and copy the folder Firefox-3.5 into this directory
  6. Open the folder Firefox-3.5 and find the file called Firefox.
  7. Right click and Make Link. It creates a file called Link to Firefox
  8. Cut and paste this link to File System -> usr -> bin ( /usr/bin/ )
  9. There is already a link called Firefox so rename that to Firefox.old (if there isn’t, don’t worry), rename your new Link to Firefox to just Firefox

All done.  Now close down all your current Firefox windows, and restart with the improved Firefox 3.5. Tada!

To upgrade in future

You can use Firefox’s built in Check for Updates function, however, this only works when you run Firefox as root.  I did the upgrade moments ago, but had some trouble, so here’s what should work:

  • Open a terminal window and type gksudo firefox;
  • This will launch Firefox and the Check for Updates option under the Help menu will be active;
  • Choose the option, Firefox will check and install any updates. Close and restart Firefox.

Warning: I ran this process as sudo firefox, which apparently is the wrong way to do it.  If you re-open Firefox and there’s a red bar at the top that says your history and bookmarks are locked because it’s in use by another program, then something went wrong. In this instance, root locked several files in my .mozilla user directory, so I couldn’t use it as a normal user.

To fix it, close Firefox and do this:

  • Open a file browser and got to home -> yourusername -> .mozilla -> firefox -> xyz.default (profile folder)
  • Leaving it open, open a terminal window and type sudo nautilus, which will open a second file browser, and then navigate to the same folder
  • In the first file browser window you will see that some files have a locked icon on them
  • In your second file browser you won’t see the locks because in that window you have root privileges. So in that window, right click the files and bestow your username onto the locked files, giving permission back to you as a normal user.
  • Relaunch Firefox and all should be as it was intended;
  • If anybody has a reason/easier way to do this, I’ll be happy to hear from you

Successfully upgraded to Firefox-3.5.1

Bookmark and Share

Sneaky YARPP

You know, I may feel many things in my life are beyond my control, but my blog is not one of it. Nope, my blog is mine, completely under my control.  What I say goes, what I say stays.  My blog is my country and I’m the dictator.

I therefore feel not unlike Robert Mugabe when Morgan Tsvangarai went all democratic on his ass, when something that I didn’t explicitly OK’ed appears on my blog.

So it was then, quite by accident, that I looked at my own RSS feed and saw some new stuff that I didn’t rubberstamp appear there.  Sneaky YARPP (Yet Another Related Post Plugin) had unilaterally decided to not only insert some related posts into my feed (new feature!), but also to reward itself with a promo link back to its own website below every single entry – without asking or even telling me!

YARPP is a free piece of software from the WordPress Plugin Repository.  It doesn’t require me to pay for it, it doesn’t even require me to link to it in exchange for using it.

Of course, it’s a great piece of software and we all have to eat, so donating a link is the least I can do to thank the creator for his hard work, right?

But for crying in a bucket, ask me first! Don’t go and be clever and write yourself into my country. Subverting a dictator will cause heads to roll.

When I auto-upgraded YARPP it came with these new features. One’s automatic inclusion in your RSS feed and two is an automatic link underneath every entry (which on an RSS feed with 10 items listed means 10 links to YARPP).  And it’s on by default – disable it in the plugin settings.

Here’s a link mitcho, please don’t take liberties on my blog like that again – there are other plugins that does that same thing out there.

Bookmark and Share



Archives


Feeding Time


Meta




Other Adventures