Posts

Showing posts with the label mac

Modify DocumentRoot in Apache (Mac)

After you've installed Apache with Homebrew on macOS , you might want to change the DocumentRoot which points to the directory where your website resources reside (e.g. HTML, CSS, images). By default, DocumentRoot is located in /usr/local/var/www 1 . Here are the steps to follow to change DocumentRoot to map to a custom directory path: Place your website folder to the desired place. For example: /usr/local/var/www/my_website Open the file /usr/local/etc/httpd/httpd.conf with your favorite editor, search for DocumentRoot , and modify the following line by substituting your directory path within the double quotes: DocumentRoot "/your/directory/path" Also change the next line: <Directory "/your/directory/path"> Restart your Apache server (if you want Apache to restart at login): $ sudo brew services restart httpd or if you don't want Apache to run as a background service: $ sudo apachectl restart Test the changes to DocumentRo...

Error: Keychain System cannot be found to store (Mac)

Image
After performing a Mac update, I found that my known Wi-Fi network was not joined automatically as I had specified in Network Preferences and this error message popped up: Keychain System cannot be found to store ... Also, this error message showed up while I did $ git push . My github login credentials stored within Keychain Access could not be accessed anymore. Solution I tried the first solution I stumbled upon which consisted in running First Aid on the logical drive Mac HD through Disk Utility ( Fig 1 ). And I restarted my computer (very important). Then my known network was now being joined automatically like before and the error message was not shown anymore! Fig 1. Select your Mac HD logical drive and run First Aid on it.

Install the MAMP (Mac, Apache, MySQL, PHP) stack

Image
There are two ways that you could install ( freely ) the whole MAMP stack: installing the MAMP (version 4.5) software bundle is the easiest way since it is a one-click-solution for setting up a personal webserver install each components (Apache, MySQL, and PHP) separately. This second method consists in installing Apache and PHP with Homebrew, and MySQL with the  package Installer . It is the hardest method but it enables you more control over the installation process, e.g you can install specific versions of each components, or install extra PHP extensions. NOTE:  MAMP 4.5, Apache 2.4.33, MySQL 8.0.11, PHP 7.2.7, and phpMyAdmin 4.8.2 are installed in the following tutorial Contents 1. Method 1: install the MAMP software bundle 2. Method 2: install each components (Apache, MySQL, and PHP) separately      2.1 Apache+PHP           2.1.1 Install Apache+PHP           2.1.2  Change A...

Make a movie from a sequence of images (Mac)

Image
There are two tools I tried on a  Mac to generate a movie from a sequence of jpg images: iMovie : very complete video editor, i.e. lots of interesting features such as adding sound to your video, titles and transitions. Works on jpg and png files. However, the video encoding is a slow process if applied on too many images (e.g. more than 1000). Official website . I tested with version 10.1.8 Time Lapse Assembler : very simple interface, i.e. a lot less features than iMovie.  Works on jpg files only. Great if you are only interested in generating a simple movie from a sequence of images without adding sound, titles, or transitions to your video. Application works great when applying it on lots of images (e.g. more than 1000). Official website . I tested with version 1.5.3 Contents    1. Mini-review #1: iMovie    2. Mini-review #2: Time Lapse Assembler    3.  Use case: Time Lapse Assembler applied to security camera images...

Make a split screen movie with iMovie and OpenShot (Mac)

Image
There are two tools I tested to make a split screen movie on a Mac: iMovie: video editor from Apple, official website . I tested with  version 10.1.8 OpenShot:  free and open source video editing software that works on FreeBSD/Linux/macOS/Windows, official website . I tested with version 2.4.1 Contents     1. Split screen layout selected     2. iMovie         2.1 Steps to make a split screen movie with iMovie     3. OpenShot         3.1 Steps to make a split screen movie with OpenShot Split screen layout selected More specifically, I wanted to create a split screen movie with the following layout having a 16:9 aspect ratio: Figure 1. Split screen layout: Movie 3 should take the right half of the screen My basic motion detection system generates 3 videos, and I wanted to combine them in a single movie for better visualization. Movie 3 should take the right half of the...

Make a GIF from a video file on a Mac (no online tool)

Image
If you want to make a GIF from a video file on your Mac, and are looking for a free tool to do it, I recommend using PicGIF Lite (free version). You can load video file or a list of images. Don't make your GIFs too long (more than 5 seconds) or your GIF file could be too big (10 MB and more). Sample gif built from sequence of images in the SBMnet dataset As a side note , you can trim your MPEG-4 videos with Quicktime using the CMD+T command. If you are having difficulty with Quicktime reading your video file format (e.g. avi movie files), the OpenShot video editor will surely open your video file (it is based on the FFmpeg library), and let you trim it among many other things. Reference: check this  macworld's How-to article  for other GIF-making tools that allow you for example to create GIFs from Youtube or Vimeo videos, or from recording your screen.

Installing OpenCV 3 on macOS with Homebrew

I am following this pyimagesearch tutorial to help me install OpenCV 3 on macOS Sierra 10.12.6 with Homebrew. I am using Python 2.7.15 & 3.6.4 installed with conda , instead of Python installed with Homebrew (like in the tutorial).  Contents    1. Major blog updates    2. Installation steps: Homebrew install command    3. cv2 import error    4.  Skipped brew tap    5.  --HEAD flag error    6.  Flags ignored: --with-contrib and --with-python3    7.  OpenCV installation test code    8.  SIFT and SURF test code Major blog updates May 29, 2018: added webcam test code + references, explained more the "sym-link" part, and added update of ~/.bash_profile Installation steps: Homebrew install command These were the prerequisites I had on my computer before installing OpenCV 3 via Homebrew: Operating system: macOS Sierra 10.12.6 Homebrew Two conda environm...