Friday, July 24, 2009

Reset the maintenance counter on an HP 4000 Laserjet

There are two methods to resetting the maintenance counter on an HP 4000 Laserjet printer.

The first method is the fastest, but may not work due to many different board revisions.
1. Turn the printer off.
2. Hold down the "Item" key (the minus side of the button) and "Value" key (the minus side).
3. Turn the printer on.
4. Wait for "RESET MAINTENANCE COUNT" to be displayed and then release both keys.

If this method fails, like it did for me, you will have to enter service mode. This mode is generally reserved for service technicians and really the only reason to go into it is to reset the maintenance counter.

To get into service mode:
1 Hold down "Select" and "Cancel Job" while turning on the printer until all of the lights on the Control Panel are lit. Note that if the Control Panel reads INITIALIZING, the keys were released too soon.
2 Press the right side of the "Menu" key, then press "Select". The message SERVICE MODE is displayed.
3. Press "Menus" once to display SERVICE MENU.
4. Once it says SERVICE MENU press ITEM to scroll through service mode items.
5. Once on the Maintenance Counter screen, press "Select" on each number in the Maintenance counter. You can change them by hitting the "Value" key to the left or right and move between the digits by using the "Item" key.
6. To exit the Service Mode press [Go].

Tuesday, July 21, 2009

Mediawiki System Requirements

I am going to be installing Meidawiki for our internal use and I had a little trouble finding the System Requirements for the software. Just posting it here so I can find it easily again in the future.

http://www.mediawiki.org/wiki/Manual:Installation_requirements

Tuesday, July 14, 2009

Ghostscript Convert PDF to TIFF

Again this is mainly for my reference, but someone may have trouble finding the solution like I did earlier today.

On Windows be sure to add "C:\Program Files\gs\gs8.64\bin" to your PATH, then run the following command.

gswin32c -dNOPAUSE -q -r300 -sDEVICE=tiffg4 -dBATCH -sOutputFile=[YOUR_OUTPUT_FILENAME.TIFF] [YOUR_INPUT_FILENAME.PDF]

Similarly on Linux you can run the command below.

gs -dNOPAUSE -q -r300 -sDEVICE=tiffg4 -dBATCH -sOutputFile=[YOUR_OUTPUT_FILENAME.TIFF] [YOUR_INPUT_FILENAME.PDF]

There are also possibilities to script this, and when you can do that you should. I haven't found the need to bring it to that point yet as I just had to do four files today, but should this come up again I will be scripting it in some fashion and posting the results here.

Thank you to StackOverflow for the solution to my problem. Also one of the other solutions to this is to use a recursive search of a directory with PowerShell to convert files.

Friday, July 10, 2009

Creating a RAID 5 Array in software on CentOS 5.3

In order to create a RAID 5 array entirely in software on Linux you need to do a few things.

First I used three Identical drives, same speed, size, make, and model. This may not be a requirement, but
it will defiantly help the process. For RAID 5 you will need at least three partitions of the same size.

I picked up a four disk internal hot-swap enclosure from Addonics (http://www.addonics.com/products/raid_system/ae4rcs35nsa.asp) and
a hot-swap capable raid card. Once I got everything physically installed in the server case I booted into CentOS 5.3
and got on the command line. The first thing you need to do is create partitions on the blank drives and set them to be
Linux raid autodetect (Hex value of fd). To do this run fdisk /dev/sdX where X is the drive(s) that you want to partition for the RAID array.
For me this was SDC, SDD, SDE but you results will vary.

fdisk /dev/sdc
n [ENTER]
e [ENTER]
4 [ENTER]
[ENTER]
[ENTER]
n [ENTER]
l [ENTER]
t [ENTER]
5 [ENTER]
fd [ENTER]
w [ENTER]

You will want to create an Extended partition so choose n for New partition. If you get stuck you can hit m to get the help menu.
After you hit n type e for Extended. Then you will have to enter a partition number, I choose 4 for all of my drives.
After that you n again and then choose l for logical partition type. Again it will ask for a partition number 1-4 are for primary and thus not an option,
so I choose 5 for all of my drives.

Once the logical partitions are created hit t to change the partition type. If you are unsure what to use hit l, but in this case we already know that we want to
use type fd for the Linux RAID auto.

Once the type has been changed you can type w to write this info to the drive and start on the next one.
fdisk /dev/sdd
n [ENTER]
e [ENTER]
4 [ENTER]
[ENTER]
[ENTER]
n [ENTER]
l [ENTER]
t [ENTER]
5 [ENTER]
fd [ENTER]
w [ENTER]
fdisk /dev/sde
n [ENTER]
e [ENTER]
4 [ENTER]
[ENTER]
[ENTER]
n [ENTER]
l [ENTER]
t [ENTER]
5 [ENTER]
fd [ENTER]
w [ENTER]

Now that we have three (the minimum) partitions for our RAID device we have to create it in CentOS. Here we will use a tool called mdadm to create the
actual RAID device in Linux.
/sbin/mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdc5 /dev/sdd5 /dev/sde5 [ENTER]
Once this returns back, and it should be pretty quick, you will have a RAID 5 device. To check the status of it run:
/sbin/mdadm --detail /dev/md0
/dev/md0:
Version : 00.90.03
Creation Time : Wed Jul 8 09:14:19 2009
Raid Level : raid5
Array Size : 2930271744 (2794.52 GiB 3000.60 GB)
Used Dev Size : 1465135872 (1397.26 GiB 1500.30 GB)
Raid Devices : 3
Total Devices : 3
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Fri Jul 10 11:20:02 2009
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0

Layout : left-symmetric
Chunk Size : 64K

UUID : 53f6f95a:9e33f5ba:7ac8ef3e:0a40921a
Events : 0.2

Number Major Minor RaidDevice State
0 8 21 0 active sync /dev/sdc5
1 8 37 1 active sync /dev/sdd5
2 8 53 2 active sync /dev/sde5
Now for me after I first created the RAID device the state was listed as clean, degraded, rebuilding. There was a place for the percentage rebuilt and
/dev/sde5 was listed as spare. It took the better part of a day for the rebuild to finish, given that it was a three terabyte device I am not surprised by that.

Once the rebuild was done I had to create a Physical volume for LVM to be able to manage the RAID device.
pvcreate /dev/md0

After that I was able to use system-config-lvm to create the storage volume and format the drive.

Tuesday, July 07, 2009

Copy Directory Structure Only

This is a simple one liner for copying a Directory structure, and not the contents.

find * -type d -exec mkdir /new_directory/\{\} \;

Now there are a few caveots to this of course, but they are simple.
First the /new_directory/ has to exist.
Second, you have to run the command from within the directory that you want to copy the structure from.

For example, if I need to copy the structure of /Storage to /newStorage I would:
mkdir /newStorage
cd /Storage
find * -type d -exec mkdir /newStorage/\{\} \;