Using s3sync.rb to synchronize files to/from Amazon

Examples:
———
(using S3 bucket ‘mybucket’ and prefix ‘pre’)

Put the local etc directory itself into S3

s3sync.rb  -r  /etc  mybucket:pre

(This will yield S3 keys named pre/etc/…)

Put the contents of the local /etc dir into S3, rename dir:

s3sync.rb  -r  /etc/  mybucket:pre/etcbackup

(This will yield S3 keys named pre/etcbackup/…)

Put contents of S3 “directory” etc into local dir

s3sync.rb  -r  mybucket:pre/etc/  /root/etcrestore

(This will yield local files at /root/etcrestore/…)

Put the contents of S3 “directory” etc into a local dir named etc

s3sync.rb  -r  mybucket:pre/etc  /root

(This will yield local files at /root/etc/…)

Put S3 nodes under the key pre/etc/ to the local dir etcrestore
**and create local dirs even if S3 side lacks dir nodes**

s3sync.rb  -r  --make-dirs  mybucket:pre/etc/  /root/etcrestore

(This will yield local files at /root/etcrestore/…)

Source: http://s3.amazonaws.com/ServEdge_pub/s3sync/README.txt

Create .htaccess file on a WAMP System

If you are creating a new passwd file:

 C:\wamp\bin\apache\Apache2.2.11\bin\htpasswd.exe -c passfile username

If your are editing an existing password file:

 C:\wamp\bin\apache\Apache2.2.11\bin\htpasswd.exe passfile username

.htaccess contents:

AuthType Basic
require valid-user
Satisfy all
AuthUserFile C:/webroot/passwdfile
AuthName "My Secret Folder"

Move the created pass file to the desired location. and add a .htaccess file to the folder you want to protect and then gracefully restart apache.

This is done through the wamp system tray icon.

Grep UID in Plesk from Qmail log

Click on the header link in the mail server queue:

Received: (qmail 30501 invoked by uid 10077); 3 Dec 2009 21:47:42 -0500
Date: 3 Dec 2009 21:47:42 -0500
Message-ID: <20091204024742.30498.qmail@hostserver.com>
To: email@domain.com
Subject: This is a test.
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
From: <user@domain.com>

It says its invoked by uid 10077 which corresponds to the account on the /etc/password file:

-bash-3.2# more /etc/passwd | grep 10077
username:x:10077:2522::/var/www/vhosts/domain.com:/bin/false

Limit to Postini IP Range in Plesk

  • Login to Plesk and go to SYSTEM -> MODULES -> FIREWALL
  • Choose Add Custom Rule
  • Enter in a rule name
  • Choose what direction to match, in this case, incoming
  • Choose ALLOW
  • Enter in port 25
  • Leave as TCP
  • Press ADD
  • Enter in 74.125.148.0/22 in the five boxes, the fifth box being the 22 (no slash)
  • Press ADD
  • Press OK

That rule will accept Postini’s block. Then, to block the rest of the email:

  • Choose Add Custom Rule
  • Enter in a rule name
  • Choose incoming
  • Choose DENY
  • Enter in port 25 and press ADD
  • Leave the network space blank
  • Press OK

It is important that you have the rules in this order, otherwise all email will be denied. Ensure that the ALLOW is above the DENY in the display list when you are done, then commit the changes.

Source: http://www.experts-exchange.com/OS/Linux/Q_24418022.html

Transfer database between domains in Plesk

If you are moving the database from one domain to another on the same server, and you want to keep the database name the same, you just need to change the owner of the database in the ‘data_bases’ table in the psa database.

The table uses the field ‘dom_id’ as a reference to the owner. Look in the ‘domains’ table to find the ‘id’ of the domain you are using and the one you wish to move to then make the change in the ‘data_bases” table.

Once changed, you will see the database listed under the new domain in Plesk. You can then add/change usernames and passwords through Plesk as normal.

You can do all the above through the command interface (SSH) or you can do it the easy way with a tool like phpMyAdmin installed.

Source: http://forums.serverbeach.com/showthread.php?t=164