Epson 4800 Maintenance Required 0002 Error Code – Reset Key Sequence

Posted by | Posted in Epson, Hardware, Printer, Stylus Pro 4800 | Posted on 21-04-2010

This afternoon, one of our Epson Stylus Pro 4800 printers developed a maintenance required 0002 error code. The code refers that the Carriage Return Motor or CR Motor has reached the end of its life and should be replaced. At the time this Epson 4800 had printed 16,195 prints and had transferred the print head (carriage) back and forth 4,995,102 times.

To reset the CR Motor count, you have to enter “Service Mode 2″. To do this, follow the following steps.

1. Turn off your Epson 4800.
2. Hold down the Pause, down and menu buttons.
3. Restart the Epson 4800 while holding down the buttons mentioned above.
4. Continue to hold the buttons down until you see “Service Mode 2″.
5. Use the up and down arrows to navigate to clean counts.
6. Locate the CR Motor count.
7. You should see an “Exec” on the screen.
8. Use the right arrow to select “Exec”.
9. Press the menu right arrow one more time to execute the clear command.
10. power off and then power back on your printers. The error should be cleared.

Note: Your print quality may degrade with time. Epson recommends that you replace the CR motor when this error appears.

Forbidden Error with .htaccess files in WordPress

Posted by | Posted in Apache, FollowSymlinks, Httpd, Linux, RewriteBase, RewriteCond, RewriteEngine, RewriteRule, Wordpress | Posted on 24-03-2010

I’ve been using WordPress for a number of years and decided to switch my permalink structure. It originally was set to the default setting of ?p=100. I wanted to increase my SEO so I changed it to the current format Year / Month / Day / Post-Name. When I switch over, wordpress automatically created a .htaccess file in my webroot folder and locked me out of my website with a Forbidden Error.

Forbidden
 
You don't have permission to access / on this server.

The .htaccess file that was created looked like this.

< IfModule mod_rewrite.c >
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
< / IfModule >

After chatting with my web administrator, we came to the conclusion that FollowSymlinks in Apache was off be default. I needed to manually turn it on. The new .htaccess file looks like this.

< IfModule mod_rewrite.c >
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
< / IfModule >

Additional Links:

Apache RewriteEngine
WordPress Codex for Permalinks

Backing up and Restoring your MySQL database – Ubuntu

Posted by | Posted in Bash, Code, Command-Line, Guides, Linux, MySQL, Ubuntu | Posted on 23-07-2009

If you manage any type of databases, you know the importance of backing up your data. Whether you have file corruption from a failing hard drive, a run away script or from a hacking attempt; loosing your databases can and will break your business. If you’ve never backed up your database, now is a good time to start.

The easiest way to backup your MySQL database is with “/usr/bin/mysqldump”. You’ll need to access this application via command. Whether it is from the a console or an SSH connection.

mysqldump – a database backup program
mysqldump [options] [db_name [tbl_name ...]]

There are three general ways to invoke mysqldump:

mysqldump [options] db_name [tables]
mysqldump [options] --databases db_name1 [db_name2 db_name3...]
mysqldump [options] --all-databases

By default, the mysqldump command will dump the contents of your database directly into your terminal and not into a file. This output can be redirected anyway and to anywhere you like. But it is commonly used in this manner:

mysqldump -u [username] -p [password] [databasename] > [backup.sql]
mysqldump -u root -p PASSWORD DATABASE > DATABASE-BACKUP-DATE.sql

[username] – your database username
[password] – the password for your database
[databasename] – the name of your database
[backup.sql] – the file to which the database contents needs to be directed to

If you don’t want to use your password in the command line, you can always prompt for your password by excluding it from your command.

mysqldump -u root -p DATABASE > DATABASE-BACKUP-DATE.sql
Enter password:

If you forgot your password, you’ll get an error like this.

mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect

Or if you didn’t enter a password when one is needed, you’ll get this error.

mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect

If you’d like the convenience of having the database automatically delete the old database before re-writing the content you can use the “–add-drop-table” feature.

 mysqldump --add-drop-table -u root -p PASSWORD DATABASE > DATABASE-BACKUP-DATE.sql

If you need to only backup specific tables of the database you can use this command.

mysqldump --add-drop-table -u root -p PASSWORD DATABASE TABLE> DATABASE-TABLE-BACKUP-DATE.sql

The syntax for the command is:

mysqldump -u [username] -p [password] [databasename] [table1 table2 ....]

[tables] – This is a list of tables to backup. Each table is separated by a space.

If you are a server administrator and need to backup multiple databases at the same time, you can use the next command. You just have to be sure that the “-u” user account has permission to read those databases.

mysqldump -u root -p PASSWORD --databases DATABASE1 DATABASE2 DATABASE3 > DATABASE-1-2-3-BACKUP-DATE.sql

Or if you just want to back up ALL the databases at one, use the “–all-databases” parameter to backup all the databases in the server in one easy step.

mysqldump --all-databases> ALL-DATABASES-DATE.sql

How to back up only the data structure.

While in development, most programmers only need to back up their database structure, not their test data. To do this, use the “–no-data” parameter.

mysqldump --no-data --databases DATABASE1 DATABASE2 DATABASE3 > DATABASE-1-2-3-Structure-Bakcup-DATE.sql

If you have large databases and not enough hard drive space to store them in the regular SQL, text format, you can compressing the backup file on the fly.

mysqldump --all-databases | bzip2 -c >all-databases-backup-date.sql.bz2
 
mysqldump --all-databases | gzip >all-databases-backup-date.sql.gz

If you are away from your servers, or have multiple servers that you manage, you can still backup your databases while you are away. Use the bash script below in conjunction with a cron-tab to automate your backups.

#!/bin/sh
date=`date -I`
mysqldump --all-databases | gzip > /var/mysql_backup/mysql-backup-all-$date.sql.gz

How to restore your databases.

If the unforeseen happens and you need to totally rebuild your databases, you can do so easily from the mysqldump SQL files.

mysql -u root -p PASSWORD DATABASE < DATABASE-BACKUP-DATE.sql

Mysql Synopsis:

mysql -u [username] -p [password] [database_to_restore] < [backup_file.sql]

Restoring from the compressed files.

gunzip < DATABASE-BACKUP.sql.gz | mysql -u root -p PASSWORD DATABASE

Or do 2 at a time.

cat DATABASE-BACKUP-1.sql DATABASE-BACKUP-2.sql | mysql -u root -p PASSWORD

Join the mailing list

Check your email and confirm the subscription