Tech-Tips

Create an alias in Windows

Recently, I wanted to create shortcuts for git commands. I can have written aliases inside the git config file, but then also, I had to type git explicitly. So, I just searched the internet and came across this link: http://superuser.com/questions/49170/create-an-alias-in-windows-xp.

Move cursor by display lines when wrapping in vi

You can move your cursor by display lines when wrapping in vi, instead of jumping to the next line. This can be really helpful, when you have long wrapped lines, and you want to move in between them.

Just edit the .vimrc file.

vi ~/.vimrc

and insert the following text into that:

nnoremap <up> gk
nnoremap <down> gj
inoremap <up> <C-o>gk
inoremap <down> <C-o>gj

Show line numbers in vi or vim

Displaying line numbers while editing a file can be handy. Using line numbers you can directly jump to a particular line. You can set the line numbers in vi using the following commands:

:set number

If you want to turn off the line numbers in vi, use the following command:

:set nonumber

You can also insert the following text into the .vimrc file, and can switch on or off the line numbers, by pressing the F6 and F7 keys respectively.

Using FTP Batch Scripts on Windows

The Microsoft KB article 96269 shows you how to use the ftp program that comes with all versions of windows to automate file transfer. You can use the -s option for passing FTP script to the program.

File Checksum Integrity Verifier utility

Many times we face situations where a bug is not reproducible on a particular version in our environment, but the customer or supports says, that its reproducible at their ends, but they can't share that environment due to security concerns.

Shell script to download file using ftp

#!/bin/sh

# ftpget - given an ftp: style URL, unwrap it, and try to obtain the file using ftp.

if [ $# -ne 2 ] && [ $# -ne 3 ]; then
  echo "Usage: $0 ftp://... username [password]" >&2
  exit 1
fi

# Typical URL: ftp://ftp.ncftp.com/2.7.1/ncftpd-2.7.1.tar.gz

if [ "$(echo $1 | cut -c1-6)" != "ftp://" ] ; then
  echo "$0: Malformed url.

How to search duplicate files within two directories?

#!/usr/bin/perl
use strict;
use warnings;

# findDupeFiles:
# This script attempts to identify which files might be duplicates.
# It searches specified directories for files with a given suffix
# and reports on files that have the same MD5 digest.
# The suffix or suffixes to be searched for are specified by the first
# command-line argument - each suffix separated from the next by a vertical bar.
# The subsequent command-line arguments specify the directories to be searched.
# If no directories are specified on the command-line,
# it searches the current directory.

How to add "Command Prompt Here" to Nautilus/Gnome?

Command Prompt Here: Windows developers are familiar with the tiny utility "Command Prompt Here" which allows them to open the command prompt from the windows explorer, with the working directory set to the current directory selected in the windows explorer.

Run Commands Effectively in Linux

There are various ways to launch applications and run commands in Linux. Which method is best is a matter of personal taste and individual productivity needs. Here I will discuss some of the best methods available in Linux to do the common quotidian tasks easier and faster.

Command Prompt

The basic method of running commands is through the gnome-terminal, i.e. the command prompt in the Windows language. To run gnome-terminal, just press ALT+F2, type "gnome-terminal" and press the enter key.

How to install the latest Adobe flash player in Linux?

Adobe® Flash® Player 10, introduces new expressive features and visual performance improvements that allow interactive designers and developers to build the richest and most immersive Web experiences.