Thursday, December 24, 2009
Locking Down Mozilla Firefox
Monday, October 19, 2009
Nagios: check_http, using the --invert-regex option
Friday, September 11, 2009
Bash: Finding files between two dates in the current directory
find . -type f -exec ls -l --time-style=full-iso {} \; | awk '{print $6,$NF}' | awk '{gsub(/-/,"",$1);print}' | awk '$1>= 20071019 && $1<= 20071121 {print $2}'
find *.pgp -type f -exec ls -l --time-style=full-iso {} \; | awk '{print $6,$NF}' | awk '{gsub(/-/,"",$1);print}' | awk '$1>= 20071019 && $1<= 20071121 {print $2}'
find *.pgp -type f -exec ls -lh --time-style=full-iso {} \; | awk '{print $6,$NF,$5}' | awk '{gsub(/-/,"",$1);print}' | awk '$1>= 20090624 && $1<= 20090901 {print $2,$3}'
Howto Make a T1 Crossover Cable
I learned this one about a month ago while turning up the T1 connection for my fax server. The tech that installed the Cisco equipment left us with a crossover cable, but a data one, so I cut the ends off and re-crimped the cable like so:
You only have to worry about 4 of the 8 wires if you are using typical cat-5 cable like I did.
1 <—> 4
2 <—> 5
4 <—> 1
5 <—> 2
Or if you go by colors like I do
Side 1 (left is cable end, clip underneath):
Pin 1: Orange White
Pin 2: Orange Solid
Pin 3: none
Pin 4: Blue Solid
Pin 5: Blue White
Pin 6: none
Pin 7: none
Pin 8: none
Side 2 (left is cable end, clip underneath):
Pin 1: Blue Solid
Pin 2: Blue White
Pin 3: none
Pin 4: Orange White
Pin 5: Orange Solid
Pin 6: none
Pin 7: none
Pin 8: none
Then you are done!
Monday, August 03, 2009
How do I disable PS2 Parental Controls?
Friday, July 24, 2009
Reset the maintenance counter on an HP 4000 Laserjet
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
http://www.mediawiki.org/wiki/Manual:Installation_requirements
Tuesday, July 14, 2009
Ghostscript Convert PDF to TIFF
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
Tuesday, July 07, 2009
Copy Directory Structure Only
Friday, June 26, 2009
Installing VirtualBox machine Additions on CentOS 5.1 - 5.3
I have been working on this system in a ridicously small screen for a little while now and finally got sick of it. I had tried installing the Virtual Machine additions before, but it failed for one reason or another. This time around I was determined to get everything up and running properly, so A) I wouldn't have to work on such a small screen and B) I could just move my mouse between the VM and my Desktop with out hitting a button.
Anyways, on to the meat of this, how to install the pre-requsite libraries and the Virtual Machine additons on CentOS. Now I just did this on a CentOS 5.3 install, but it has reportidly worked as far back as 5.1.
First you need to install the kernel sources and gcc, if you don't already have them.
yum isntall -y gcc
yum install -y kernel sources kernel-devel
Then you need to create a symbolic link to the kernel source:
ln -s /usr/src/kernels/2.6.18-92.1.18.el5-i686 /usr/src/linux
After this it is best to reboot the machine:
shutdown -r now
Once the machine has come back online you can mount the Guest additions ISO and install them via one of two commands depending on your architecture:
sh VBoxLinuxAdditions-x86.run
or
sh VBoxLinuxAddtions-amd64.run
After either of these commands are run you will have to once again reboot the Virtual Machine:
shutdown -r now
After the reboot you should be able to move the mouse between the VM and you Host OS without unlocking it and any of the other nifty features the Guest additions add.
Wednesday, May 27, 2009
Failed to modify password entry for user while adding user with smbpasswd
I read over the man pages for smbpasswd and saw that I needed to add the -n switch because this user will not have a password. So again I tried to add the user with "smbpasswd -a -n [USER]" and got the same error.
A quick Google search lead me to a newb mistake on my part... I didn't have the user I was trying to add in my UNIX password file. A quick "useradd [USER]" followed by the same "smbpasswd -a -n [USER]" and I was all set.
Granted there are other reasons why this process might fail, but for me this was the reason.
Friday, May 22, 2009
A simple file shredder for Windows
I happened upon this script on Lifehacker a while ago, but I have been using it more and more lately.
First you will need to download sdelete from Microsoft. I copy this exe to the Windows directory on each machine as part of my install process.
The script if very simple:
@echo off
FOR %%F IN (%1 %2 %3 %4 %5 %6 %7 %8 %9 %10) DO sdelete -p 7 -s %%F
I save this as shred.cmd and place it in my C:\Scripts folder. It will take up to 10 files at a time and run sdelete with 7 passes on each file. Sdelete will also rename the file 26 times to obfuscate the file name.
About once a month I will run sdelete -p 3 -z to clean the free space on my PC and to make sure that any temp files I didn't shred are cleaned up. Now this won't obfuscate the file names at all, but the contents of the files are gone for good.
You can also place a short cut to the shred.cmd file into your Send To menu options and have an easy way to clean files from any folder.
Adding programs to the "Send To" menu
If you open up %APPDATA%\Microsoft\Windows\SendTo in Windows Explorer.
You see %APPDATA% is an environment variable that usually maps to something like C:\Documents and Settings\[YOUR USER PROFILE]\Application Data\ in Windows 2000/XP and "C:\Users\[YOUR USER PROFILE]\Application Data\" in Windows Vista.
Let's say you wanted to add an item to the Send To menu to shred files with sdelete. You could just drag a shortcut to the shred script this folder, or create a new shortcut.
This method should work for any application that allows you to open a file by using a command line argument.
Wednesday, May 06, 2009
mail command returns fseek Invalid argument, panic temporary file seek
Thursday, April 23, 2009
Excluding Directories from updatedb on CentOS 5
- vi /etc/updatedb.conf
- find the PRUNEPATHS section and add the directories to the list seperated by spaces. (PRUNEPATHS = "/afs /media /net /sfs /tmp /udev /var/spool/cups /var/spool/squid /var/tmp /Storage /home")
Friday, March 20, 2009
error: can't create transaction lock on /var/lib/rpm/__db.000
Tuesday, February 17, 2009
memcached init.d statup scripts for CentOS 5.2.
Please check your autoconf installation and the $PHP_AUTOCONFenvironment variable is set correctly and then rerun this script.
Tuesday, February 10, 2009
How to: mod_expires & mod_deflate in Apache running on CentOS 5
Tuesday, January 27, 2009
Webmin 1.450 is out!
Friday, January 23, 2009
Things learned over time, Part 1
Thursday, January 22, 2009
301 Permenant Redirects in Apache on CentOS
Thursday, January 15, 2009
How to: Use chkconfig, or keeping your services running on a new run level
Switching Run Levels in CentOS
Wednesday, January 14, 2009
Spiceworks releases 3.5!
Friday, January 09, 2009
Configuring PuTTY to use PKI (passwordless) authentication
Configuring CentOS 5.2 to accept passwordless authentication via PKI
nagstamon: A Nagios system tray monitor




