This post is part 3 of 39 in the series Taming the Terminal

This is the third instalment of an on-going series. These blog posts are only part of the series, they are actually the side-show, being effectively just my show notes for discussions with Allison Sheridan on my bi-weekly Chit Chat Across the Pond segment on her show, the NosillaCast Mac Podcast. This instalment will be featured in NosillaCast episode 418 (scheduled for release late on Sunday the 12th of May 2013).

In the first installment we started with the 40,000ft view, looking at what command shells are, and why they’re still relevant in today’s GUI-dominated world. In the second instalment we looked at OS X’s Terminal.app, the anatomy of the Bash command prompt, and the anatomy of a Unix/Linux command. This time we’ll be looking at the anatomy of file systems in general, and the Unix/Linux file system in particular, and how it differs from the Windows/DOS file system many of us grew up using.

Read more

Tagged with:

This post is part 2 of 39 in the series Taming the Terminal

This is the second instalment of an on-going series. In the first instalment I tried to give you a sort of 40,000ft view of command shells – some context, some history, a very general description of what command shells do, and a little bit on why they are still very useful in the modern GUI age. The most important points to remember from last time are that command shells execute commands, that there are lots of different command shells on lots of different OSes, but that we will be focusing on Bash on Linux/Unix in general, and Bash on OS X in particular. The vast majority of topics I plan to discuss in these segments will be applicable on any system that runs Bash, but, the screen shots I use will be from OS X, and some of the cooler stuff will be OS X only. This segment, like all the others will be used as part of my bi-weekly Chit Chat Across The Pond (CCATP) segment with Allison Sheridan on the NosillaCast Mac Podcast.

Last time I focused on the shell, and avoided getting in any way specific about the actual commands that we will be executing within the Bash shell. I thought it was very important to make as clear a distinction between command shells and commands as possible, so I split the two concepts into two separate segments. Having focused on command shells last time, this instalment will focus on the anatomy of a command, but will start with a quick intro to the Terminal app in OS X first.

Read more

Tagged with:

This post is part 1 of 39 in the series Taming the Terminal

I have no idea whether or not this idea is going to work out, but on this week’s Chit Chat Across the Pond segment on the NosillaCast Mac Podcast (to be released Sunday evening PST) I’m going to try start what will hopefully be an on-going series of short un-intimidating segments to gently introduce Mac users to the power contained within the OS X Terminal app. I’m on with Allison every second week, and I’ll have other topics to talk about, so the most frequent the instalments in this series could be would be bi-weekly, but I think they’ll turn out to be closer to monthly on average. While the focus will be on OS X, the majority of the content will be equally applicable to any other Unix or Linux operating system.

In the last CCATP we did a very detailed segment on email security, and despite the fact that with the benefit of hind-sight I realise it was too much to do at once and should have been split into two segments, it received the strongest listener response of anything of any of my many contributions to the NosillaCast in the last 5 or more years. I hope I’m right in interpreting that as evidence that there are a lot of NosillaCast listeners who want to get a little more technical, and get their hands dirty with some good old-fashioned nerdery!

Read more

Tagged with:

I ran into a problem this week when the perl libraries for accessing MySQL databases refused to work on Mac OS X Lion. I did a ‘regular’ install:

  1. Install the 64bit version of MySQL Community Server (being sure to use the .dmg version so as to get the .pkg installer)
  2. use CPAN to install the needed database libraries:
    1. $ perl -MCPAN -e shell
    2. cpan[1]> install Bundle::DBI
    3. cpan[1]> install DBD::mysql

There were no errors during the install, so I assumed all we well, until I tried to actually use the libraries to access a database that is! Using DBI to try connect to a MySQL database gave the following error:

install_driver(mysql) failed: Can't load '/Library/Perl/5.12/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Library/Perl/5.12/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle, 1): Library not loaded: libmysqlclient.18.dylib
  Referenced from: /Library/Perl/5.12/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
  Reason: image not found at /System/Library/Perl/5.12/darwin-thread-multi-2level/DynaLoader.pm line 204.

After a lot of googling I found plenty of people with the same problems, including people on Snow Leopard, so I figured this was not a new problem. I tried a number of the suggested solutions, and most did not work, but after two days of trying, I found one that did, and it was wonderfully simple!

The problem is that the MySQL libraries are not in the OS’s library path, so they are not being found, most of the proposed solutions tried to tackle the problem at compile time, or to use simlinks to hack the libraries into the path, but like I say, these solutions didn’t work for me. What did work is simply updating the library path in my environment!

If you run the command below before executing your Perl script the library is found and all is well!

export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"

It’s a little awkward to do this all the time, so I added the line to my ~/.bash_profile file, and now it just works for me!

I spent two frustrating days trying to fix this, so hopefully I’ll save others some time by sharing my solution.

Tagged with:

I’ve been looking at different free Mac AV solutions so that I can make recommendations to less-computer-savy family members, and this afernoon I decided to give ClamXav a go. I’d tried it a few years ago and wasn’t very happy, but I’d been told by friends that it has improved a lot since, and a first glance at the GUI suggests they’re right. Unfortunately I didn’t get very far with my initial testing this afternoon because I’m in an environment where I have to use an HTTP proxy server to access the net, and ClamXav appears not to support proxies at first glance. It ignores OS X’s system-wide proxy settings, and it has no interface elements of its own to allow you to specify a proxy server manually. This implies that ClamXav doesn’t support proxies, but it actually does, they just didn’t bother to expose that functionality through the GUI.

ClamXav is just a GUI wrapper for the free and open source Clam AntiVirus toolkit, and it uses Clam’s regular auto-updating tool freshclam. Although the ClamXav GUI doesn’t give you control over the variables in the freshclam configuration file, that file does exist as part of ClamXav (/usr/local/clamXav/etc/freshclam.conf), and if you edit it manually it will respect the settings specified in that file. If you’re not afraid of the Terminal, you can easily edit this configuration file manually to get ClamXav to use a proxy server for updates.

Read more

Tagged with:

The technosphere is a buzz this week with the news that DropBox’s security has a rather large and rather stupid hole in it. I’m only going to give a brief overview of the issue here, so if you’d like more details please check out the blog post that broke the story. What I do want to say is that this is a really infantile mistake on DropBox’s part, and the fact that they could overlook something so elementary for so long worries me a lot.

Anyhow – the whole problem revolves around the Host ID which DropBox uses to identify a computer within your account. This code acts as both an identifier and a password, and it’s a big long string of random looking gibberish. The problem is not that this ID is easy to guess, but rather that it’s not tied to any particular machine. If a bad-guy gets their hands on the file containing this ID they can effectively clone your machine in DropBox’s eyes, and see your files in perpetuity, regardless of how many times you change your password. The only way to kill the bad guy’s access would be to de-authorise the machine who’s ID they cloned in your account pages on the DropBox website.

The original blog post that broke this story describes in detail where you can find this ID on Windows, but doesn’t mention any other OSes. Quite a few listeners to my various podcasts have asked me if I know where the file is located on the Mac. I didn’t, but I figured it would be worth spending a little time finding the answer.

Read more

Tagged with:

Note: these instructions also work on OS X 10.6 Snow Leopard, and OS X 10.7 Lion

A few years ago I did a similar tutorial for installing mod_jk on OS X 10.4 Tiger, but yesterday I discovered that those instructions do not work for Leopard. It took my quite a bit of googling and trial an error, but I’ve found a solution that works, which I’m going to share here. This solution is, in my opinion, a best practices solution, and does not involve any changes to your core apache configuration file (httpd.conf). These instructions are for the default install of Apache 2.2 that comes pre-installed on OS X 10.5 Leopard. I can verify that these instructions work for Tomcat 5.0.30, but I would be 99% sure they should also work un-changed for Tomcat 5.5.X and Tomcat 6.0.X.

Read more

Tagged with:

NOTE: Although this post references experiences I have had in work, the opinions expressed here are mine and mine alone.

If you follow me on Twitter you may have noticed my anti-RHEL (RedHat Enterprise Linux) outbursts today. I could keep twittering to try make my point, but sometimes 140 characters is just not enough, so I figured I’d blog about it instead and then tweet out the link to the blog post when I’m done.

In work we run two kinds of Linux servers, RedHat Enterprise Linux, and CentOS. We pay for RedHat, we don’t pay for CentOS (because it’s free). CentOS is based off the RedHat code base, but has some of the fancy stuff stripped out. Clearly, you would expect RHEL to give you the better experience since it has more features and you pay for support. Unfortunately, in my experience that’s just not how things are shaping up. CentOS has been completely problem and stress free (as well as financially free), while RHEL has not been such a smooth ride. Sure, most of the time it works just fine, but it definitely generates more stress for me than CentOS does, and that’s paid-for stress!

Read more

Tagged with:

I’m in the process of changing ISPs at the moment and have ended up without any broadband for a while. So, at the momet the only internet we now have in the house is my Three 3G dongle. It would be very mean of me not to share its rather slow and poor connection with the rest of the house so I decided to try out OS X’s built-in internet sharing feature for the first time. I have to say I’m impressed. You just choose which connection you want to share via which network connection and away you go. I shared mine over WiFi so I had a little more setup to do but not much. I just had to enter an SSID and a WEP Password.

Although it works well it’s not perfect. For a start only supporting WEP for the encryption is a poor show, you may as well offer no encryption! Even the WEP does not work reliably. From time to time other Macs can’t connect because of “incompatible security settings” and you have to re-start the sharing service. I also had a rather odd issue where I couldn’t share because my AirPort was automatically associating with my wireless base-station and there’s no way I could find of disconnecting so I could enable the sharing. I fixed the problem by turning off my wireless access point since it wasn’t connected to anything useful anyway.

I have a feeling sharing over ethernet would probably be a lot simpler.

[tags]OS X, OS X 10.5 Leopard, Apple, Mac, Internet Sharing[/tags]

Tagged with:

time-machine-logo2.jpgTime Machine is the fantastic new backup feature built into OS X 10.5 Leopard. It’s pretty simple to set up and it will work if you leave all the defaults as they are. The defaults are fairly intelligent. For example, your Library/Caches is automatically excluded from the backup. However, if you wish to use space on your Time Machine disk efficiently you may wish to configure Time Machine to exclude a few more folders.

[tags]Apple, OS X, Leopard, Time Machine[/tags]

Read more

Tagged with:

« go backkeep looking »