Tag Archives: linux

27Oct/15

Different Ways of File transfer to a remote server using ssh protocol

Different Ways of File transfer to a remote server using ssh protocol.

Scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.

Using scp from destination server

scp [email protected]_server:/path/to/file /path/here/
scp -P 2222 [email protected]_server:/path/to/file /path/here/ #with ssh port 2222
scp -r [email protected]_server:/path/to/directory/ /path/here/ #copy entire directory

Using scp from source server Continue reading

13Apr/14

Linux Shell Scripting – Functions

How do I create a shell script function using Bash under UNIX / Linux operating systems?

Functions are nothing but small subroutines or subscripts within a Bash shell script. You need to use to break up a complex script into separate tasks. This improves overall script readability and ease of use. However, shell function cannot return value. They return a status code.

All functions must be declared before they can be used.

function welcome(){
  Commands
}

OR

 
welcome(){
 Commands
 return $TRUE
}

You can call function by typing its name:

 
welcome

Continue reading

07Oct/13

Linux Shell Scripting – An Introduction

Linux Shell Scripting

Scripts are collections of commands that are stored in a file. The shell can read this file and act on the commands as if they were typed at the keyboard. The shell also provides a variety of useful programming features to make your scripts truly powerful.

Write a simple shell script

Use an editor software to write the script. The following is the simplest “Hello World” program.

#!/bin/sh
# My first script
echo "Hello World!"

and save the above script to the file name “myScript.sh”

We can use any name for saving the script. but here I am using “.sh” extension for my script, since the shell used here is “/bin/sh”. Also it will help us to identify the scripts from a other files and folders. Continue reading

18Sep/13

Cannot start Postfix – Postfix integrity check failed Error

Postfix was not running and an attempt to restart Postfix was failing with the following error in maillog.

mail postfix/postfix-script: fatal: Postfix integrity check failed!
mail postfix/postfix-script: fatal: the Postfix mail system is not running

We have tried a number of solutions and after a bit googling, we found the following command and running that resolved the issue. Continue reading

15Sep/13

ntVersionCheck : New release v1.1.0

cPanel plugin for finding the outdated applications in the server. Currently the plugin is configured for wordpress and joomla installations.

Features

  • Find all outdated wordpress and joomla applications in the cPanel Server
  • Display the wordpress and joomla versions with color difference for visibility
  • News, Announce the latest news related with application vulnerabilities and plugin updates
  • The installations are grouped by user and reseller wise
  • One click update available for future releases Continue reading
19Jun/13

Disable unwanted services – Linux Server

One of the first steps that we should do while presetting a server is to disable unwanted services on the server. The server should be preloaded with some services like bluetooth, X services, etc which are not required to a server normally. The number of such services will vary, based on the default packages installed by your provider. After a little research, we have compiled in a list of services that can be disabled on  Linux servers. Please note that this is a generic one and you should check the list before implementing it, if you are going to build any custom stuff. Normally it should work seamlessly with control panel installations, web services , etc.

The list of services that can be disbaled are listed below seprately for VPS and dedicated servers.

Continue reading