How to generate public/private keys

This post shows how to generate public / private key pair. To generate public/private key pair, simply run the following command:$ ssh-keygen -t rsa Following are step-by-step instructions: 1. Open your terminal window in your Linux, Mac, or Windows machine by typing terminal in the search box or spotlight....

Linux: How to delete files recursively

The rm command deletes files. To delete a directory which is not empty and its subdirectories, use $ rm -rf directory However, sometimes you would need to remove specific subdirectory rather than the entire directory and its contents. For example: |-- engine|-- mod    |-- .svn    |-- anytext ...

Creating empty files from Linux command line

There are many ways to create an empty text file from command line. This post shows 3 ways. To create empty file from Linux command line, you can use one of the following methods:1. touch filename2. vi filename and close file3. echo > filename touch is a tool that...

How to install a WordPress Theme

This post shows how to install a WordPress theme with a few clicks. To install a theme: Following are detailed instuctions: Go to your WordPress dashboard: Then click on Appearance and then themes Click on Add New Choose a theme you like. In the search, I typed sports to...

bash: How to change file extensions

This post shows how to change file extensions using bash. To change file extensions, we simple need to loop through file in a directory and use the “mv” command to rename each file. The following code requests directory address from the user and then renames all “.log” files to...

PHP: How to fix problems with European character encoding

Recently, I had to build a multilingual portal. Soon I ran into character encoding problems. Gibberish would appear in place of special characters such as umlaut, accent circonflex, etc. Naturally, I checked out PHP manual, MySQL manual, blogs etc. The solution is easy but the problem needs to be...

bash: Renaming multiple files

To rename multiple files using the command line, you can use the rename command or a shell script. Its syntax is as follows. $ rename regular_expression files As you can see, the catch is that you need to know regular expressions. But for simpler tasks, regular expressions are really...

bash: renaming files in a directory

Suppose you have 2000 photos in a directory and you need to rename them. The files are named as: We need to rename them as follows: Here is how: j in is the counter. Line 5 increments j. s is a string. Line 4 uses the mv command renaming...

How to transpose data in Excel

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....

Counting cells in Excel

Excel provides 4 different functions to count cells: count(), counta(), countblank(), countif() =count(A1:A10) Counts cells in the range which hold a value. Empty cells and cells containing formulas are not counted. =counta(A1:A10) Counts non-empty cells in the range. Cells containing formulas are counted. =countblank(A1,A10) Counts empty cells in the...

How to write nested if statements in Excel

This post shows how to write nested if statements in Excel To write a nested if statement, write other if statements in place of true or false statements. For example:=if(A3=A4,if(B3=B4,”True”,”False”),”False”) Following is a more detailed explanation: Excel if statements have the following syntax: if (condition, TRUE, FALSE) Condition defines...