Quick way to find which log file is logging errors

On development systems it is common practice to have different log file to log PHP error logs for different tools and different versions of the same tool. Generally it is a good idea to use meaningful names to make it easy to distinguish between the log files. If you have doubts, you can either look inside the code to see which error log file is being called or do the following:

$ cd ~
$ ls -al /var/log/httpd before.diff

Run the tool such that it would write something to the log file. Then

Setting up multiple displays on Mac OS

It is now common for users to work with multiple monitors. Laptop users, especially, prefer to work on their laptop screen and an external monitor when at they at work or at home. If you are using netflix or some other service to download movies, you would prefer to watch it on large screen rather than your laptop screen, so you would want to connect your computer to a TV or projector.

It is very easy to connect Mac OS computers to external monitors.

Some quick APT commands

Advanced Packaging Tool (APT) is used by Debian system to manage package installations. Following are some quick commands:

Some common commands that can be used with APT:

Installing packages

$ sudo apt-get install package

Removing packages

$ sudo apt-get remove package

Getting a list of packages

$ sudo apt-get update

Upgrading packages

$ sudo apt-get upgrade

Should I choose Apache with or without SSL?

When downloading Apache from apache.org for Microsoft Windows Operating System, you are given two options:

  1. Win32 Binary without crypto (no mod_ssl) (MSI Installer)
  2. Win32 Binary including OpenSSL 0.x (MSI Installer)

OpenSSL is an open-source implementation of SSL and TLS protocols. mod_ssl is a package that provides cryptography for Apache via SSL and TLS. SSL and TLS specify how to securely encrypt and send confidential information over HTTP.

PHP date arithmetic

strtotime() function can be used for date arithmetic. Following are some examples:

Get next date

print date('Y-m-d', strtotime('+1 day', strtotime('2013-09-30')));

Prints

2013-10-01

Get previous month

print date('Y-m-d', strtotime('-1 month', strtotime('2013-09-30')));

Prints

2013-08-30

Go back 5 years

print date('Y-m-d', strtotime('-5 year', strtotime('2013-09-30')));

Prints

Content search on Windows 7

Windows 7 search interface is different from previous versions of windows and it can be frustrating for new users. The Start > search field is used for all search i.e. programs, files, file contents, and even outlook emails search. By default, search is limited to file names and properties like date and file type. The search does not look inside the files so if you are searching for a file whose name you forgot but remember some lines of text, you will not be able to find it with the default settings.

Installing drupal using vagrant

If you are running a windows system, it can be difficult to setup several pristine drupal development environments. The simple solution is to install a virtual machine, setup your drupal such that it has no affect on the rest of your system. A better solution is to use a virtual machine workflow system that will allow you to easily create and work with several virtual machines. Vagrant is such a system and in here you will learn how to set it up.

Vagrant error occurred while downloading the remote file

Problem

An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again.

Cause

You are running vagrant init outside your virtual box

Solution

cd to your vagrant directory. If you did a vagrant box add solar, then your virtual box is in the directory solar.

$ cd solar

If there is not VagrantFile, run the following command:

$ vagrant init 

If there is a VagrantFile

$ vagrant up

Getting started with Homebrew

Homebrew is a package manager for Mac OS.

Installation

  1. Download and install Xcode from Mac store if you don't already have it installed
  2. In a terminal, type the following code

    xcode-select --install
    
  3. Run the following command

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"    
    

Some commands

brew search Search for an application:

Pages