How to stop .ds_store files being created in Apple OSX

I use source control while developing software. Apple’s OSX creates .DS_Stores files in any folder that you browse with Finder. These are normally hidden but they obviously aren’t ignored by version control which is designed track everything including hidden files. I could add them to the .ignore files in both Mercurial or Git – but this is time consuming and annoying.

Therefore, I installed asepsis which an lightweight opensource tool. This forces Mac to store all the .DS_store files in another location. It was quite straight forward to get going.

1. Download the software
2. Install it
3. Restart the computer
4. Migrate all the existing DS_store files using the command:

asepsisctl migratein 

Hope this is helpful.

Firefox Spell Checker Doesn’t Work In Apple Mac OSX – How to fix…

I’ve moved from Ubuntu to Apple Mac OSX and like to use Firefox.  However, rather annoyingly the Firefox spell checker doesn’t appear to work on Apple by default.  Bizarrely, it doesn’t highlight any incorrect spellings.  I found that the only way to fix it was to add another dictionary to Firefox.  Here is how I did it.

Step 1 – Find a dialogue box or text box and right click.  You should see a menu like so.  You could click Language -> Add Dictionaries

how_to_make_firefox_spell_check_work_osx

Step 2 – You will be taken to the Firefox Dictionary and Language Pack Page .  You should select and install the right dictionary for your locale.

firefox_spell_check_broken_apple_mac_osx

Step 3 – I installed English (United Kingdom) dictionary and immediately the spell checker  immediately started working.  Hope this helps someone else.

p.s. if anyone from the Firefox team are reading this – why doesn’t Firefox work with native Apple spell check / dictionary?

sudo: can’t open /etc/sudoers: permission denied

The sudo command checks the permission of the /etc/sudoers file and also the contents of /etc/sudoers.d/ before allowing you to use the sudo command.

For example you might be warned:

sudo: /etc/sudoers is mode 0777, but should be 0440

or perhaps:

sudo: can't open /etc/sudoers: permission denied.
sudo: no valid sudoers sources foundm quitting

Therefore, if you don’t have root login (which is generally good security practise) then you might not be able to change the permission back without dropping into recovery mode.

1 – Reboot the machine

2 – Select boot from recovery more

3 – fsck the disk which will then mount the disks as read/write

4 – Drop to root shell

5 – chmod 0400 /etc/sudoers

6 – reboot the machine and you are fixed

Apache 2.4 Failed To Start AH00016: Configuration Failed

One of our Apache 2.4 web servers strangely stopped working and didn’t want to come back up. I tried to start it but it came back with a vague error message:

$ sudo service apache2 start
Starting web server
apache2 Action 'start' failed.
The Apache error log may have more information.

A quick look in /var/log/apache2/error.log just showed nothing useful:

$ tail var/log/apache2/error.log
AH00016: Configuration Failed, exiting

So, I ran the Apache configuration check tool on the configuration files but the syntax was okay.

$ sudo apache2ctl configtest
Syntax OK

This means that there isn’t anything wrong with the syntax of the Apache config and I generally find that this means either an SSL certificate isn’t installed incorrectly or there is something wrong with a more general configuration file. To find which host had configuration file problems – I used the strace command. This is really good because it shows all of Apache’s interactions with the file system. Therefore you can see the last file Apache opened before failing.

sudo apt-get update
sudo apt-get install strace
sudo strace -f apache2ctl start

The output from strace is quite large but you can clearly see where Apache failed.

.....
[pid  6068] munmap(0x7f45c6c38000, 4096) = 0
[pid  6068] write(11, "[Sun Oct 05 07:35:44.207805 2014"..., 189) = 189
[pid  6068] write(2, "AH00016: Configuration Failed\n", 30) = 30
[pid  6068] select(0, NULL, NULL, NULL, {0, 10000}) = 0 (Timeout)
.....

and just before this was this…

[pid  6068] munmap(0x7f45c6c38000, 4096) = 0
[pid  6068] open("/etc/ssl/private/a_website_ssl.key", O_RDONLY) = 45
[pid  6068] fstat(45, {st_mode=S_IFREG|0644, st_size=1704, ...}) = 0
[pid  6068] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f45c6c38000
[pid  6068] read(45, "-----BEGIN PRIVATE KEY-----\nMIIE"..., 4096) = 1704
[pid  6068] close(45) 

This enabled me to quickly idenfity which ssl certicate was causing the problems and disable the site which was using that key.

sudo a2dissite a_weebsite.conf

I hope that someone finds this useful.

how much does it cost to distribute ghostscript commercially?

I’ve been working on a commercial project where we would have liked to use Ghostscript. To use ghostscript in a commercial settings (i.e. to distribute it alongside binary code) you need to have a license.   At the time of writing (September 2014) – the costs for this are rather prohibitive:

There is a minimum $8000 per quarter and a $5000 set-up fee. This fee can increase depending your business usage.

Wow. That’s too rich for me. Time to find another pdf lib.

How To Recover / Get Your Music From Your IPod / IPad / IPhone

It’s a classic mistake. You buy an ipod, import all your music into itunes, sync it onto the ipod… then at some point loose the computer. Suddenly, your ipod has all of your music on it and you can’t get it off. Don’t panic… there is hope but it does cost you $35. Yes, there are other solutions to this problem but this is something anyone can go.

Install itunes on a new computer
You will need the drivers for your ipod and therefore you need to download and install itunes.

Stop itunes automatically syncing
Once you have installed itunes, you need to make sure that it doesn’t automatically override the music on your ipod by automatically syncing nothing over the top. To this go to:

Edit -> Preference -> Devices and check ‘Prevent Ipods… from automatically syncing’.

Buy a copy of iExplore
Iexplore is the program which makes this really easy to do. The only draw back is that it costs $35. Personally, I think this is completely reasonable given that it saved over 2,000 songs for me. Buy a copy of the software, download and install it.

Plug in your device
with a usb cable.

Open Iexplore
Browse to device -> music -> select all the tracks and then you can transfer either to itunes or a folder.

Job done.

DNS Price Comparison – DynECT vs dnsmadeeasy

I’ve been using DynECT for our corporate DNS for several years. I choose it because it has a well designed and easy to use interface. However, over the last few months, they have put their prices up and set new query limits. This means that DynECT are now completely uncompetitive. After looking around, we have decided to move to the brilliant dnsmadeeasy.com. Here is a quick price comparison.

Company: DynECT
Name: Express 40
Queries Per Month: 5,000,000
Total Records: 800
Monthly Cost: $95
Yearly Cost: $1140

In comparison to:

Company: DNS Made Easy
Name: Small Business
Queries Per Month: 5,000,000
Total Records: 400
Monthly Cost: $2.49
Yearly Cost: $29.95

DNS Made Easy is just 3% of the price!

Surely, DNS Made Easy must be slower or less reliable? The answer quite simply is no. It’s faster than DynETC and totally awesome. I suggest that people more over to DNS Made Easy.

Don’t just take my word for it. This website has put together a comprehensive comparison for DNS.