Author Archives: itquery

Windows bat script to get day of the week

rem Script to get the day of the week in windows command line rem ie Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday @echo off SETLOCAL SET /a count=0 FOR /F “skip=1” %%D IN (‘wmic path win32_localtime get dayofweek’) DO ( … Continue reading

Posted in Batch script, Windows | Leave a comment

Script to download email and attachment using perl

Download email and attachment using Perl script. #!/usr/bin/perl use strict; use warnings; use Net::POP3; use Email::MIME; #use Email::MIME::Attachment::Stripper; my $pop3server = ‘mypopservername’; my $username   = ‘myemail@address’; my $password   = ‘myPassW0rd’; my $popclient = Net::POP3->new( $pop3server, Timeout => 60 ); if … Continue reading

Posted in Perl Script | Tagged , , , , , | Leave a comment

WordPress sites backup shell script

WordPress sites backup shell script #! /bin/bash ## backup script for the wordpress site ## taking complete backup of website folder, database & apache configuration files ## itquery(at)gmail.com TIMESTAMP=$(date +”%F”) IPA=`hostname -I| awk ‘{print ($1)}’` BACKUP_DIR=”/backup/BKP_$IPA/$TIMESTAMP” #### Website folder path … Continue reading

Posted in Database, Shell script | Leave a comment

Installation of Microsoft Security Essentials on Windows Server 2012 and 2012 R2

 Installation of  Microsoft Security Essentials on Windows Server 2012 and Windows Server 2012 R2 Download Microsoft Security Essentials from Microsoft download site – http://windows.microsoft.com/en-us/windows/security-essentials-all-versions >>  Right Click on the mseinstall.exe. >> Properties >> Compatibility tab. >> Locate the Compatibility section. … Continue reading

Posted in Windows | Tagged , | Leave a comment

POODLE : Secure SSL configuration on apache

What is POODLE? POODLE stands for Padding Oracle On Downgraded Legacy Encryption Common Vulnerabilities and Exposures: CVE-2014-3566 What is POODLE attack? A man-in-the-middle exploit, which takes advantage of Internet and security software clients’ fallback to SSL 3.0 The attack occurs … Continue reading

Posted in Apache | Tagged , , , | Leave a comment

Web server securing guide

1   OS Hardening 1.1          Kernel hardening Update kernel parameter on /etc/sysctl.conf # Turn on exec shield kernel.exec-shield=1 kernel.randomize_va_space=1 # Enable IP spoofing protection net.ipv4.conf.all.rp_filter=1 # Disable IP source routing net.ipv4.conf.all.accept_source_route=0 # Ignoring broadcasts request net.ipv4.icmp_echo_ignore_broadcasts=1 net.ipv4.icmp_ignore_bogus_error_messages=1 # Make sure spoofed … Continue reading

Posted in Apache, Shell script, Unix/Linux | Leave a comment

Find and replace character in SQL script

 Find and replace character in SQL script UPDATE TABLE SET LoginId = REPLACE( LoginId, ‘_’, ‘.’ ), SSO = REPLACE(SSO, ‘_’, ‘.’ ) WHERE LoginId IS NOT NULL

Posted in Database, Unix/Linux | Tagged | 1 Comment

awk one liners

### In order to join 2 lines seprated with new line “^M” character $awk ‘/^M$/ {print;next;} {printf(“%s”,$0);}’ FileName.txt

Posted in Shell script, Unix/Linux | Leave a comment

Error during apache httpd starup

1. “[error] Init: SSLPassPhraseDialog builtin is not supported on Win32” Reason – Apache has been installed on windows and unable to start because HTTPS  configuration. Solution – a. Remove/comment SSLPassPhrase context fromssl.conf or httpd.conf b. Make a copy of the … Continue reading

Posted in Apache, Unix/Linux, Windows | Tagged , , | Leave a comment

4 Easy step for password less Self Signed Certificate

4 Easy step for password less Self Signed Certificate #openssl genrsa -des3 -out server.passwd.key 1024 #openssl rsa -in server.passwd.key -out server.key #openssl req -new -key server.key -out server.csr #openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

Posted in Unix/Linux | Tagged | Leave a comment