Mac binary stripping guide

Hey all. Mac users will know that a lot of new apples come with both i383 and ppc executable. If you’d like to save space you can strip one of them from the program. Here is how I did it to Safari 3.1:

First you open up Terminal.app under Utilities in the Applications directory.

Last login: Sun Mar 23 22:04:19 on ttyp1
Welcome to Darwin!
$ cd /Applications/Safari.app/Contents/MacOS/
$ ls
Safari
$ file Safari
Safari: Mach-O universal binary with 2 architectures
Safari (for architecture i386): Mach-O executable i386
Safari (for architecture ppc): Mach-O executable ppc
$ lipo -remove i386 Safari -output Safari
$ file Safari
Safari: Mach-O universal binary with 1 architecture
Safari (for architecture ppc): Mach-O executable ppc

For Intel users:
$ lipo -remove ppc Safari -output Safari

Explained:
The first two commands move you into the Safari.app binary and show you the contents of the folder. The file command shows you that the binary is a fat binary, IE it contains two arches.

Now lipo is the key to all of this. This is a command line tool that creates or operates on a universal files.

The binary you want to edit is located in Contents/MacOS inside the .app file. It is normally the only file in there.

Notes:
Backup the .app file before you begin just incase you make a mistake.
In firefox it’s called firefox-bin.
Tab-complete is your friend Continue reading ‘Mac binary stripping guide’

Still some SPARC left

Last week I decided to start working on my Sunblade 100 that I got back in November. It has been sitting on my stack for about the last two months without even being turned on once. The main reason for this was the lack of networking and my knowledge of Sun’s Solaris OS. After hearing that some people had Ubuntu server running on these machines I decided to download and try it. I now have Ubuntu 7.10 installed with networking and a Linux environment that I’m used to. After disabling the built in speaker because it frustrated me to the point of smashing some keys off of my keyboard with it’s beeping when using the console. Now only thing that annoys me now is the loud hard drive but as I use it via SSH I don’t have to been in the same room as it.

Sun Blade 100

The Blacklist

In case you’re not familiar with the term “blacklist” I will elaborate. There are three colours representing different kind of list; White, Black and Red. White is a free pass with no questions asked, Black doesn’t let you in the club and Red puts you in a headlock until the cops arrive and take you away.

My blacklist is very small at the moment only consisting of one email address and one IP address. I have some anti-spam measures in place but they don’t stop everyone getting through so I look for a patten from the IP and email address marked as spam. Any that turn up a lot go on the blacklist and are never heard from again….hopefully.

Cosmo version 9 and Server

I managed to get Cosmo version 9 online at midnight but there was a problem with IE6. Thankfully it was only IE6 and it was fixed within half an hour after I woken up and had breakfast. The site is controlled by one single PHP page that calls in the content and updates the blog each month automatically. It has in place functions that make the site more secure such as checking that the page trying to be loaded is a real page and not an off site link or an incorrect date.

The server that hosts all my websites is now running my own home brewed Linux OS called Blue Square Linux. The server has also had an extra 500GB fitted via a RAID SATA controller. It was a little bit of a problem at first because the kernel was custom compiled a long time ago without support for SATA.

Cosmo v9 – www.cosmo1847.co.uk
Blue Square Linux – www.bluesquarelinux.co.uk

RAID and extra storage

Something I have been thinking of doing for a while was to upgrade the server’s hard drive storage. At the moment it has a 200GB hard drive that is about 80% full. As I have a linux shop and the server is sometimes used as a backup for other computers on the network I have decided to by a 500GB hard drive. To make the new upgrades to the server future proof so that when the time comes to upgrade to a new server I will be able to use some of the parts from the old, I have bought a SATA hard drive. Due to the server not having any SATA ports on the motherboard, or for that matter most other I/O ports, I have bought an Adaptec SATA RAID card to go in the server. This will allow me to add 2 SATA hard drives to the server and these should preform just as fast, if not faster than the current IDE hard drive.

This will mean that at some point, probably next week, the server will be down while I upgrade the kernel and install the new SATA controller and hard drive.

Cosmo version 9 – CSS

After I started to make the new version of the site I designed to give up on the new design as I did not have a clear idea of what I wanted. As the current site already has a simple but nice design I designed to stick with that. I have remade the site based on that layout from scratch and it has taken be about 3 hours to do all of the CSS. I have no doubt that once I start to add content and test it in other browsers there will be more work to be done on the CSS but for now I am happy with the outcome.

As the code is made from scratch instead of being copy and pasted it allows me to make it much cleaner and remove any patchy parts where changes had been made in the past. I have also changed the way the the elements of the site are positioned on the page by not using position: absolute apart from on two parts where it is the only possible way to get the style wanted without it being fixed to a bad position on the page. A new logo has been made which is basically me writing “Cosmo” on a tablet. The entire site as it stands at the moment is 100% code with any graphics being SVG files. The XHTML needs to be validated but for now I will work on the back end of the site which I hope will be based on Ruby on Rails but if I am unable to do that I will fall back on PHP.

Cosmo version 9

This is the latest version of my personal website. They normally last as long as the server or until I make any major change to the style or running. The new version will include smooth new SVG graphics and will hopefully be powered by Ruby or at the very least cleaner PHP. As with every website I make it is better than the last in some way as I work hard on improving my skills and knowledge base whilst working on new sites. I have been working a lot with Ruby on Rails recently and I would like the website to run on that. This will require a learning curve as I’ve not made a site using RoR before. I will also need to get Apache HTTPd to server ruby files. I will also have a change log with the site.