Creating csv files using PHP

It is very easy to create a csv file using PHP. All you need to do is create a two dimensional array of data and call fputcsv() function.

$aa = array( array ('a', 'b'), array('1 ', '2'));
$fh = fopen('file.csv', 'w');
foreach ($aa as $a) { fputcsv($fh); }

This script create nice csv files even in you have quotes in the file.

Make sure your script has sufficient directory permission to create the file and populate it.

Transposing data in Excel i.e. moving data between rows and columns

The following steps show how to transpose data in excel. Transposition refers to switching between rows and columns. For example, if row 1, column1 is A, row 2, column 2 is B, the transposition will be A in row1 column1 and B will be in row2 column2.

  1. copy a dataset
  2. before you paste, right click on the first destination cell
  3. click on Paste Special
  4. select Transpose, and click on OK

Creating public/private keys

To create your public / private key on Linux or Mac, which is a unix-based system, following these steps:

  1. Open terminal
  2. type the following command

    ssh-keygen -t rsa

  3. Type enter to ignore passphrase twice

By default you keys will be saved in ~./ssh directory. id_rsa is the private key. is the public key. Place a copy of your public key on systems you wish to login through you key pair.

App can’t be opened because it is from an unidentified developer

### Problem ###
Cannot install a downloaded application. Get the following error message, "App can’t be opened because it is from an unidentified developer"

### Solution ###
By default, Mac prevents applications from unidentified developers to be installed. This is to protect us against malicious software. This new security feature is called GateKeeper. You can easily go around it but make sure you are not installing malicious software. Just google it and you will find out it your source or software package is suspicious.

To go around the security,

Drupal 7 - Removing authoring information from content type

To remove the authoring information you can simply edit the content type as follows:

Go to Administration >> Structure >> Content types >> edit >> Display Settings 
Uncheck "Display author and date information"
Save content type 

Another way is to edit your theme directly. If you need to remove the author and leave the date or vice versa, editing the theme would be the easiest solution. If you are not comfortable with editing the theme, then find a module that does it for you and list it in the comments below.