rsync command

rsync is a very useful alternative to rcp and scp. It tool lets you copy files and directories between a local host and a remote host. The main advantage of using rsync is that rsync can use SSH as a secure channel, send/receive only the bytes inside files that changed since the last replication, and remove files on the destination host if those files were deleted on the source host to keep both hosts in sync.

rsync -avz -e ssh user@host1.com:/~mydir ~/

This copies mydir and its contents from user1 to local

Comparing files using diff and cmp

The diff command gives details of differences between two files. The cmp command simply tells you whether two files are the same or different.

$ diff one.txt two.txt

The results would be something like the following:

14c14
< txt txt txt
---
> text text text

The first line indicates the line number(s) which are different between files. The letter c indicates that line 14 must be changed for them to match. The < symbol refers to the text in the first file. > symbol refers to the second file.

Reading command-line input in C

Following a program which echos whatever you type in the command line.

#include <stdio.h>

main(int argc, char *argv[]) {
     int i;
     for(i = 0; i < argc; i++)  { 
         printf("arg %d: %s\n", i, argv[i]); 
     }
     return 0;
}

argc is the count of the number of command-line arguments. argv is array of vectors. Each word is a string. So if you type:

myprogram.exe my input

the output should be

gulp.js

Gulp.js is a great tool for building and enhancing workflows. It is free and open source. It helps you automate repetitive tasks such as automating CSS creation and unit testing. In this article, I will walk you through many simple examples of using Gulp.js but first let's look at the gulp API which only consists of 4 functions!

gulp API

gulp.dest is where you define you output file. This is where you will store output from a specific gulp task.

Command pm-enable needs a higher bootstrap level to run

This page shows what to do when you get the following error when using drush

Command pm-enable needs a higher bootstrap level to run - you will need invoke drush from a more functional Drupal environment to run this command.

This error is basically saying that it cannot locate drush or the correct host to execute the drush command. To solve the problem

1. Make sure you in the correct directory In command line, cd to the the directory where your drupal is installed. Then run drush en views. If you still get the error, continue to step 2.

alias command

The alias command assigns a command or set of commands to a string. Aliases are generally used to simply typing a long command or to execute an option to a command by default.

Pages