nav-left cat-right
cat-right

Remove everything in between two words from a file...

You can use the script below if you want to remove lines/words in between two specific words. Run it like: “./scriptname filename” where filename is name of the file from which you want to remove. You will have to edit following fields in the script: “Remove from” “Remove upto here” The script will match first occurence of “Remove from” and will remove upto the first occurence...

How can I remove all line starting with hash (#)...

To remove all lines starting with hast sign (#) from a file, try this: sed /^#/d filename The above command will remove all line starting with # from its output. If you want to write the output to another file, use o/p redirection > sed /^#/d filename > newfile But, if you want to over write the file with new o/p, use -i option with sed. sed -i /^#/d filename Regards, Mohammed.

How to create and use ssh keys (ssh-keygen)....

Here are the steps to create & use ssh keys. It’s very simple. Just use “ssh-keygen” command to create the key. Before doing this, create a folder “.ssh” in your home directory with permission as 700 mkdir --mode=700 ~/.ssh $ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/mohammed/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter...

ssh_exchange_identification: Connection closed by ...

While trying to logging into a Linux machine you may get the error: ssh_exchange_identification: Connection closed by remote host At the same time, you may be able to login to this server from some other machine. The most common reason for this error is, the machine from where you are trying to login is not allowed to access the server. Means, your local machine is not listed in /etc/host.allow file of the server. So,...

How to get files from an ISO image (Linux)...

The simplest way (that I know) to get files from an ISO image (over Linux) is by mounting it. # mount -o loop filename.iso /mnt/ISO_file # cd /mnt/ISO_file Now, you can see all files of the ISO image within /mnt/ISO_file.

Difference between $* and $@...

Run the script below and feel the difference shell]$ cat input #! /bin/bash echo "$# inputs" echo "" echo '"$@" output' for arg in "$@"; do echo $arg done echo "" echo '$@ output' for arg in $@; do echo $arg done echo "" echo '"$*" output' for arg in "$*"; do echo $arg done echo "" echo '$* output' for arg in $*; do echo $arg done shell]$...

How to reset MySQL root password using Ensim Contr...

Follow the steps below if you want to reset MySQL root password using Ensim. 1. Login to Ensim control panel as administrator. 2. Click on MySQL (under WebServer category) –> Change MySQL password. 3. Enter new password under “Change MySQL root Password” Try logging into MySQL after changing the password. If you are uanble to login using the new password, please check the box “Force Password...

Problems logging into Plesk because of IP restrict...

Problem: While logging into Plesk control panel, you may get the followin error: “Access for administrator from address xx.xx.xx.xx is restricted in accordance with IP Access restriction policy currently applied.” Resolution: This means Plesk IP access policy was configured in such a way that Plesk cannot be accessed from the current IP. To enable Plesk CP access one needs to login to Plesk Control Panel...

Error: undefined reference to 'errno'...

Error: undefined reference to ‘errno’ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ stralloc.a alloc.a error.a env.a str.a case.a fs.a open.a strerr.a(strerr_sys.o)(.text+0×8): In function `strerr_sysinit’: : undefined reference to `errno’ substdio.a(substdi.o)(.text+0×2c): In function `oneread’: : undefined reference to `errno’ substdio.a(substdo.o)(.text+0×43): In function `allwrite’: :...