How to find files containing text in Linux

sshRe: Find files containing a specific string of text

This is useful and can save a lot of time, so this is worth remembering!

grep -lir "your text here" *

Here is what the parameters do:

  • r – search recursively in to sub directories
  • i – ignore text case
  • l – output the name of the file and not the line of text

Type man grep for more details.

My email header shows random domains in the hostname section

Re: Why does my email appear to come from domains unrelated to my account?

This is because you are using a shared hosting account. This means that your account is on a web server that also has other hosting accounts. This is normal and how shared hosting works. It means you do not have the expense of leasing your own dedicated IP address which we provide with Pro Hosting accounts.

Because the IP address is shared between all shared hosting accounts, any application that attempts to “reverse” the IP address to a hostname will erraneously pick up any domain name that is using that particular IP address because the IP address is not allocated to any single domain but to the server and all domains on that server.

If you use VPS hosting, Dedicated server hosting or Pro hosting you will not have this issue as the IP address that your site uses will be unique to your site and not shared with any other sites.

Plesk: How to Change Qmail IP Address

Re: Change plesk qmail IP address

If you’ve got a Plesk server and some unsavoury character has hosted and spammed from your server, even if you remove them you may find your IP is blocked by many of the blacklists – even though this will only be temporary for 24 or 48 hours, this is still an issue for your remaining clients.

What you need to do it temporarily change the qmail sender IP address, this is very easy to do and as I say, it’s temporary, a server reboot gets everything back to normal.

Let’s say your qmail IP address is 1.1.1.1 and you want to change it to 2.2.2.2. Your gateway is 3.3.3.3 and does not change.

SSH in to your server console and let’s look at your setup:

# /sbin/ip route
1.2.3.4/1 dev eth0 proto kernel scope link src 1.1.1.1
 1.2.3.4/16 dev eth0 scope link
 default via 3.3.3.3 dev eth0

To change the default qmail IP from 1.1.1.1 to 2.2.2.2:

# /sbin/ip route change default via 3.3.3.3 dev eth0 src 2.2.2.2

That’s all there is to it. All qmail outgoing mails now leave from IP 2.2.2.2 instead of 1.1.1.1

Send an email, look at the header, you will see the email came from the new IP address. If you screw up, at worst, simply reboot the server to get the IP settings as before. This works fine on all versions of Plesk that we have used.

How to change phpMyAdmin post_max_size to more than 2MB

Re: Unable to increase upload limit for phpMyAdmin in Plesk

To change the post_max_size in Plesk it is not as simple as changing the /etc/php.ini file entries as there are not active when running phpMyAdmin from within with Plesk Control Panel.

Usually, on a regular *nix installation you would look for these values in /etc/php.ini

  • upload_max_filesize
  • phpMyAdmin logo

What you need to change in fact is this file:

# vi  /usr/local/psa/admin/conf/php.ini

change:

  • upload_max_filesize = 2147483647
  • post_max_size = 2147483647

to:

  • upload_max_filesize = 32M
  • post_max_size = 32M

This value will now allow phpMyAdmin uploads of files up to 32M is size. Enter your own value here.

Which domain extensions should I register?

This is a tough question if you are registering your first domain and you are also on a tight budget.

  • As a minimum, you need to register the .co.uk if you are a UK based company and also the .com version if available.
  • If your site is important,  consider registering as many extensions as possible to prevent others pretending to be you.
  • While your business is new you can register the domains at cost. Once you are established, obtaining the domain names from a squatter is going to be expensive, if not impossible.
  • Find a comfortable budget for your domain registrations. Annually the costs is much less than it used to be.
  • You may need to consider registering misspellings if your brand name can easily be misspelt for additional protection.

The reason you need to register both the .co.uk and the .com becomes apparent once your site becomes successful. Do you really want someone to launch a site with your company brand and have them ride on your coat tails – or even bring your business in to disrepute? So, if you can, get both the .co.uk and the .com extensions.

So how about the rest of the extensions?

If you are serious about your business, you need to purchase as many extensions as your budget will afford. Domain registration is very cheap these days and there are no excuses for cutting corners. Once your business is successful it will be very difficult if not impossible to collect the extensions after they have been registered by other parties.

So I should register all of the extensions?

If you can, in this order, you should take the .co.uk, .com, .net, .biz, .info and .eu. As stated earlier, if you are serious about your business then register as many of the extensions as you can afford.