Author: mahendra
-
Mysql db backup batch script for windows
This is an example of very simple mysql database backup batch script for windows machines: @echo off REM “MySql Backup Initiated” REM “Mysql username/password” SET mysqlUsername=”root” SET mysqlPassword=”root” REM “Creating folder with date stamp” set datestamp=%date:~-4,4%%date:~-10,2%%date:~7,2% mkdir D:\backup\dbBackup\mysql_%datestamp% SET backupDir=”D:\backup\dbBackup\mysql_%datestamp%” REM “Database backup Started” SET mysqlCmdDir=”c:\Program Files\MySQL\MySQL Server 5.5\bin” cd %mysqlCmdDir% mysqldump -uroot -proot exampledb…
-
How to automate ssh
Please find below the script and run form client machine from where you want to set login without password. #!/bin/bash #withoutPasswordLogin.sh #Author : Mahendra Pratap Singh #Created on : Dec 18, 2013 #Modified on : Dec 18, 2013 #Version : 1.1 #Description : This script is to automate login on linux machine without password, Script…
-
How to Check sudo using shell script
Please find the below the code: #!bin/bash #Sudo Check sudoCheck() { uid=`id | sed -e ‘s;^.*uid=;;’ -e ‘s;\([0-9]\)(.*;\1;’` if [ “$uid” = “0” ] ; then SUDO=” ” else SUDO=`which sudo 2>/dev/null` if [ -z “$SUDO” ] ; then echo “ERROR sudo not found!” exit 1 fi fi } main() { sudoCheck } main Different…
-
How to get IP address in shell script
There is many ways to get IP address some popular and easier are mentioned below- In Example 2 we may get IP from particular interface. Example 1: !/bin/bash IPADDRESS=`ifconfig | awk -F’:’ ‘/inet addr/&&!/127.0.0.1/{split($2,_,” “);print _[1]}’` echo “Machine IP address is: $IPADDRESS” Example 2: !/bin/bash IPADDRESS=`ifconfig eth0 | grep ‘inet addr:’ | cut -d: -f2…
-
HTTP Error 500.21 – Internal Server Error
Problem: Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list Detailed Error Information Module IIS Web Core Notification ExecuteRequestHandler Handler PageHandlerFactory-Integrated Error Code 0x8007000d Requested URL http://Demo.com/index.aspx Physical Path C:\Demo\index.aspx Logon Method Anonymous Logon User Anonymous Most likely causes: Managed handler is used; however, ASP.NET is not installed or is not installed completely.…
-
Samba Server version 4 as Domain Controller on Linux (Centos 6.4)
Introduction: Installation and configuration of Samba Server version 4 as a Domain Controller which is compatible with Microsoft’s Active Directory, to use of Microsoft Windows clients for domain services such as Domain Logon, share folder etc. Assumption: 1. Domain: testdomain.com 2. Netbios name: TESTDOMAIN 3. SELINUX is disabled Note: Before start the installation make sure…
-
Subversion SVN Server on Linux Part-1
Introduction: Subversion SVN Server most widely used software version and revision control open source software, used by developer to maintain historical data as source code and file. Software Dependencies: Apache, Subversion, mod_dav_svn and mod_ssl Installation: [root@localhost ~]# yum install httpd subversion mod_dav_svn mod_ssl -y Prerequisites: Make directory where do you want to put your svn…
-
How to block youtube website on Juniper SRX 220 firewall
Action Plan: To block “http://www.youtube.com” for users/subnet using Juniper web-filtering and IDP configuration Web filtering configuration: #set security utm custom-objects url-pattern youtube value “http://www.youtube.com” #set security utm custom-objects custom-url-category youtube value youtube #set security utm feature-profile web-filtering url-blacklist custom-deny #set security utm feature-profile web-filtering type juniper-local #set security utm feature-profile web-filtering juniper-local profile local-engine default…
-
Installation of Skype on Fedora 17 64bit
Step-1: Download Skype from Link – http://download.skype.com/linux/skype-4.0.0.8-fedora.i586.rpm Step-2: install following Dependencies – t# yum -y install qt-x11.i686 libXScrnSaver.i686 alsa-plugins-pulseaudio.i686 libXv.i686 Step3-Install skype – # rpm -ivh skype-4.0.0.8-fedora.i586.rpm –nodeps Enjoy! with it. Different remedies existing from the Web to why to waste when and visit dispensary if you can easily purchase medications sit at home. There…
-
How to send mail to google apps accounts
Install ssmtp package: #yum -y install ssmtp* step-2 – Edit configuration file: #mv /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp.conf.bak //Create a new file #vi /etc/ssmtp/ssmtp.conf //Write following lines into newly created file root=xyz@domain // your email mailhub=smtp.gmail.com:587 hostname=xyz@domain //your email UseSTARTTLS=YES AuthUser=xyz@domain AuthPass=password // your email password FromLineOverrride=YES //Save file step-3 – Test send mail #echo “google…