Bash script replace open short tags PHP <?php= or <? with <?php working on CakePHP

Thanks to marius for this code. Here are scripts for replacing open short tags using bash scripting :


#!/bin/sh
# Written by Marius van Witzenburg

path="."
if [ ! -z "$1" ] && [ -d "$1" ]
then
path="$1"
elif [ ! -z "$1" ]
then
echo "Invalid path defined, using default."
fi

How to setup and Configure Theplanet WHM DNS with mydomain in 7 easy steps

The Planet have a little documentation about how to configure custom like ns1.mydomain.com DNS as primary DNS resolver in WHM.
Here detail explanation to do that :

1. Find your IP also secondary IP and setup your resolver Configuration / secondary resolver with your IP
So, let say your IP are 172.222.221 and 172.222.225. Also have yourdomain.com

At first WHM setup, you will read this :

Enter the ip address of at least two nameservers that you will use for dns resolution. Your datacenter should be able to provide you with at least one ip of a dns server you can access. If you do not know the ip address of your provider's local resolvers you should contact them. It is very important that these nameservers are correct, or you server will not function properly. If you do not know what to put in the boxes below and cannot contact your provider, please close this window and go though this setup at a later time; Your server should still function normally, however connections made to the server may be slower than normal.

Primary Resolver
Secondary Resolver

Fill your secondary resolver with your IP.

2. Set the server's current hostname under Networking Setup.
You have domain let say example.com and your main shared virtual host IP. Then we will make ns1.yourdomain.com and ns2.yourdomain.com (if you have secondary IP) as your primary DNS.
At Basic WHM setup, we see

This value should be a fully qualified domain name and will need to resolve properly.
Changing this value does not set the server's current hostname.

So,to change the server's current hostname, we go to Hostname function under Networking Setup.
Then under Networking Setup, change hostname for example stone.yourdomain.com rather than theplanet.host

3. Set the default nameservers as custom DNS on nameserver configuration under Basic / WHM setup
On Nameserver option , Here you can set the default nameservers used when creating an account. Change ns1.theplanet.host to ns1.yourdomain.com & ns2.theplanet.host to ns2.yourdomain.com.
Then save the option.

Remember, we will use yourdomain.com as primary DNS also custom DNS.

[Resolved] How to Installing Solr 1.4.1 Multicore with Tomcat 6 on Ubuntu 10.04 Lucid

Finding way upgrade to Solr 1.4.1 with Tomcat 6 (Multicore mode) in Ubuntu 10.04 was made me spend a lot of time for googling and read many tutorials. Before, i was using Solr 1.4.0 native from Ubuntu 10.04 (single-core) and everything was okay. But finally it working now in my EC2 Server also my 127.0.0.1. Here 5 easy steps to do :

1. Installing Tomcat 6 in Ubuntu 10.04 and Libmysql-java

sudo apt-get update && apt-get upgrade
sudo apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user tomcat6-docs tomcat6-examples
sudo apt-get install libmysql-java

2. Download apache-solr-1.4.1.tar.gz from http://lucene.apache.org/solr/ and extract it!
cd
sudo cp ~/apache-solr-1.4.1/dist/apache-solr-1.4.1.war /usr/share/tomcat6/webapps/solr.war
sudo cp -R ~/apache-solr-1.4.1/example/solr/ /usr/share/tomcat6/solr/

note : we copy solr folder into /usr/share/tomcat6 and it will pointed as solr home in next step.

3. Create new Solr configuration in Tomcat6
sudo vim /etc/tomcat6/Catalina/localhost/solr.xml

Paste this into file :

<Context docBase="/usr/share/tomcat6/webapps/solr.war" debug="0" privileged="true" allowLinking="true" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/usr/share/tomcat6/solr" override="true" />
</Context>

4. Enable MultipleCore in Solr 1.4.1
sudo cp ~/apache-solr-1.4.1/example/multicore/solr.xml /usr/share/tomcat6/solr/solr.xml
sudo cp -R ~/apache-solr-1.4.1/example/multicore/core0 /usr/share/tomcat6/solr/
sudo cp -R ~/apache-solr-1.4.1/example/multicore/core1 /usr/share/tomcat6/solr/
sudo mkdir /usr/share/tomcat6/solr/core0/data
sudo mkdir /usr/share/tomcat6/solr/core1/data
sudo chown -R tomcat6:tomcat6 /usr/share/tomcat6/solr/core0/data/
sudo chown -R tomcat6:tomcat6 /usr/share/tomcat6/solr/core1/data/

Solving MySQL problem Ubuntu Lucid on Amazon EC2 after upgrade

Can't login after apt-get upgrade on Ubuntu Lucid ? Do you use Amazon EC 2?
Solution to fixing this problem is uninstall mysql packets completely.
Then we can install mysql as new again.

Here steps to fixing mysql on Ubuntu 10.04 :

1. Preventing loss data when remove mysql packet
MySql data usually stored in /var/lib/mysql on Ubuntu. Stop MySql services first by sudo /etc/init.d/mysql stop .
Then you can backup it by using command sudo cp -Rp /var/lib/mysql/

Tags: 
Subscribe to www.yoodey.com RSS
Fat loss 4 idiot, Weight loss 4 idiot, Diet Proof Extended Stay Insurance home owner Insurances Life and health Laquinta hotels, motels, suites, inn