Posts

Upgradig Cisco IOS on Catalyst Switch/3750 using CLI from Local Computer. Assign IP to VLAN iterface to your switch e.g VLAN1| Switch(config)#interface vlan 1 Switch(config-if)#ip address 192.168.100.10 255.255.255.0 Switch(config-if)#end Assign IP of same subnet to you local PC 192.168.100.5/255.255.255.0 no need defaulg gateway Verify connection Switch#ping 192.168.100.5 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.100.5, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/203/1006 ms Switch# Download, install,RUN TFTP server on local computer Copy the latest firmware to TFTP directory. Check the flash available memory space, about 20MB is free. Switch#show flash Directory of flash:/     2  -rwx        2072   Mar 7 1993 00:09:32 +00:00  multiple-fs     8  drwx         192  Apr 14 1993 14:17:45 +...

Linux Cheat sheet

Basic Operation # hostame - Displays the hostname and/or FQDN of the system # uname -a - Displays the hostname and detailed kernel version # cat /etc/redhat-release - Displays the version of Linux installed Example: # cat /proc/cpuinfo - Displays information about the CPU(s) # df -h - Displays the partitions, their sizes details, and mount points # free - Displays detail about the system memory and usage # lsof - Displays all open files # lsof -nPi: 22 - Displays any open files which use port 22 # locate httpd.conf - Displays the full path to any file named httpd.conf # updatedb - Rebuilds index of files for search using the locate utility Copy, Move, Delete # cp file1.txt file2.txt - Copies file1.txt to file2.txt # mv old.txt new.txt - Renames a file called old.txt to new.txt # rm file1.txt - Deletes file1.txt # mkdir httpds - Creates a new directory called httpds # cp -R httpd httpds - Recursively copies all files from directory httpd t...

Backing up mysql data bases daily,weekly and monthly

I recently find a script that does automatic backup of mysql data bases daily, weekly and monthly bases. Change the name of database e.g in this case is joomla Default backup directory is /var/backup, you can change other if you like. Script:See at bottom. Save the script as autobackupmysql, change permission to execute by #chmod +x autobackupmysql Test the script by executing it #./autobackupmysql Verify the backup at /var/backup, there will be three folders daily, weekly and monthly. Change directory to daily and folder name of your database name e.g joomla, you shall see your database there e.g joomla. Move script to to /etc/cron.daily for autoexecution. Script: #!/bin/bash # # MySQL Backup Script # VER. 2.5 - http://sourceforge.net/projects/automysqlbackup/ # Copyright (c) 2002-2003 wipe_out@lycos.co.uk # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Sof...

Basic Configuration of ASA

Image
Steps for setting up Inside and ouside interface with their ip address interface ethernet 0/0 as Insidie : 10.0.0.1            default security level 100 interface ethernet 0/0 as Outside: 170.100.100.1 default security level 0 ciscoasa> en Password: (there is no password for first time use) ciscoasa# configure terminal ciscoasa(config)# interface ethernet 0/0 ciscoasa(config-if)# ip address 10.0.0.1 255.255.255.0 ciscoasa(config-if)# nameif inside INFO: Security level for "inside" set to 100 by default. ciscoasa(config-if)# no shutdown ciscoasa(config-if)# ciscoasa(config-if)# interface ethernet 0/5 ciscoasa(config-if)# ip address 170.100.100.1 255.255.255.0 ciscoasa(config-if)# nameif outside INFO: Security level for "outside" set to 0 by default. ciscoasa(config-if)# no shutdown Confgure ASA to accept HTTPS connections from inside Configure from global configuration ciscoasa(config-if)# exit cisco...

Installation of GNS3 on Windows

Installation of GNS3 on Windows (7) It is better if you have already install loopbak interface on your machine. VMware Workstation: Download from vmware site. Loopback interface : Installation of  loopback interface on windows 7 GNS3 : Download  GNS3: GNS3 v08.2 all-in-on, this will intstall all necessary tools and packages. Cisco router IOS images: Download   IOS-images   from this location Cisco ASA firewall IOS and ASDM : Download  ASA_IOS  and ASDM-645-204 TFTP server:   Download  and run the setup to install.

Intrusion Detection and Prevention Using OSSEC

What is OSSEC? According to OSSEC "It is an Open Source Host-based Intrusion Detection System. It performs log analysis, file integrity checking, policy monitoring, rootkit detection, real-time alerting and active response." Installation on Debian Server I installed on Debian .6.24-19-server, already running web service. Install environment Make sure you have compiler e.g gcc or cc and 'make' already installed in your system, otherwise you will get error message and abort the installation process. root@www:/usr/local/src/ossec-hids-2.4.1# apt-get install gcc Dwonload the latest build from www.ossec.net website Extract into folder and start installation imran@web:~/ossec-hids-2.4.1$ tar -zxvf ossec-hids-2.4.1.tar.gz imran@web:~/ossec-hids-2.4.1$ cd ossec-hids-2.4.1/ Run the installation script; root@web:~/ossec-hids-2.4.1# ./install.sh ** Para instalação em português, escolha [br]. ** 要使用中文进行安装, 请选择 [cn]. ** Fur eine deutsche Installation wohlen Sie [de]. ** Για ε...

Intrusion Detection Service in IPCOP

Intrusion Detection was stopped in my IPCoP, version 1.4.1, a while a go, I tried to start them all three through GUI but Got message fail to start. I loged in in console of Ipcop. I checked the existing version of snort, which was older than latest. r oot@firewall:/etc/snort/rules # snort --version snort: unrecognized option `--version' ,,_ -*> Snort! o" )~ Version 2.6.1.5 (Build 59) '''' By Martin Roesch & The Snort Team: http://www.snort.org/team.html (C) Copyright 1998-2007 Sourcefire Inc., et al. And when tried to start the snort using this command root@firewall:~ # snort -c /etc/snort/snort.conf -l /var/log/snort/ I got error that there is error in line # 38 in exploit.rules file located in /etc/snort/rules/ folder. When I tried to comment the line it gives error on line#39. Solution Replace the existing rules folder with working one. For that I installed the latest snort in my laptop, and check the version. imran@imra...

MyCRM Connector Tool for Google Calendar Error

After installation of " MyCRM Connector Tool", followed the procedure described in manual. The test machine shows successful result when configured Google calander under My Account. But production CRM gives following error. "Fatal error : Call to undefined function curl_init() in /home/path/googlecal/MyCurl.php on line 32" The solution is install php5-curl libraries. root@server:~# sudo apt-get install curl libcurl3 root@server:~# sudo apt-get install php5-curl root@server:~# apt-get install php5 I also restarted the mysql server and apache2 just for precaution, not necessary. Recheck settings after entering my Google email address it worked. Got this message. ****** Get events from meetings Synced successfully. ****** Get events from calls Synced successfully. ****** Get events from tasks Synced successfully.

Daily Backup Using RSYNC

Using these steps your system backup automatically using rsync . Step 1: Generate a Public Key using ssh-keygen at Host machine. root@home:~# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: 19:44:5f:1c:92:27:26:25:9b:13:df:dc:89:71:f0:c1 root@home Step 2: Insert the key to authorized_key at host machine root@home:~# cd /root/.ssh/ root@home:/root/.ssh# ls id_rsa id_rsa.pub known_hosts root@home:/root/.ssh# cp id_rsa.pub authorized_keys root@home:/root/.ssh# ls authorized_keys id_rsa id_rsa.pub known_hosts root@home:/root/.ssh# Step 3: Copy the ~/.ssh/authorized_keys file to the remote(back) machine As the backup machine storing backup of several machines, authorized_keys file already exits, just copy the li...

Cloning SugarCRM

Step 1: Clone the sugarcrm Directory There is a script "CopySugarFile.sh" , see script also in bottom. Running the Script, remember you have to provide the paths both source directory and clone directory. root@imran:~# ./sugarclone Missing First Argument: Syntax: copySugarFiles.sh /var/www/html/FROM_SUGAR_DIR /var/www/html/TO_SUGAR_DIR exited with status -1 root@imran:~# ./sugarclone /var/www/sugar /var/www/clone Compressing /var/www/sugar Sugar and saving to /home/imran/sugarFilesFromBackup201001111322.tgz Compressing /var/www/clone Sugar and saving to /home/imran/sugarFilesToBackup201001111322.tgz tar: Cowardly refusing to create an empty archive Try `tar --help' or `tar --usage' for more information. Extracting the /var/www/sugar Sugar tgz to /var/www/clone Sugar directory Script complete. Step2: Clone the Database First Create a new database for Cloning e.g clone Export the sugarcrm database using PHPMyAdmin tool e.g sugarcrm.sql Import the sugarcrm.sql data into ...

SugarCRM Changing Max file Upload Limit

In sugar while uploading a file as attachment to e.g Marketing->Accounts->youraccount->Create Note or Attachment. I tried to upload a file size 20M, it did not attached and no error message as well. Here is to fix this.After doing the following changes, performance of site also improves. Step 1: Change in SugarCRM Go to Admin->System Settings->Advanced change Maximum upload size e.g 41943040 (40M) default was 3000000 (3M) Step 2: Change in php.ini file Login to your server hosting the site, Go to /etc/php5/apache2/php.ini and change the following, Max, limit 40M post_max_size = 40M upload_max_size = 40M max_execution_time = 1000 max_input_time = 60 memory_limit = 128M imran@venus:/var/www/sugar$ sudo nano /etc/php5/apache2/php.ini ;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; max_execution_time = 100 ; Maximum execution time of each script, in seconds, 30s default max_input_time = 60 ; Maximum amount of time each script may spend pars...

NFS on Debian/Ubuntu

Installation of NFS on server Considering how powerful NFS is and the flexibility it gives you it is amazingly simple to set up. I expected it to be on a par with setting up Samba which can be a complete nightmare. Typically when setting up Samba one would use Swat or another configuration tool. With NFS set us is as easy as entering the paths you want exported into /etc/exports and making sure the correct packages are installed. There are two implementations of NFS one runs in kernel space (nfs-kernel-server) the other in user space (nfs-user-server). The kernel space implementation is faster and more stable but if something goes wrong it could bring your box down. In reality the kernel space NFS implementation very rarely fails. I have been running it for years (and on at least one occasion for 150 days straight) and have had it fail only a couple of times. The times it did fail it simply needed restarting. In fact the only way I have even managed to get it to make a noise is when...

Upgrading Subversion in Ubuntu 9.10 server

Step 1:Install the subversion apt-get install subversion libapache2-svn Step 2: Create the repository svnadmin create /svn Configuration Edit the directory /etc/apache2/mods-enabled/dav_svn.conf # Uncomment this to enable the repository, DAV svn # Set this to the path to your repository SVNPath /svn # Uncomment the following 3 lines to enable Basic Authentication AuthType Basic AuthName “Subversion Repository” AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user Save and exit the file Creation of user htpasswd -cm /etc/apache2/dav_svn.passwd imran New password: Re-type new password: Adding password for user imran Enable ssl (if required) #a2enmod ssl This will enable the ssl if you have problem to set it. Migration Export by :Dumping the existing repository root@jupiter:/svn# svnadmin dump svn > reposdump.dmp Import by: root@saturn:/srv# svnadmin load srv-jupiter

Intrusion Detection (Snort) fixation in IPCOP Firewall 1.4.21

After installing the IPcop got the following error messages When running update the Error is: HTTP::Response=HASH(0x82a3c14)->code registered md5 When running download the Error is: HTTP::Response=HASH(0x82a3c68)->code The reason is that now snort.org publish rules now on current branch that are no more compatible with snort-2.6.1.5 We have manually add the current branch, to - date it is 2. You can find on snort if you have your account on snort.org under My Account-->My Oinkcodes along with the code (You must have account at snort to access code and use snort in IPCOP). Here is a solution, it is a manual fixation in the code. Open the /usr/local/bin/snortrules.pl in and editor. root@firewall:/etc/snort # nano /usr/local/bin/snortrules.pl Change the value to 2.8 at line no 55. my $rulesbranch= "2.8" ; # version should match snort branch version Save the change. Remember you must have to add the oink code in IPCOP--> Services-->INTRUSION DETECTION. Save-Appl...

Wireless Chanel list in Ubuntu

Step 1: Install/Enable your Wireless Card Step 2: Scan the media using 'iwlist scan' root@imran-laptop:~/Desktop# iwlist scan lo Interface doesn't support scanning. eth0 Interface doesn't support scanning. wlan0 Scan completed : Cell 01 - Address: 00:1B:11:5A:BC:48 Channel:1 Frequency:2.412 GHz (Channel 1) Quality=43/70 Signal level=-67 dBm Encryption key:on ESSID:"pingcom" Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s 36 Mb/s; 48 Mb/s; 54 Mb/s Mode:Master Extra:tsf=000008f601582180 Extra: Last beacon: 2732ms ago IE: Unknown: 000770696E67636F6D IE: Unknown: 010482848B96 IE: Unknown: 030101 IE: Unknown: 2A0100 I...