Wednesday, December 24, 2014

Configure Multiple Concurrent RDP Clients In Windows 7

1. Download Patch/crack Required to enable-concurrent-multiple-RDP-sessions:
Windows 7 patch:UniversalTermsrvPatch_20090425.zip (132.5 KB)
2. Install Patch Required to enable-concurrent-multiple-RDP-sessions
Run the Proper UniversalTerminalPatch Version ---> Patch -->  Restart the Machine
3. Configure Remote Settings:-
Take System Properties ---> Remote ---> Remote Desktop --->

Change IP Address Using A Batch File Script

                                       Netsh is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a computer that is currently running. Netsh also provides a scripting feature that allows you to run a group of commands in batch mode against a specified computer.
Set Static IP :-
cd\
cls
ipconfig/flushdns
ipconfig/release
netsh int ipv4 set address name="Local Area Connection" source=static address=192.168.172.17 mask=255.255.254.0 gateway=192.168.173.254
netsh int ipv4 set dns name="Local Area Connection" source=static address=192.168.0.5 register=primary validate=no
pause
Set Dynamic IP :-
@echo off
ipconfig /flushdns
ipconfig /release
netsh interface set interface "Local Area Connection" disable
netsh interface ip set dns "Local Area Connection" dhcp
netsh interface ip set address "Local Area Connection" dhcp
echo Wait 5 seconds...
ping -n 60 -w 1000 0.0.0.1 > nul
netsh interface set interface "Local Area Connection" enable

Friday, December 12, 2014

Apache Name Based Virtual Hosting + DNS Server

1. DNS Server / Wamp Server : (192.168.172.14)
  1. Install-Configure DNS Server
  2. Create Primar Zone “aview.org”
  3. Create two host file edx and studio and its should be pointed to same DNS Server IP
        edx.aview.org         ---->   192.168.172.14
studio.aview.org     ---->    192.168.172.14
  1. Install Wamp Server and make it should be working condition
  2. For Virtual hosting And Proxy Passing, Add the below mentioned modules in httpd.conf file
LoadModule headers_module modules/mod_headers.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule ssl_module modules/mod_ssl.so
  1. Modify the httpd.conf again
                under "# Virtual hosts", uncomment “#Include conf/extra/httpd-vhosts.conf”
screenshot of .httpd.conf file
                                        This tells Apache to include the file "httpd-vhosts.conf" (the file where we set our virtual hosts) when configuring its settings.
  1. Virtual Hosting In Apache: Edit the httpd.conf and add the lines
  ServerAdmin edx.aview.org
  ServerAlias edx.aview.org       
    ProxyPass / http://192.168.172.100/
    ProxyPassReverse / http://192.168.172.100/
    ServerAdmin studio.aview.org
    ServerAlias studio.aview.org       
    ProxyPass / http://192.168.172.100:9080/
    ProxyPassReverse / http://192.168.172.100:9080/
2. Web Server - Tomcat Running Server (192.168.172.100)
  1. Install Wamp And Tomcat Properly
  2. Configure Wamp Listen Port 80 and Tomacat listen port 9080
  3. Normally Wamp Listen locally.So Make it accessible from other machines.For this Edited the httpd.conf
   
    AllowOverride none
    #Require all denied
Allow from all
#Require local
Allow from all
3   Client  1 (192.168.172.1)
Check in Browser :- http://edx.aview.org   And    http://studio.aview.org

Installing And Configuring DNS Windows 2K3

                                   The Domain Name System (DNS) is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet or a private network. It translates domain names, which can be easily memorized by humans, to the numerical IP addresses needed for the purpose of computer services and devices worldwide.
                                     A DNS name server is a server that stores the DNS records for a domain name, such as address (A or AAAA) records, name server (NS) records, and mail exchanger (MX) records     
Installation Of DNS                         
1. Click Start --> Settings --> Control Panel → Add/Remove Programs --> Add/Remove Windows Components.
2. In Components, select Networking Services and then click Details.
3. In Subcomponents of Networking Services, select the Domain Name System (DNS) check box,
Creating a forward lookup zone
1. Click Start --> Programs --> Administrative Tools --> DNS.
2. Expand the DNS server  → Right-click the Forward Lookup Zone folder and choose New Zone.
3. Ensure that Standard Primary Zone is selected and Enter Zone Name : (eg:- aview.org)       
4. Create a Host (eg:- ictops) with Valid IP on the zone- aview.org.So the FQDN name is ictops.aview.org    
5. For testing just PING to the domain name :- ping  ictops.aview.org

Tuesday, December 9, 2014

Setting Passwords On CISCO Router/Switch

Set the Enable Password
ictops>enable
ictops#conf t    
ictops(config)#enable password password
Set Secret Password
           ictops(config)#enable secret password 
Set User Mode Password (Console Password)
        ictops(config)#line console 0
ictops(config-line)#password password
ictops(config-line)#login
Change All Passwords In Encrypted Format
           ictops(config)#service password-encryption 
Disabling the Enable and User Mode Passwords
For Disabling the Enable Password :-   ictops(config)#no enable password password
For Disabling the Console Password :- ictops(config-line)#no password password

Wednesday, November 5, 2014

Disable Or Remove Gmail Account From Android

                           Go to Settings->Accounts & Sync and touch your gmail account. It will show you options of what you can sync (Books, Calendar, Contacts, Gmail, Music). Touch the Gmail one and it won't sync your gmail account with that device.

Monday, November 3, 2014

Change Sender Name In mailx

                                     For Changing the Default sender name (the default address like root) in mailx, use the  following syntax
Syntax:-mailx -s "Subject" To Mail Address -- -r From Mail Address -F “Sender Name”
Eg:-  mailx -s 'Disk Space Alert' itteam@gmail.com  -- -r ictops@aerl.in -F "ICTOPS"
Where
-s is the subject
-r is the reply address
-F is the Full name of the sender
Output :-
from:     ICTOPS
to:     jaganponnus@gmail.com,
        aneeshktramrita@gmail.com
date:     Mon, Nov 3, 2014 at 12:38 PM
subject:     Disk Space Alert

Change Sender Mail Address In mailx

                          For Changing the Default sender mail address (the default address like root@ubuntu.com) in mailx, use the  following syntax
Syntax:-mailx -s "Subject" To Mail Address -- -r From Mail Address
                            The Usage info shows "[-- sendmail-options ...]" and since "-r" is a sendmail option, you need to use the double dashes first.
Eg:- mailx -s 'Disk Space Alert' itteam@gmail.com -- -r ictops@aerl.in << EOF

Quickly Make A Large File In Ubuntu

If you want to create a 10 GB File, follow the steps below listed
root@ubuntu:~# time dd if=/dev/zero of=large bs=10G count=1
dd: memory exhausted by input buffer of size 10737418240 bytes (10 GiB)
real    0m0.002s
user    0m0.000s
sys     0m0.000s
root@ubuntu:~# du -B 1 --apparent-size large
0       large
root@ubuntu:~# du -B 1 large
0       large
root@ubuntu:~# time fallocate -l 10G large
real    0m0.091s
user    0m0.000s
sys     0m0.008s

Friday, October 31, 2014

Send An Email Alert When Your Disk Space Gets Low

The following script alerts you when your root partition is almost full:
  1. Update the Server : - apt-get update
  2. Install mailx client :- apt-get install bsd-mailx
  3. Create a File disk.sh
  4. Add the Content
#!/bin/bash
CURRENT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g')
THRESHOLD=9
if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
    mail -s 'Disk Space Alert' ictops@gmail.com << EOF
Your root partition remaining free space is critically low. Used: $CURRENT%
EOF
fi
                                      The script sends an email when the disk usage rises above the percentage specified by the THRESHOLD variable (9% here).
Script automatically run when it added into the Crontab file
root@ubuntu:~# crontab -e
10 15 * * * /root/disk.sh (Execute the command at 3.10 pm everyday)

Wednesday, October 29, 2014

Set SSH Login Email Alerts In Linux Server

                        To enable server to automatically send a notification email to predefined email address every time someone logs in as root to the host. To configure the automatic email alert notification to a default email address on each incident of root logon on the server.
  1. Update the Server : - apt-get update
  2. Install Optional (apt-get install mailutils)
  3. Install mailx client :- apt-get install bsd-mailx
                  During the installation Its ask for selecting following features “Postfix Configuration and Package Configuration” (Leave its as Default)
  1. Login as root user and go to root’s home directory by typing cd /root command.
# cd /root
  1. Open .bashrc file with vi or nano editor. Please remember .bashrc is a hidden file, you won’t see it by doing ls -l command. You’ve to use -a flag to see hidden files in Linux.
        root@ubuntu:~# ls -a
.  ..  .bash_history  .bashrc  .cache  .profile  .viminfo
root@ubuntu:~# vi .bashrc
                                              Add the following whole line at the bottom of the file. Make sure to replace “ServerName” with a hostname of your Server and change “your@yourdomain.com” with a your email address.
Syntax:- echo 'ALERT - Root Shell Access (ServerName) on:' `date` `who` | mail -s
"Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" your@yourdomain.com
Eg:- echo 'ALERT - SSH Access Detected To (ubuntu) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" ictops@gmail.com
  1. Execute the following for instant result.
root@ubuntu:~# source .bashrc

Thursday, October 23, 2014

Schedule Tasks In Linux With CRON

Schedule Tasks In Linux With CRON
                                      There is an utility in Linux known as CRON with which you can start your jobs automatically at a desired time and schedule them to get executed periodically.
                                     Cron utility consists of two parts: The cron daemon and the cron configuration files. Cron daemon is just like any service that is started automatically whenever your system boots. Cron configuration files hold the information of what to do and when to do
  1. Edit a Crontab Entry :- crontab -e
  2. Select Favorite editor.If You select any other option, use the following command to open in VI editor
            export VISUAL=vi
     3. Create a new crontab file from another user
            crontab -l > name  (Created in Present Working Directory)
     4. Listing the Cron Jobs :- crontab –l
     5. To enlist the cron jobs for a particular user :- crontab –u [USER] –l
Example :- crontab –u root –l
     6. For deleting Crontab entry : - crontab -r
     7. For activating crontab entry : - crontab crontab name
Crontab syntax :-
                                           A crontab file has six fields for specifying minute, hour, day of month, month, day of week and the command to be run at that interval. See below:
  • 1: Minute (0-59)
  • 2: Hours (0-23)
  • 3: Day (0-31)
  • 4: Month (0-12 [12 == December])
  • 5: Day of the week(0-7 [7 or 0 == sunday])
  • /path/to/command - Script or command name to schedule
Easy to remember format:
*     *     *     *     *  command to be executed
-     -     -     -     -
|     |     |     |     |
|     |     |     |     +----- day of week (0 - 6) (Sunday=0)
|     |     |     +------- month (1 - 12)
|     |     +--------- day of month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)

Sample :-
  1. Created a bash script for making directory
root@IPAM:/home/ictops#vi job.sh
mkdir -p /home/ictops/test1
mkdir -p /home/ictops/test1
      2. Provide Executable permission :- chmod +x /home/ictops/job.sh
      3. Add this batch file “job.sh” into crontab entry for sheduling task
        root@IPAM:/home/ictops#crontab -l > mycron   
            no crontab for root
        root@IPAM:/home/ictops#crontab -e
no crontab for root - using an empty one
root@IPAM:/home/ictops#crontab -l > mycron   
root@IPAM:/home/ictops#crontab  mycron
bloggerwidgets