Test SPF record of a domain

http://www.kitterman.com/spf/validate.html?

How to Fix Timthumb using a Virtual Directory (URL contains tildes (~))

The timthumb tilde issue has been discussed for almost a year now on the official timthumb site, and the developers have yet to do anything to provide a fix for users in development environments.

The issue is that when developers are developing sites using a URL structure such as: http://127.0.0.1/~mysite/images/dog.jpg, timthumb does not correctly parse the folder structure and returns a broken image. In this case, a proper path might be: /home/mysite/public_html/images/dog.jpg, however timthumb creates the broken path: /home/mysite/public_html/~mysite/images/dog.jpg.

For the record, I believe timthumb is a horrible idea and should be avoided at all costs (security and performance issues). However there are many instances where you might purchase a template to find it is completely integrated with timthumb, and the amount of time it could take to remove timthumb from the template is not worth it.

How to fix

Make sure you are using the latest version of timthumb. At the moment of this writing, the version is 2.8.5

At line 209 you will find the code:

1
$this->src = $this->param('src');

Replace that with:

//check if tilde is found in src
if(strstr($this->param('src'),'~'))
{
   $url_parts = explode('/',$this->param('src'));
   foreach($url_parts as $url_part)
   {
      //do not include any part with a ~ when building new url
      if(!strstr($url_part,'~'))
      {
         $new_dev_url .= $url_part.'/';
      }
   }
   //remove trailing slash
   $new_dev_url = substr($new_dev_url,0,-1);
   $this->src = $new_dev_url;
}
else
{
   $this->src = $this->param('src');
}

This isn’t the most elegant solution, however the only time you should be using it is while you are developing and debugging the site (tildes should never be in the URL of a live website). Once you go live, it will automatically skip over that extra processing and work just as timthumb is intended.

Additional fix for $_SERVER['DOCUMENT_ROOT']

There might be a chance that timthumb is still not working, and that could be because $_SERVER['DOCUMENT_ROOT'] is not being properly defined. To get around this, we need to manually define $_SERVER['DOCUMENT_ROOT'] at the beginning of the document:

Above this line (line 23):

1
define ('VERSION', '2.8.5');

Insert the root path of your website, something like this:

1
$_SERVER['DOCUMENT_ROOT'] = '/home/mysite/public_html/';

I hope that helps, and if it is still not working for you, I highly recommend visiting the official timthumb website and talk with the developers.

 

Centos System-config tools

Centos 6 don't have system-config tools installed by default.
You will get this error if try to use that:

[root@localhost ~]# system-config-securitylevel
-bash: system-config-securitylevel: command not found

To install ist, please run:

yum install system-config-\*

How to display file and folder sizes in CentOS

Type the following command to show file sizes:

Code:
du -h –max-depth=1

This command will list the files and folders in the current directory as well as show the complete size of the folders and files.

e.g.

[root@server var]# du -h –max-depth=1
76K ./qmail
7.5G ./www
4.0K ./local
4.0K ./tmp
116K ./run
4.0K ./games
681M ./log
4.0K ./opt
212K ./named
160K ./cache
4.0K ./preserve
8.0K ./db
24K ./lock
4.0K ./yp
217M ./lib
12K ./empty
248K ./spool
4.0K ./nis
8.4G .

Configuring FTP Firewall Settings in IIS 7 – 425 Can’t open data connection.

 

USING WINDOWS FIREWALL WITH NON-SECURE FTP TRAFFIC

To configure Windows Firewall to allow non-secure FTP traffic, use the following steps:

  1. Open a command prompt: click Start, then All Programs, then Accessories, then Command Prompt.
  2. To open port 21 on the firewall, type the following syntax then hit enter:

    netsh advfirewall firewall add rule name="FTP (non-SSL)" action=allow protocol=TCP dir=in localport=21

  3. To enable stateful FTP filtering that will dynamically open ports for data connections, type the following syntax then hit enter:

    netsh advfirewall set global StatefulFtp enable


    More information: http://www.iis.net/learn/publish/using-the-ftp-service/configuring-ftp-firewall-settings-in-iis-7#Step1

Config gmail/google apps e-mail account at outlook

Instruções standard:

    1. Activar o POP no Gmail. Não se esqueça de clicar em Guardar alterações quando tiver terminado.
    2. Configure o seu cliente para corresponder às definições seguintes:
Servidor de correio recebido (POP3) – necessita de SSL: pop.gmail.com
Utilizar SSL: Sim
Porta: 995
Servidor de correio enviado (SMTP) – necessita de TLS: smtp.gmail.com (utilizar autenticação)
Utilizar autenticação: Sim
Utilizar STARTTLS: Sim (denominado SSL em alguns clientes)
Porta: 465 ou 587
Nome da conta: o seu endereço de e-mail completo (incluindo @gmail.com ou @oseu_domínio.com)
Endereço de e-mail: o seu endereço de e-mail (nomedeutilizador@gmail.com ou nomedeutilizador@oseu_domínio.com)
Palavra-passe: a sua palavra-passe do Gmail

Certifique-se de que optou por não deixar mensagens no servidor, a não ser que esteja a utilizar o modo recente para transferir correio para vários clientes. As suas Definições do Gmail determinam se as mensagens permanecem, ou não, no servidor, pelo que esta definição no cliente não irá afectar a forma como o Gmail trata o seu correio.

Note que, caso o seu cliente não suporte a autenticação SMTP, não poderá enviar correio através do seu cliente com o seu endereço do Gmail.

Para além disso, se está a ter problemas a enviar correio, mas verificou que o seu cliente de correio tem a encriptação activa para SMTP, experimente configurar o servidor SMTP numa porta diferente: 465 ou 587.

  1. Já está pronto para utilizar o POP com o seu endereço do Gmail.

Sender ID Framework SPF Record Wizard

Create SPF Record to your domain at http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/

Magento – Setting Up RSS Feeds

To enable RSS feeds for your store:

  1. From the Admin panel, select System > Configuration.
  2. In the Configuration panel on the left, under Catalog, select RSS Feeds.
  3. In the Rss Config section, set Enable RSS to “Enable.” Then, in each section below, set the feeds that you want to activate to “Enable.”
    1. In the Wishlist section, set Enable RSS to “Enable.”
    2. In the Catalog section, set any, or all, of the following feeds to “Enable.”
      • New Products
      • Special Products
      • Coupons/Discounts
      • Tags Products
      • Top Level Category
  4. In the Order section, set Customer Order Status Notification to Enable.
  5. Click the Save Config button to save your changes.

Once enabled, any new additions to products, specials, categories, and coupons in your store will be automatically syndicated to the subscribers of each feed.

RSS Feeds

Wishlist When enabled, an RSS feed link will be available on top of customer wishlist pages. Additionally, the wishlist sharing page will also include a checkbox that lets you add a link to wishlist RSS feeds on shared wishlists.
New Products The new products RSS feed tracks new products added to the store catalog and will syndicate them.
Special Products The special products RSS feed will syndicate products with special pricing.
Coupons / Discounts Any special coupons or discounts generated in your store will be added to this RSS feed.
Tags Products The tags products RSS feed manages and syndicates newly added product tags.
Top Level Category This RSS feed tracks new top level categories, or root level categories, in your catalog.
Customer Order Status Allows customers to track their order status with an RSS feed. When enabled, an RSS feed link will appear on the order information page once an order is created.

TimThumb – Could not create the file cache directory

A TimThumb error has occured

The following error(s) occured:
Could not create the file cache directory.

Solution

Solved this issue by editing timthumb.php and changing the cache directory to empty string (so that it uses the sytem cache folder).

Linux – Change SSH port

Edit  /etc/ssh/sshd_config

Find line with # Port 22, and change it to Port xxx

Aftet that, restart sshd with service sshd restart