Monday, December 19, 2011

Focus back



You probably don’t want to admit it but you love distractions. In fact, just like monkeys, you get a shot of dopamine every time something pulls you in another direction. Why do you think you check your email so much?
Want to be more productive and get your focus back? There are no secret tricks here… do one thing at a time. Stop multitasking—it’s just another form of distraction.


Here are his tips for staying productive:
  1. Work backwards from goals to milestones to tasks. Writing “launch company website” at the top of your to-do list is a sure way to make sure you never get it done. Break down the work into smaller and smaller chunks until you have specific tasks that can be accomplished in a few hours or less: Sketch a wireframe, outline an introduction for the homepage video, etc. That’s how you set goals and actually succeed in crossing them off your list.
  2. Stop multi-tasking. No, seriously—stop. Switching from task to task quickly does not work. In fact, changing tasks more than 10 times in a day makes you dumber than being stoned. When you’re stoned, your IQ drops by five points. When you multitask, it drops by an average of 10 points, 15 for men, five for women (yes, men are three times as bad at multitasking than women). 
  3. Be militant about eliminating distractions. Lock your door, put a sign up, turn off your phone, texts, email, and instant messaging. In fact, if you know you may sneak a peek at your email, set it to offline mode, or even turn off your Internet connection. Go to a quiet area and focus on completing one task.
  4. Schedule your email. Pick two or three times during the day when you’re going to use your email. Checking your email constantly throughout the day creates a ton of noise and kills your productivity.
  5. Use the phone. Email isn’t meant for conversations. Don’t reply more than twice to an email. Pick up the phone instead. 
  6. Work on your own agenda. Don’t let something else set your day. Most people go right to their emails and start freaking out. You will end up at inbox-zero, but accomplish nothing. After you wake up, drink water so you rehydrate, eat a good breakfast to replenish your glucose, then set prioritized goals for the rest of your day. 
  7. Work in 60 to 90 minute intervals. Your brain uses up more glucose than any other bodily activity. Typically you will have spent most of it after 60-90 minutes. (That’s why you feel so burned out after super long meetings.) So take a break: Get up, go for a walk, have a snack, do something completely different to recharge. And yes, that means you need an extra hour for breaks, not including lunch, so if you’re required to get eight hours of work done each day, plan to be there for 9.5-10 hours.
for a complete article you can visit the below link

http://www.inc.com/ilya-pozin/7-things-highly-productive-people-do.html

Sunday, December 11, 2011

Monitoring Guidelines

  • Keep it simple stupid.
    • Start with simple monitoring, like PING to make sure that the host is up and standard checks like http, smtp and so on to make sure that standard services are up. Going from no monitoring to basic monitoring is a huge step and many organizations do not have the processes to handle more complex monitoring.
    • The next step is disk, CPU and memory on hosts. On network devices are port load, cpu load, network link.
    • Third step is to dig into bussiness critical applications and services.
  • Small iterations. Do not try to build a top of the line monitoring solution from day one. You will never leave the startup phase.
  • Let the monitoring solution pull the status instead of sending the status to the monitroing solution. This avoid complicated rules when different types of information is sent to the monitoring solution. So avoid sending SNMPtraps.
  • The monitoring solution is NOT a trashcan where to send tons of uninteresting garbage. It is far to common that HW vendors recommends to send thousands of unnecessary SNMPtraps to the monitoring solution and just a few is interesting. It is a nightmare to create the ruleset to figure out what is interesting, especially if there is dependencies where one message is interesting if another message has been sent before. The documentation is a badly written  MIB on a couple of hundered pages. In almost every case I’ve run into with this approch the implementation never ends and test cases are hard to create. When the systems are in production I can bet on that a critical event will occour which has not been taken care of and the production will stop. Managers will be upset, vendors will blame each other and customers will be angry.
  • Let the status be availiable easily:
    • via standard APIs, Perl and Bash is the most common.
    • SNMP via SNMPget instead of SNMPtraps
    • Status stored in a database, the monitoring solution can run SQL quries to get the status.
    • Commands the can be runned by the monitoring solution and the output parsed, or even better, exit codes are used and documented.
  • Normally it is not a good idea to read a log file to understand the status of of the software.
http://www.it-slav.net/blogs/2009/08/30/general-systems-and-network-management-guidelines-part-1/

Monday, November 7, 2011

How to Delete Exchange 2007 Logs manually | ESUTIL for intergrity Checking


Go to the bin directory of your exchange
C:\Program Files\Microsoft\Exchsrvr\bin>eseutil /mk  E:\Logs\e00.log

if you receive 
Operation terminated with error -1032 (JET_errFileAccessDenied, Cannot access file, the file is locked or in use) after 30.83 seconds.

that means that your data base is in mounted state, you have to dismount the exchange database and run the command again.


If the database is still mounted, use the following steps to dismount the database, and then run ESEUTIL:
  1. Start Exchange System Manager.
  2. Right-click the database that you want to dismount.
  3. Click All Tasks, and then click Dismount Store.
If you wish to use the ESEUTIL /k option on log files you'll need to stop the Microsoft Exchange Information Store service. To do so follow these steps:
  1. Start the Services applet in the Administrative Tools folder.
  2. Right-click the Microsoft Exchange Information Store service.
  3. Click Stop.
After the integrity check is over you must start the Microsoft Exchange Information Store service. To do so follow these steps:
  1. Start the Services applet in the Administrative Tools folder.
  2. Right-click the Microsoft Exchange Information Store service.
  3. Click Start.



 

Tuesday, October 4, 2011

Backup Deletion X no. of days

vi rmbackup.sh

#!/bin/bash
set -x
###Script for cron to delete backups
DIRECTORY=/home/BackupLocation/
DELETEOLDERTHAN="3"
find $DIRECTORY -type f -ctime +$DELETEOLDERTHAN
ls -la | mail -s "backup delete $HOSTNAME -'date'" abc@yourdoamin.com
exit 0

save and exit and chmod +x rmbackup.sh

Put the above script in cron
#crontab -e

*  3  * * * /home/rmbackup.sh

==================================================
Rsync Remote host backup script : Put this script on the machine where you want to take/pull the backup. generate the rsync key
#!/bin/sh
RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
KEY=/root/rsync/mirror-rsync-key
RUSER=ursync                                              : create a user for rsync
RHOST=hostname of the remote machine
RPATH=/var/www/html/                                : remote data backup path
LPATH=/var/www/html/                                : Local Path
$RSYNC -azq --delete -e "$SSH -i $KEY" $RUSER@$RHOST:$RPATH $LPATH



Another way

Delete directory based on the time stamp. The below command will delete all the directories with time stamp 2012.

** you need to run this command in the same directory

rm -vrf `ls -lh | sed -n '/2012/p' | awk '{print $8}'`



Wednesday, September 7, 2011

How to Setup FTP and an anonymous FTP server with vsftpd with upload enable

Setup vsftpd in CentOS
yum install vsftpd
chkconfig vsftpd on
service vsftpd start
cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.original
anonymous_enable=NO
listen=YES
local_enable=NO
anonymous_enable=YES
write_enable=NO
anon_root=/var/ftp
anon_max_rate=2048000
xferlog_enable=YES 


   
 
 
 
Setup Anonymous FTP with upload enable
#
vim /etc/vsftpd/vsftpd.conf
anon_root=/myftpDir/pub
listen_port=21
listen=YES
local_enable=YES
anonymous_enable=YES
write_enable=YES
anon_max_rate=2048000
xferlog_enable=YES
ftp_username=ftp
anon_upload_enable=YES
anon_mkdir_write_enable=YES
#anon_other_write_enable=YES
anon_world_readable_only=NO
ftpd_banner=(All Activities are monitored on this system!!)
log_ftp_protocol=YES
no_anon_password=YES
local_umask=022

save & exit by :wq

Now
Make sure that root directory  is not  being writable
The ftp root directory MUST NOT be owned by ftp for security reasons (it should be root:root).

Change the permission as below:
chmod u-w /myftpDir/pub
mkdir /myftpDir/pub/upload
chown u-w /myftpDir/pub/upload






Monday, September 5, 2011

SAMBA


yum -y install samba samba-client
service smb start
chkconfig smb on
mkdir /data
mkdir /data/share
chmod 766 /data/share
mv /etc/samba/smb.conf /etc/samba/smb.conf.backup
vim /etc/samba/smb.conf
 
Samba Config - smb.conf
[global]
workgroup = workgroup
netbios name = abc
security = SHARE
load printers = No
default service = global
path = /data
available = No
encrypt passwords = yes

guest account = nobody
[ShareLocation]
guest ok = yes
guest only = yes
path = /ShareLocation
read only = yes
browseable = yes
save and exit by :wq
============================

Friday, July 1, 2011

Increase Ulimit in CentOS 5


1) edit /etc/sysctl.conf to add this line:
fs.file-max = 2048
2) sysctl -p
3)Vim /etc/security/limits.conf and add ther following lines

* soft nofile 65535
* hard nofile 65535
4)ulimit -n 65535

Friday, May 27, 2011

Simle logs backup script

[root@mywebServer cron.daily]# vim httpdbackup
#!/bin/sh
cd /var/log/httpd/
tar -zcf httpd.tgz .
mv httpd.tgz /home/public/backup/
cd /home/public/backup
ls -la | mail -s "backup $HOSTNAME -'date'" myEmailID@companyDomainName.com

Tuesday, April 19, 2011

Samba without Password

vim /etc/samba/smb.conf

Change it to :>

# security = user
security = share

also remove the semicolon from the below line.

guest account = nobody
[ABCProject]
guest ok = yes
guest only = yes
path = /Path to ABC Project
read only = yes
browseable = yes

[Share name]
writable = yes
path = /path/to/directory
public = yes
guest ok = yes
guest only = yes
guest account = nobody
browsable = yes

save and exit
:wq

/etc/init.d/samba restart

that's all.


Tuesday, April 5, 2011

Active Directory and DNS Health Check

Dcdiag.exe /v >> c:\Reports\pre_dcdiag.txt

This is a must and will always tell you if there is trouble with your DCs and/or services associated with it

Netdiag.exe /v >> c:\Reports\pre_Netdiag.txt

This will let me know if there are issues with the networking components on the DC.

Netsh dhcp show server >> c:\Reports\pre_dhcp.txt

Some may not do this but I've felt the pain of a DHCP server somehow not being authorized after a patch. This allows me verify the server count and names.

Repadmin /showreps >> c:\Reports\pre_rep_partners.txt

This shows all my replication and if it was successful or not. Just be aware that Global Catalogs will have more info here than a normal domain controller.

repadmin /replsum /errorsonly >> c:\Reports\pre_repadmin_err.txt

This is the one that always takes forever but will let you know who you are having issues replicating with.

DNSLINT is a good tool for checking your DNS


http://www.microsoft.com/downloads/en/details.aspx?FamilyID=dd7a00df-1a5b-4fb6-a8a6-657a7968bd11

http://technet.microsoft.com/en-us/library/cc976711.aspx

http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=CB42FC06-50C7-47ED-A65C-862661742764

Risk and Health Assessment Program for Active Directory (ADRAP) – Scoping Tool v1.6

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=22205827-C164-4B62-9F8D-C3CD6077BD82

Microsoft Assessment and Planning Toolkit
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=67240B76-3148-4E49-943D-4D9EA7F77730

Microsoft Baseline Security Analyzer 2.2 (for IT Professionals)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=02BE8AEE-A3B6-4D94-B1C9-4B1989E0900C

Microsoft Exchange Best Practices Analyzer v2.8
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=DBAB201F-4BEE-4943-AC22-E2DDBD258DF3

Microsoft Active Directory Topology Diagrammer
http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=CB42FC06-50C7-47ED-A65C-862661742764

Microsoft Office Visio 2007 Professional Add-In for Rack Server Virtualization (Virtual Rack)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=3250331A-0116-4064-92D1-50B9B0727B75

Remote Server Administration Tools for Windows 7
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7D2F6AD7-656B-4313-A005-4E344E43997D

Microsoft Exchange Server User Monitor
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9A49C22E-E0C7-4B7C-ACEF-729D48AF7BC9

Thursday, February 17, 2011

error parsing the server clients.xml file windows xp

Please try the following:

1) UnInstall KB982168 patch from "Add remove program".

2) Try to connect with vSphere Client to a server, which error messages do you get?

This was caused by a .Net 3 SP2 patch

Tuesday, January 18, 2011

MPLS Vs IPLC

MPLS is called multiprotocol because it works with the Internet IP, ATM, and frame relay network protocols. With reference to the OSI model, MPLS allows most packets to be forwarded at the layer 2 (switching) level rather than at the layer 3 (routing) level. In addition to moving traffic faster overall, MPLS makes it easy to manage a network for quality of service (QoS).
A Label Switch Path (LSP) can be established in MPLS that crosses multiple Layer 2 transports like ATM, Frame Relay or Ethernet. Thus, one of the true promises of MPLS is the ability to create end-to-end circuits, with specific performance characteristics, across any type of transport medium, eliminating the need for overlay networks or Layer 2 only control mechanisms.
IPLC basically uses Layer 3 (Routing) to build a path for the data to flow in the network. Data routing in an IPLC is done using complex route lookups based on the destination IP address. The routing hardware finds the shortest path between the source and destination IP addresses to send data. This can be a hardware intensive task in times of heavy traffic leading to slower data traffic speeds. With hardware becoming more powerful every day, this is not such a major issue.
However, IPLC has major drawbacks in situations where traffic engineering and setting performance characteristics for different classes of traffic are required. Factors like delay and jitter also come into the picture in an IPLC connection that can cause major drops in QoS levels. This can cause problems in networks where data like video-conferencing are used.
MPLS has an edge over IPLC on this front since it provides network administrators the ability to set the path traffic will take through the network, and set performance characteristics for a class of traffic.

If your network requirements are such that you only need point-to-point connectivity, an IPLC typically will cost less than an MPLS circuit. Since an IPLC is your own private circuit, you can use your managed switches to prioritize traffic. But if you have any near future to add a third node to this network, MPLS will be the best way to go

MPLS could provide at least 2 types of link for this.
a) You can have a layer 2 MPLS (which sort of pretends to be an Ethernet WAN link of various flavours).
this type of service normally needs Ethernet access at each site -so you can connect directly to your LAN switches (but you shouldstill route over the WAN to control what is going on).

Or go for a L3 service - tends to cost more, but more flexible, and likely to allow other services if you want them.
Then you have to decide whether you run the CE routers on the service, or get that bundled, or hook direct to your WAN switches.
Then decide what QoS you want if any, what speed access tails and what type of connections, then possibly how much bandwidth to be rate limited.

The flip side with MPLS is someone else is looking after it for you, and you can add more sites since you have connected to a "cloud" service.

CentOS upgrade from 5.2 to 5.5 (final)

How to upgrade CentOS

#ps auxwww | grep -i yum
#kill -9
Remove any excluded packages by commenting out any exclude=XXXXX lines in /etc/yum.conf
#yum -y upgrade

This will upgrade the kernal as well.

you need to reboot the machine to reflect the new kernel.

If you just want to upgrade the kernel not the OS packages.


#yum upgrade kernel
or
#yum upgrade kernel-smp (4+ gb ram)

when the kernel upgrade completes edit the grub.conf

nano /boot/grub/grub.conf

default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.32.1.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-194.32.1.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-194.32.1.el5.img
title CentOS (2.6.18-92.1.13.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-92.1.13.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-92.1.13.el5.img
title CentOS (2.6.18-92.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-92.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-92.el5.img


here point to note
Grub starts at 0, so "default=0".

reboot the machine by
shutdown -r now
or
init 6

When it comes back up run uname -a to make sure it has the new kernel.


If you want to use your old kernel then set "default=1"

Monday, January 17, 2011

How to install xdebug & MysqlND on CentOS

1. yum install php-pear

2. Yum install php-devel

The pecl command can then be found at /usr/bin/pecl

You can just use the pecl command to install new extensions like

3.sudo pecl install xdebug

Build process completed successfully

Installing '/var/tmp/pear-build-root/install-xdebug-2.1.0//usr/lib/php/modules/xdebug.so'

install ok: channel://pecl.php.net/xdebug-2.1.0

You should add "extension=xdebug.so" to php.ini

At this point, you should open your php.ini file an add the line as suggested, but use the zend_extension directive as follows:

zend_extension = usr/lib/php/modules/xdebug.so

How to Test it

vim xdebug.php

function test(){

echo "Called @ ".xdebug_call_file().

":".xdebug_call_line()." from".

xdebug_call_function();

}

test();

?>

:wq (Save and exit)

now

# php -e xdebug.php

should return like

Called @ /root/phpscript.php:8 from{main}

wow, you are done....

mysqlnd is a 5.3 feature

MySQLnd will most likely be the database driver for both the PDO MYSQL extension

and mysqli extension in PHP 5.3. It is still under development, but there are

currently releases for the mysqli extension.

The MySQL native driver for PHP is part of the official PHP source code repository at

http://php.net. It is contained in the PHP source code as of PHP 5.3.

If you are compiling PHP yourself, please use the configure options

--with-mysql=mysqlnd, --with-mysqli=mysqlnd and --with-pdo-mysql=mysqlnd

to compile PHP with mysqlnd support.

Let’s see how PHP and MySQL works together. Here is the list of three extensions which PHP uses to connect to MySQL.

mysql
mysqli
pdo mysql

All of the above mentioned extensions are rely on MySQL’s client library libmysql. Mysqlnd is an another and alternative way of connecting PHP 5 and PHP 6 to the MySQL Server. Now the question arises why use Mysqlnd instead of other extensions ?

Here is the list of advantages of Mysqlnd library over other mentioned extensions.

  • It is very easy to compile, it does not have any dependencies issues with mysql client programming support.
  • It performs much better then libmysql in certain cases.
  • It provides persistent connections for mysqli.
  • It key feature is that it uses PHP memory management and it supports PHP memory limit.
  • It is famous for reducing memory footprint because it stores every row only once in memory while in the case of libmysql it is saved twice in memory.

By default the MySQL database extensions are configured to use MySQL Client Library. In order to use the MySQL Native Driver, PHP needs to be built specifying that the MySQL database extensions are compiled with MySQL Native Driver support. This is done through configuration options prior to building the PHP source code.

For example, to build the MySQL extension, mysqli and PDO MYSQL using the MySQL Native Driver, the following command would be given:

./configure --with-mysql=mysqlnd \

--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd \

[other options]

As most of the pre-packaged PHP binary installations may not have the support for mysqlnd enabled by default, it is recommended to build PHP and the required database extensions with mysqlnd from the source code


Upgrade PHP 5.1 to 5.3 on CentOS 3

# yum install yum-priorities

# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-6.ius.el5.noarch.rpm

# yum install httpd

# yum remove php php-*

# yum install php53u-pear php53u php53u-cli php53u-common php53u-devel php53u-gd php53u-mbstring php53u-mcrypt php53u-mysql php53u-pdo php53u-soap php53u-xml php53u-xmlrpc php53u-bcmath php53u-pecl-apc php53u-pecl-memcache php53u-snmp

# vi /var/www/html/phpinfo.php




// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>

# service httpd restart

Finally browse to your phpinfo.php http://x.x.x.x/phpinfo.php and view your newly configured PHP 5.3.3 Apache server.