Wednesday, October 30, 2013
iMacri tips
SIZE X=1360 Y=768
TAB T=1
URL GOTO=http://www.lexisnexis.com/hottopics/lnacademic/?shr=t&sfi=AC00NBEasySrch
FRAME F=2
TAG POS=1 TYPE=A ATTR=TXT:Power<SP>Search
TAG POS=1 TYPE=TEXTAREA FORM=NAME:searchForm ATTR=ID:terms CONTENT=acorda<SP>Pharmaceuticals<SP>stock<SP>offering
TAG POS=1 TYPE=SELECT FORM=NAME:searchForm ATTR=ID:dateSelector1 CONTENT=%from
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:searchForm ATTR=ID:fromDate1 CONTENT=1/1/2000
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:searchForm ATTR=ID:toDate1 CONTENT=1/1/2010
DS CMD=LDOWN X=223 Y=413 CONTENT=
DS CMD=LUP X=223 Y=413 CONTENT=
DS CMD=KEY X=223 Y=413 CONTENT=business<SP>wire
WAIT SECONDS=2
DS CMD=LDOWN X=223 Y=431 CONTENT=
DS CMD=LUP X=223 Y=431 CONTENT=
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:searchForm ATTR=VALUE:Search
Thursday, October 24, 2013
Monday, October 21, 2013
Friday, October 18, 2013
Parse error: syntax error, unexpected T_VARIABLE in \ /usr/local/apache/htdocs/stat/config.inc.php on line 25
Parse error: syntax error, unexpected T_VARIABLE in \
/usr/local/apache/htdocs/stat/config.inc.php on line 25
Solution:
put a ";" at the end of hostfile var
A basic template for website Search Engine Optimisation
Use keywords:
- in your META keywords (128 characters max)
- in your META description (keep keyword close to the left but in a fill sentence).
- in the page title at the far left but possibly not as the first word
- in the first portion of the page (first sentence of the first full paragraph)
- in an H3 or larger tag heading
- in bold in the lower half of the page (anywhere but the first usage on page)
- in italic in the lower half of the page (anywhere but the first usage on page)
- in the URL (directory name, filename or domain name). Do not duplicate the keyword in the URL
- in an image filename useed on the page
- in image ALT attribute
- in image TITLE attribute
- in link TITLE attribute
- in the filename of your external CSS javascript files
- in a link to a site that has a PageRank of 8 or better
Other optimisation tips:
- Use "last modified" headers if you can
- Validate your HTML. Google's parser will miss parts of web pages if they contain simple HTML errors
- Wherever possible keep the page as .html or .htm extension
- Keep the HTML below 20K. 5-15K is the ideal range
- Keep the ratio of text to HTML very high. Text should outweight HTML by significant amounts
Password protecting a directory in Webmin
In Webmin, there is an option called "Password protecting a directory" set up for you.
Below are the easy steps to password protect a directory using Webmin:
1) login in to the Webmin interface
2) Main menu -> choose "Others" -> choose "Protected Web Directories" -> "Add protection for a new diretcory"
3) in settings:
Directory path: select the path/directory which you want to protect
File containing users: if any, or choose automatically
File containing groups: if any, or choose None
Password encryption: choose the encryption type
Authentication realm: the name will appear in login box, ex: "Admin Area"
Users to allow: put the username you want to setup in "Only Users:" field
4) click the "Create" button
5) in the next page, you can add/edit password for this user, then click submit/save button. It's done!
Wednesday, October 2, 2013
Squid as a transparent proxy over ssl https
Setting up squid as a transparent proxy is fairly an easy job. If we Google for “how to set up squid as a transparent proxy” Google renders a lots of links for our reference. But it is commonly seen that when we are using transparent proxy we are unable to connect to https connection like Gmail and many more sites which https protocol for security concern. Sites which use http protocol can easily open.
Let’s understand first how squid proxy works in transparent mode. While setting up squid as a transparent proxy we can forward the entire request coming from port 80 to squid server’s port i.e. 3128 by default. When we talk about port 80 it means http protocol. What if we request for Gmail who uses https protocol and this protocol by default send request to port 443 of squid’s port, and we iptable firewall rules to forward traffic from port 80 to port 3128 and we forget about port 443 which is used by https protocol and squid is http proxy server. Now many folks may think it’s easy and forward all traffic coming from port 443 to squid port 3128. No it won’t work. Because https connection establishes a secure connection over the network and for that it uses certificate and public key private key pairs. And first of all I thanks God for RSA and DSA algorithm as it is not so easy to decrypt data which is encrypted by use of this algorithm. Squid proxy is a middle man who changes packets header and route traffic to internet world. So what we have to do is to create certificate and public key private key pair for internal network which can be used by squid client and squid server and later squid server can route your traffic to internet world. To yield faster results it is better to sign certificate from CA. self signed certificates are little bit slowing the connection. As in a transparent mode encryption and decryption done twice so it may yields result slow so I advised you to keep patience.
Steps are:
- iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
- iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 3130
Certificate and public key private key generation.
- openssl genrsa -des3 -out server. Key 1024
- openssl req -new –key -out server.csr
- openssl req -new -key server. Key -out server.csr
Steps to remove passphrase
- cp server. Key server. Key.old
- openssl rsa -in server. Key.org -out server. Key
Create server certificate
Openssl x509 -req -days 365 -in server.csr -sign.key -out server.crt
Now make some changes to squid.conf file
- http_port 3128 transparent
- https_port 3130 transparent cert=/”path to server.crt” key=/”path to server.key”.
Another easy way to create certificates and public key private key pair is using genkey utility. In order to use that you have crypto-utils package install on your machine.
Steps are:
- #yum -y install crypto-utils
- genkey -days 365 squidserver.hostname.com
- Hit next.
- Select number of bits for data encryption. Default is 1024. This command will generate random bits.
- Generate the certificate.
- I will suggest you to never used passphrase for key, because if u assigns passphrase to key then along with public key we need to share passphrase.
- Certificate and key are stored at /etc/pki/tls/certs/ and /etc/pki/tls/private/
- In squid.conf make necessary change like this
http_port 3128 transparent
https_port 3130 transparent cert=/etc/pki/tls/certs/squidserver.hostname.com.crt key=/etc/pki/tls/private/squidserver.hostname.com.key.
In order to run it in a proper way the desired way that we want we also need to configure BIND DNS for local intranet along with forwarders ON and in forwarder we need to define ISP IP Address. At Client side must define both gateway and DNS (In my Env it is Proxy server.)
How to Stop WordPress Asking for FTP details to Upgrade Plugins
- First, we need to see what user Apache is running under. Type the following into a New file in any text editor. Save As whoami.php in the /var/www directory (or wherever you set Apache to serve files from):
<?php echo(exec("whoami")); ?> - Open this file in a browser (for instance, localhost/whoami.php). It should reveal who the user is
- This tells you that the web server is running under the user webuser.
You can now give that user recursive ownership (all subfolders) of your WordPress installation using the command:chown-hR webuser:webuser /var/mydomain.com/public_html/wordpress/
Tuesday, October 1, 2013
pfSense: Editing /conf/config.xml file
To enable SSH do this from the PFSense web-interface:
Click System>Advanced>Secure Shell, Enable Secure Shell
Even if you prefer to use the PFSense web-interface to edit your config.xml file (make a backup copy first), the shell came in handy a few times throughout my configuration process. The other option to edit the config file is using the editor in the PFSense web-interface.
The editor is available here:
Diagnostics>Edit File. The Load/Save path is “/conf/config.xml”.
Scroll down until you find the tag. Then remove the lines that start with <media/> and <mediaopt/> and replace them with ones that say this:
<media>10baseT/UTP</media>
<mediaopt>full-duplex</mediaopt>
Then click Save. You can check to see if this took effect by clicking Status, Interfaces. The WAN interface should now read “10baseT/UTP ”. This change should take effect immediately – if not, give the box a reboot (Diagnostics>Reboot System).
Monday, September 16, 2013
Ubuntu Server 12.04 64-bit with Zoneminder 1.25.0 the easy way
Sunday, September 15, 2013
How To Install and Configure Varnish with Apache on Ubuntu 12.04
About Varnish
Varnish is an HTTP accelerator and a useful tool for speeding up a server, especially during a times when there is high traffic to a site. It works by redirecting visitors to static pages whenever possible and only drawing on the virtual private server itself if there is a need for an active process.
Setup
To perform the steps in this tutorial, you will need to both have a user with sudo privileges and apache installed on your virtual private server.
To create a user with sudo privileges, go through the third and fourth steps of the initial ubuntu server setup tutorial
Apache can be installed on your VPS with a single command from the apt-get repository.
sudo apt-get install apache2
Step One—Install Varnish
The varnish site recommends installing the varnish package through their repository.
You can start that process by grabbing the repository:
sudo curl http://repo.varnish-cache.org/debian/GPG-key.txt | sudo apt-key add -
The next step is to add the repository to the list of apt sources. Go ahead and open up that file.
sudo nano /etc/apt/sources.list
Once inside the file, add the varnish repository to the list of sources.
deb http://repo.varnish-cache.org/ubuntu/ lucid varnish-3.0
Save and exit.
Finally, update apt-get and install varnish.
sudo apt-get update
sudo apt-get install varnish
Step Two—Configure Varnish
Once you have both apache and varnish installed, you can start to configure them to ease the load on your server from future visitors.
Varnish will serve the content on port 80, while fetching it from apache which will run on port 8080.
Let’s go ahead and start setting that up by opening the /etc/default/varnish file:
sudo nano /etc/default/varnish
Uncomment all of the lines under “DAEMON_OPTS”—under Alternative 2, and make the configuration match the following code:
DAEMON_OPTS="-a :80 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,256m"
Once you save and exit out of that file, open up the default.vcl file:
sudo nano /etc/varnish/default.vcl
This file tells varnish where to look for the webserver content. Although Apache listens on port 80 by default, we will change the settings for it later. Within this file, we will tell varnish to look for the content on port 8080. The configuration should like this:
backend default {
.host = "127.0.0.1";
.port = "8080";
}Step Three—Configure Apache
So far we have told varnish that apache ports will be running on 8080. However the default settings for apache are still on port 80. We will correct the discrepancy now.
Open up the apache ports file:
sudo nano /etc/apache2/ports.conf
Change the port number for both the NameVirtualHost and the Listen line to port 8080, and the virtual host should only be accessible from the localhost. The configuration should look like this:
NameVirtualHost 127.0.0.1:8080
Listen 127.0.0.1:8080
Change these settings in the default virtual host file as well:
sudo nano /etc/apache2/sites-available/default
The Virtual Host should also be set to port 8080, and updated line looks like this:
<VirtualHost 127.0.0.1:8080>
Save and exit the file and proceed to restart Apache and Varnish to make the changes effective.
sudo service apache2 restart
sudo service varnish restart
Accessing your domain should instantly take you to the varnish cached version, and you can see the details of varnish’s workings with this command:
varnishstat
Friday, September 13, 2013
Asterisk on Ubuntu
Thursday, September 12, 2013
frontpage-2002-sr1.2.i386 has missing requires of libexpat.so.0
Error
frontpage-2002-sr1.2.i386 has missing requires of libexpat.so.0
Solution
Please follow these steps exactly
- SSH into your server
- Open the file /etc/yum.conf in your favorite text editor (nano is what I am using)
nano /etc/yum.conf
- You will find a line that starts with “Exclude”, most likely the first line. You will find perl* written in there.
- Delete the text “perl*” from the line. Note that there would be many extensions listed, you just need to remove “perl*”
- Save the file
- Execute “yum update“
That should be all. Your issue should now be fixed. Feel free to commend here if you run into any further errors.
- See more at: http://linuxlantern.com/frontpage-2002-sr1-2-i386-has-missing-requires-of-libexpat-so-0/#sthash.mtcelAQQ.dpuf
Friday, August 9, 2013
SSH to AWS Instance without key pairs
Here's what I did on a Ubuntu EC2 A) Login as root using the keypairs B) Setup the necessary users and their passwords with C) Edit /etc/ssh/sshd_config setting D) Restart the sshd with |
Thursday, August 1, 2013
VMWare Interview Questions & Tips
1. VMWare Kernel is a Proprietary Kenral and is not based on any of the UNIX operating systems, it's a kernel developed by VMWare Company.
2. The VMKernel can't boot it by itself, so that it takes the help of the 3rd party operating system. In VMWare case the kernel is booted by RedHat Linux operating system which is known as service console.
3. The service console is developed based up on Redhat Linux Operating system, it is used to manage the VMKernel
4. To restart webaccess service on vmware
service vmware-webaccess restart – this will restart apache tomcat app
5. To restart ssh service on vmware
service sshd restart
6. To restart host agent(vmware-hostd) on vmware esx server
service mgmt-vmware restart
7. Path for the struts-config.xml
/usr/lib/vmware/webAccess/tomcat/apache-tomcat-5.5.17/webapps/ui/WEB-INF/
8. To start the scripted install the command is
esx ks=nfs:111.222.333.444:/data/KS.config ksdevice=eth0
location device name
9. Virtual Network in Simple……………….
Virtual Nic(s) on Virtual Machine(s) ----->
Physical Nic on the ESX Server (Virtual Switch - 56 Ports) ----->
Physical Switch Port Should be trunked with all the VLANS to which the VM's need access
All the ESX servers should be configured with Same number of Physical Nics (vSwitches) and Connectivity also should be same, So that vMotion succeeds
All the Virtual Machines are connected to one vSwitch with Different VLANS, this means the Physical Nic(vSwitch) needs to be trunked with the same VLANS on the Physical Switch Port
10 What are the three port groups present in ESX server networking
1. Virtual Machine Port Group - Used for Virtual Machine Network
2. Service Console Port Group - Used for Service Console Communications
3. VMKernel Port Group - Used for VMotion, iSCSI, NFS Communications
11. What is the use of a Port Group?
The port group segregates the type of communication.
12. What are the type of communications which requires an IP address for sure ?
Service Console and VMKernel (VMotion and iSCSI), these communications does not happen without an ip address (Whether it is a single or dedicated)
13. In the ESX Server licensing features VMotion License is showing as Not used, why?
Even though the license box is selected, it shows as "License Not Used" until, you enable the VMotion option for specific vSwitch
14. How the Virtual Machine Port group communication works ?
All the vm's which are configured in VM Port Group are able to connect to the physical machines on the network. So this port group enables communication between vSwitch and Physical Switch to connect vm's to Physical Machine's
15. What is a VLAN ?
A VLAN is a logical configuration on the switch port to segment the IP Traffic. For this to happen, the port must be trunked with the correct VLAN ID.
16. Does the vSwitches support VLAN Tagging? Why?
Yes, The vSwitches support VLAN Tagging, otherwise if the virtual machines in an esx host are connected to different VLANS, we need to install a separate physical nic (vSwitch) for every VLAN. That is the reason vmware included the VLAN tagging for vSwitches. So every vSwitch supports upto 1016 ports, and BTW they can support 1016 VLANS if needed, but an ESX server doesn’t support that many VM’s. :)
17. What is Promiscuous Mode on vSwitch ? What happens if it sets to Accept?
If the promiscuous mode set to Accept, all the communication is visible to all the virtual machines, in other words all the packets are sent to all the ports on vSwitch
If the promiscuous mode set to Reject, the packets are sent to inteded port, so that the intended virtual machine was able to see the communication.
18. What is MAC address Changes ? What happens if it is set to Accept ?
When we create a virtual machine the configuration wizard generates a MAC address for that machine, you can see it in the .vmx (VM Config) file. If it doesn't matches with the MAC address in the OS this setting does not allow incoming traffic to the VM. So by setting Reject Option both MAC addresses will be remains same, and the incoming traffic will be allowed to the VM.
19. What is Forged Transmits ? What happens if it is set to Accept ?
When we create a virtual machine the configuration wizard generates a MAC address for that machine, you can see it in the .vmx (VM Config) file. If it doesn't matches with the MAC address in the OS this setting does not allow outgoing traffic from the VM. So by setting Reject Option both MAC addresses will be remains same, and the outgoing traffic will be allowed from the VM.
20. What are the core services of VC ?
VM provisioning , Task Scheduling and Event Logging
21. Can we do vMotion between two datacenters ? If possible how it will be?
Yes we can do vMotion between two datacenters, but the mandatory requirement is the VM should be powered off.
22. What is VC agent? and what service it is corresponded to? What are the minimum req's for VC agent installation ?
VC agent is an agent installed on ESX server which enables communication between VC and ESX server.
The daemon associated with it is called vmware-hostd , and the service which corresponds to it is called as mgmt-vmware, in the event of VC agent failure just restart the service by typing the following command at the service console
" service mgmt-vmware restart "
VC agent installed on the ESX server when we add it to the VC, so at the time of installtion if you are getting an error like " VC Agent service failed to install ", check the /Opt size whether it is sufficient or not.
23. How can you edit VI Client Settings and VC Server Settings ?
Click Edit Menu on VC and Select Client Settings to change VI settings
Click Administration Menu on VC and Select VC Management Server Configuration to Change VC Settings
24. What are the files that make a Virtual Machine ?
.vmx - Virtual Machine Configuration File
.nvram - Virtual Machine BIOS
.vmdk - Virtual Machine Disk file
.vswp - Virtual Machine Swap File
.vmsd - Virtual MAchine Snapshot Database
.vmsn - Virtual Machine Snapshot file
.vmss - Virtual Machine Suspended State file
.vmware.log - Current Log File
.vmware-#.log - Old Log file
25. What are the devices that can be added while the virtual Machine running
In VI 3.5 we can add Hard Disk and NIC's while the machine running.
In vSphere 4.0 we can add Memory and Processor along with HDD and NIC's while the machine running
26. How to set the time delay for BIOS screen for a Virtual Machine?
Right Click on VM, select edit settings, choose options tab and select boot option, set the delay how much you want.
27. What is a template ?
We can convert a VM into Template, and it cannot be powered on once its changed to template. This is used to quick provisioning of VM's.
23. What to do to customize the windows virtual machine clone,?
copy the sysprep files to Virtual center directory on the server, so that the wizard will take the advantage of it.
24. What to do to customize the linux/unix virtual machine clone,?
VC itself includes the customization tools, as these operating systems are available as open source.
25. Does cloning from template happens between two datacenters ?
Yes.. it can, if the template in one datacenter, we can deploy the vm from that template in another datacenter without any problem.
26. What are the common issues with snapshots? What stops from taking a snapshot and how to fix it ?
If you configure the VM with Mapped LUN's, then the snapshot failed. If it is mapped as virtual then we can take a snapshot of it.
If you configure the VM with Mapped LUN's as physical, you need to remove it to take a snapshot.
27. What are the settings that are taken into to consideration when we initiate a snapshot ?
Virtual Machine Configuration (What hardware is attached to it)
State of the Virtual Machine Hard Disk file ( To revert back if needed)
State of the Virtual Machine Memory (if it is powered on)
28. What are the requirements for Converting a Physical machine to VM ?
An agent needs to be installed on the Physical machine
VI client needs to be installed with Converter Plug-in
A server to import/export virtual machines
29. What is VMWare consolidated backup ?
It is a backup framework, that supports 3rd party utilities to take backups of ESX servers and Virtual Machines. Its not a backup service.
30. To open the guided consolidation tool, what are the user requirements ?
The user must be member of administrator, The user should have "Logon as service" privileges - To give a user these privileges, open local sec policy, select Logon as service policy and add the user the user should have read access to AD to send queries
For more Interview Questions on VMware Click the below link….
- VMware - Fix HA errors
- VMware - How to install Virtual Center
- VMware - Unable to power on VM
- VMware - VMotion
- VMware - Consolidated Backup
- Common - Understanding DNS
- VMware - Virtualization Basics
- VMware - Virtual Networking
- VMware - ESX Server - Virtualization Expert
- VMware - Virtual Machine - Provisioning
- VMware - How to access ESX Server
- VMware - Virtual Center - Centralization of Virtualization
- VMware - Workstation - Virtual Friend
- VMware - A way to setup VMware Infrastructure
- VMware - Storage
- VMware - VMFS - Virtual Machine File System
- VMware - Storage - How to Configure Guide
- VMware - ESX Installation Inside Workstation
- VMware - Openfiler - Open Source ISCSI SAN Solutions
- VMware - Storage - Configuration using iSCSI
- VMware - Storage - RDM
- VMware - vSphere
- VMware - PowerCLI - Getting Started
- VMware - PowerCLI - Part I
- VMware - Storage - Configuration using NFS
- VMware - Cloud Computing - An Example
- VMware - PowerCLI - Part II
- VMware - Snapshots - Part 1
- Common - Job Interview Questions
- VMware - High Availability
- VMware - ISU Lab1 - Building VMware Infrastructure
- VMware - Snapshots - Part2
- VMware - Workstation - Networking in detail
- VMware - Host Profiles
- VMware - Useful Videos
- VMware - Useful Documents
Tuesday, July 16, 2013
How to repair mysql database
Step 1: Determine MySQL password
If you are using an external version of MySQL, you should already know your MySQL password. If you are using the built-in MySQL version that comes with hMailServer, you might not know your password. To determine it, follow these steps
Step 3: Repair the table
Follow these steps to run the SQL statement to repair the table.
- In the tree to the left, click on the hmailserver database.
The hMailServer database will now be active. - In the right part of the SQLyog window, click on the Query tab.
- Enter REPAIR TABLE tablename, for example, REPAIR TABLE hm_messages.
- Click on the Execute Current Query button in the toolbar (or select Edit->Execute Query->Execute current query or press F5).
- MySQL should now repair the table. After the table has been repaired, restart the MySQL and than the hMailServer service. Depending on what table is corrupt, a restart of the services may not be required, but we recommend that you always do it.
Monday, May 27, 2013
ESXi 3.5 does ship with the ability to run SSH, but this is disabled by default (and is not supported).
1) At the console of the ESXi host, press ALT-F1 to access the console window.
2) Enter unsupported in the console and then press Enter. You will not see the text you type in.
3) If you typed in unsupported correctly, you will see the Tech Support Mode warning and a password prompt. Enter the password for the root login.
4) You should then see the prompt of ~ #. Edit the file inetd.conf (enter the command vi /etc/inetd.conf).
5) Find the line that begins with #ssh and remove the #. Then save the file. If you're new to using vi, then move the cursor down to #ssh line and then press the Insert key. Move the cursor over one space and then hit backspace to delete the #. Then press ESC and type in :wq to save the file and exit vi. If you make a mistake, you can press the ESC key and then type it :q! to quit vi without saving the file.
6) Restart host or try kill -HUP `ps | grep inetd`