Friday, June 22, 2012

IMAP server closed the connection, Error Code: 0x800CCCDD

SkyHi @ Friday, June 22, 2012
After researching many Forums on this issue, the solution that eventually worked for me was as follows:

1) In MS Outlook 2007, click on 'Tools'
2) Move mouse over 'Send/Receive' to bring up additional menu
3) Move mouse over 'Send/Receive settings' to bring up additional menu.
4) Click on 'Define Send/Receive Groups'
5) Under the Setting for Group "All accounts", uncheck box which reads "Schedule an automatic/send receive every....". 

I also unchecked the box under "Schedule an automatic/send receive every...." under 'When Outlook is Offline'

The only issue now is that I have to click the "Send/Receive" icon on the main Outlook toolbar to send and receive e-mail messages, but this is not a problem for me. Since doing this, I have not received the IMAP error.

The original post for this solution can be found at: essage-in.html

Please post a reply to let people know whether this solution works for you so that this thread is complete.


data deduplication

SkyHi @ Friday, June 22, 2012

Data deduplication (often called "intelligent compression" or "single-instance storage") is a method of reducing storage needs by eliminating redundant data. Only one unique instance of the data is actually retained on storage media, such as disk or tape. Redundant data is replaced with a pointer to the unique data copy. For example, a typical email system might contain 100 instances of the same one megabyte (MB) file attachment. If the email platform is backed up or archived, all 100 instances are saved, requiring 100 MB storage space. With data deduplication, only one instance of the attachment is actually stored; each subsequent instance is just referenced back to the one saved copy. In this example, a 100 MB storage demand could be reduced to only one MB.
Data deduplication offers other benefits. Lower storage space requirements will save money on disk expenditures. The more efficient use of disk space also allows for longer disk retention periods, which provides better recovery time objectives (RTO) for a longer time and reduces the need for tape backups. Data deduplication also reduces the data that must be sent across a WAN for remote backups, replication, and disaster recovery.
Data deduplication can generally operate at the file or block level. File deduplication eliminates duplicate files (as in the example above), but this is not a very efficient means of deduplication. Block deduplication looks within a file and saves unique iterations of each block. Each chunk of data is processed using a hash algorithm such as MD5 or SHA-1. This process generates a unique number for each piece which is then stored in an index. If a file is updated, only the changed data is saved. That is, if only a few bytes of a document or presentation are changed, only the changed blocks are saved; the changes don't constitute an entirely new file. This behavior makes block deduplication far more efficient. However, block deduplication takes more processing power and uses a much larger index to track the individual pieces.
Hash collisions are a potential problem with deduplication. When a piece of data receives a hash number, that number is then compared with the index of other existing hash numbers. If that hash number is already in the index, the piece of data is considered a duplicate and does not need to be stored again. Otherwise the new hash number is added to the index and the new data is stored. In rare cases, the hash algorithm may produce the same hash number for two different chunks of data. When a hash collision occurs, the system won't store the new data because it sees that its hash number already exists in the index.. This is called a false positive, and can result in data loss. Some vendors combine hash algorithms to reduce the possibility of a hash collision. Some vendors are also examining metadata to identify data and prevent collisions.
In actual practice, data deduplication is often used in conjunction with other forms of data reduction such as conventional compression and delta differencing. Taken together, these three techniques can be very effective at optimizing the use of storage space.


Wednesday, June 20, 2012

DNS zone transfer dump

SkyHi @ Wednesday, June 20, 2012
DNS zone transfer, also sometimes known by its (most common) opcode mnemonic AXFR, is a type of DNS transaction. It is one of the many mechanisms available for administrators to replicate DNS databases across a set of DNS servers. Zone transfer comes in two flavors, full (opcode AXFR) and incremental (IXFR). Nearly universal at one time, it is now becoming less popular in favor of the use of other database replication mechanisms that modern DNS server packages provide.

SQL Delete Records within a specific Range

SkyHi @ Wednesday, June 20, 2012

delete from Table where id between 79 and 296


PHP with ioncube loader CentOS

SkyHi @ Wednesday, June 20, 2012

Guide to upgrade PHP Linux. PHP 5.3.3 Red Hat, CentOS.
1. Remove currently installed PHP.
Without Plesk.
rpm -qa | grep php | xargs rpm -e --nodeps
With Plesk. This is required as the output of rpm -qa | grep php would also pass some Plesk packages to xargs rpm -e --nodeps and Plesk would be broken!
Using the grep -v psa will remove any output containing psa.
rpm -qa | grep php | grep -v psa | xargs rpm -e --nodeps
Personally I advise you check the output of.
rpm -qa | grep php
rpm -qa | grep php | grep -v psa  
before piping to xargs.
2. Install PHP 5.3.3.
yum install php53* php53-*
3. Install the ioncube loader.
Download and extract the ioncube loader and install the ioncube loader module.
wget && cd ioncube && cp /usr/lib/php/modules/
Now update the PHP config.
echo “zend_extension=/usr/lib/php/modules//” > /etc/php.d/ioncube-loader.ini
wget && tar -zxf ioncube_loaders_lin_x86-64.tar.gz && cd ioncube && cp /usr/lib64/php/modules/
Now update the PHP config.
echo “zend_extension=/usr/lib64/php/modules//” > /etc/php.d/ioncube-loader.ini
4. Create dummy PHP package (Optional only required for Plesk  as it does not look for PHP53 packages only PHP.
Install rpmbuild.
yum install rpm-build
Create the php.spec.
nano -w php.spec
Include the following in the file.
Summary: Empty PHP required as Plesk doesent recognise the PHP53 packages.
Name: php
Version: 5
Release: 3.3
License: Public
Group: Applications/System
press ctrl+x to exit and save the file.
Now build the RPM.
rpmbuild -bb php.spec
This will then output a path to the created RPM.
Install the package
rpm -i /path/to/rpm
Exclude PHP from the main repos.
open the yum config.
nano -w /etc/yum.conf
add the following entry.
The exclude php is to prevent issues with php packages conflicting with php53. It wont stop php53 packages from updating.
5. Restart Apache
service httpd restart
Now check the version of PHP
php -v
Job done.


Tuesday, June 19, 2012

8 Ways to Tweak and Configure Sudo on Ubuntu

SkyHi @ Tuesday, June 19, 2012

Like most things on Linux, the sudo command is very configurable. You can have sudo run specific commands without asking for a password, restrict specific users to only approved commands, log commands run with sudo, and more.
The sudo command’s behavior is controlled by the /etc/sudoers file on your system. This command must be edited with the visudo command, which performs syntax-checking to ensure you don’t accidentally break the file.

Specify Users With Sudo Permissions

The user account you create while installing Ubuntu is marked as an Administrator account, which means it can use sudo. Any additional user accounts you create after installation can be either Administrator or Standard user accounts – Standard user accounts don’t have sudo permissions.
You can control user account types graphically from Ubuntu’s User Accounts tool. To open it, click your user name on the panel and select User Accounts or search for User Accounts in the dash.

Make Sudo Forget Your Password

By default, sudo remembers your password for 15 minutes after you type it. This is why you only have to type your password once when executing multiple commands with sudo in quick succession. If you’re about to let someone else use your computer and you want sudo to ask for the password when it runs next, execute the following command and sudo will forget your password:
sudo –k

Always Ask For a Password

If you’d rather be prompted each time you use sudo – for example, if other people regularly have access to your computer — you can disable the password-remembering behavior entirely.
This setting, like other sudo settings, is contained in the /etc/sudoers file. Run the visudo command in a terminal to open the file for editing:
sudo visudo
In spite of its name, this command defaults to the new-user-friendly nano editor instead of the traditional vi editor on Ubuntu.
Add the following line below the other Defaults lines in the file:
Defaults timestamp_timeout=0
Press Ctrl+O to save the file, and then press Ctrl+X to close Nano. Sudo will now always prompt you for a password.

Change the Password Timeout

To set a different password timeout – either a longer one like 30 minutes or a shorter one like 5 minutes – follow the steps above but use a different value for timestamp_timeout. The number corresponds to the number of minutes sudo will remember your password for. To have sudo remember your password for 5 minutes, add the following line:
Default timestamp_timeout=5

Never Ask for a Password

You can also have sudo never ask for a password – as long as you’re logged in, every command you prefix with sudo will run with root permissions. To do this, add the following line to your sudoers file, where username is your username:
You can also change the %sudo line – that is, the line that allows all users in the sudo group (also known as Administrator users) to use sudo – to have all Administrator users not require passwords:

Run Specific Commands Without a Password

You can also specify specific commands that will never require a password when run with sudo. Instead of using “ALL” after NOPASSWD above, specify the location of the commands. For example, the following line will allow your user account to run the apt-get and shutdown commands without a password.
username ALL=(ALL) NOPASSWD: /usr/bin/apt-get,/sbin/shutdown
This can be particularly useful when running specific commands with sudo in a script.

Allow a User to Run Only Specific Commands

While you can blacklist specific commands and prevent users from running them with sudo, this isn’t very effective. For example, you could specify that a user account not be able to run the shutdown command with sudo. But that user account could run the cp command with sudo, create a copy of the shutdown command, and shut down the system using the copy.
A more effective way is to whitelist specific commands. For example, you could give a Standard user account permission to use the apt-get and shutdown commands, but no more. To do so, add the following line, where standarduser is the user’s username:
standarduser ALL=/usr/bin/apt-get,/sbin/shutdown
The following command will tell us what commands the user can run with sudo:
sudo -U standarduser –l

Logging Sudo Access

You can log all sudo access by adding the following line. /var/log/sudo is just an example; you can use any log file location you like.
Defaults logfile=/var/log/sudo
View the contents of the log file with a command like this one:
sudo cat /var/log/sudo
Bear in mind that, if a user has unrestricted sudo access, that user has the ability to delete or modify the contents of this file. A user could also access a root prompt with sudo and run commands that wouldn’t be logged. The logging feature is most useful when coupled with user accounts that have restricted access to a subset of system commands.


How to Back Up and Restore Mail in Lion

SkyHi @ Tuesday, June 19, 2012

Lion’s Mail brings many new features, but it still won’t magically back up and restore your messages when you move to a new Mac or reinstall OS X. But don’t worry. It’s easy to transfer mail to a new copy of Mail, even if you don’t use Time Machine or another method to back up your Mac’s drive.

Difficulty Level: Easy

What You Need:

>> Lion’s Mail client
>> An external drive to which you can back up your data

1. Show Your Mailboxes

First, connect your external drive to your Mac. To back up one or more mailboxes, smart mailboxes, or folders, launch Mail, then click Show in the Favorites Bar to see them in Mail’s sidebar. Select each item you want to back up. Shift-click to select multiple adjacent items, or Command-click to select multiple nonadjacent items.

2. Export Your Messages

Next, select Mailbox > Export Mailbox in the Menu Bar, or click the gear icon at the bottom of the sidebar and choose Export Mailbox. Select your external drive in the Devices section of the Export sheet’s sidebar as the destination for your exported selections.
Check the Export All Subfolders box at the bottom of the sheet to export items complete with subfolders, then click Choose to export the data to your backup drive and eject your drive, which now contains your exported .mbox files.

3. Import Back to Mail

Launch Mail on your new Mac or a new installation of OS X and set up an account as prompted. Connect your drive, then choose Import > Import Mailboxes in Mail’s Menu Bar. In the resulting window, choose Apple Mail as the application you’ll be importing from. Select your external drive in the Import window, then select each .mbox file you want to import, and click Choose.
Confirm the import in the next window, then click Continue. Congratulations! Your imported mail will now appear in the Import folder in Mail’s sidebar.


git pretty log

SkyHi @ Tuesday, June 19, 2012
So, are you tired of this old and bored git log screen?

How about this one, instead?

It's simple. Just type in:
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
I guess that's a bit too long, eh? Let's just make an alias. Copy and paste the line below on your terminal:
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
And every time you need to see your log, just type in
git lg
Or, if you want to see the lines that changed
git lg -p

From my .gitconfig:
    # --- LOGS ---
    ll   = "log --pretty=oneline --abbrev-commit"
    lg   = log --pretty=oneline --abbrev-commit --graph --decorate --date=relative
    lgt  = log --graph --pretty=format:'%Cred%h%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
    lgtt = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative


Monday, June 18, 2012

WordPress Changing The Site URL

SkyHi @ Monday, June 18, 2012