TagMac OS X

Using a Comodo Free Email Cert In macOS Sierra

Comodo offer free email certificates, which is awesome as email is an inherently insecure method of communication. So, if you were toying with the idea of playing around with email encryption and signing, you have no more excuses now.

Getting the free cert to work on macOS, however, might be tricky if you don’t pay attention to a couple of things. Here are the pitfalls I have encountered in the process and how I was able to fix them.

Continue reading

See Detailed Disk Information From The Terminal On Mac OS X

I was already familiar with the diskutil command in Mac OS, which basically just returns a list of physical and logical partitions of drives connected to your Mac (both internal and external).

But today I found out about an even more useful command to see detailed disk information using Mac OS X’s Terminal: diskutil cs list.

Continue reading

Numbers.app Cannot Open File “For Some Reason”

Screen Shot 2016-02-16 at 14.49.30.png

This is a great example of what error messages should not look like.

This same file can be opened without issues using Microsoft Office, LibreOffice and even OpenOffice.

In my experience, Numbers.app has quite a few issues dealing with very large files. I was once working on a 10.000+ line file and I was dragging a simple VLOOKUP. It took Numbers.app 2 hours to get to a RAM usage of 11 GBs, before ultimately crashing without completing the job.

Perhaps this file is again too big for it, and this is the “reason” mentioned in the error message. Still, it would be nice to know if there is something we can do to take care of issues like this, without resorting to another office suite.

View Detailed Network Information Straight From Your Mac Menu Bar

A little trick for you today. Have you ever wanted to take a quick glance to your network information of your Mac without having to go to System Preferences or opening the Terminal? Good news: meet the alt key.

Continue reading

Create An ISO File From A CD/DVD On Mac OS X Using dd

The Old Method

I used to create ISO files on Mac OS X using Disk Utility, but I really wanted a command-line way of doing it, also because the default output file format when you use Disk Utility to do this is Mac-specific (it created .dmg files). The resulting file would need to be converted before you can open it in Windows. The command I used to use was this:

hdiutil convert Desktop/image.dmg -format UDTO -o Desktop/new_image.iso

The New Method

I have been using this new method for a while and it seems to be working fine so far: the resulting iso files can be read both on Mac and on Windows and it only takes two commands in Terminal.

First of all, list all your mounted devices:

diskutil list

One of the items, supposing your CD/DVD is inserted and mounted, will be the disc that is inserted in your drive. The device itself will be something like /dev/disk2, and the actual partition inside it containing the files will be /dev/disk2s0.

Note: if you use the physical device instead of the partition inside it, the iso file will be created but you won’t be able to mount it.

Now that you know your device identifier, you can start the cloning process with dd:

sudo dd if=/dev/disk2s0 of=/Desktop/your_file.iso

There you go, nothing else to be done and no conversion necessary ;)

Enable Apache and PHP on Mac OS X Yosemite, the Quick Reference

I don’t know about you, but sometimes all I need is a quick refresh to my memory on how to do something, and I don’t need complete, in-depth instructions. Those times, I don’t want to scroll through long instructions, I just need some precise information, and I need it quick. This is why I wrote this quick post to be used as a reference for myself, and I thought that other people might find it useful too.

Note: if you would prefer in-depth instructions on this, I will refer you to the articles linked at the end of this post. They really cover everything there is to know about the topic and I wouldn’t be able to add any other useful information.

If you want to do some local web development on a Mac, you have two options: you either use a full stack like MAMP, or you enable Apache and PHP and install MySQL only. On Mac OS X, Apache and PHP are already installed, and it’s only a matter of enabling them.

Enable Apache

Technically, Apache doesn’t even need to be enabled, it just needs to be started:

sudo apachectl start

Enable PHP

To enable PHP you need to edit the httpd.conf file (/etc/apache2/). Specifically, you need to uncomment the following line:

LoadModule php5_module libexec/apache2/libphp5.so

And then run:

sudo apachectl restart

Now, this is all you need to do to be up and running: if you visit http://localhost you will see the Apache default page.

[Optional] Bring back the Sites folder

If you stopped at the previous step, you would use the default system-wide Apache folder: /Library/WebServer/Documents/. If you prefer to have a user-level folder instead, there are a few extra steps to follow.

  1. Uncomment #LoadModule userdir_module libexec/apache2/mod_userdir.so from httpd.conf
  2. Uncomment #Include /private/etc/apache2/extra/httpd-userdir.conf from httpd.conf
  3. Uncomment #Include /private/etc/apache2/users/*.conf from http-userdir.conf (which you can find under /etc/apache2/extra/httpd-userdir.conf)
  4. Create a Sites folder inside your home folder
  5. Create a <your_username>.conf file inside /etc/apache2/users/
  6. Copy and paste the following code inside the conf file

<Directory "/Users/<your_username>/Sites/">
    Options FollowSymLinks Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
    Require local

Restart Apache and you are good to go.

For more in-depth instructions on how to do this, have a look at the following two excellent articles:

© 2018 Daniel's TechBlog

Theme by Anders NorénUp ↑

%d bloggers like this: