## 2006/12/30

### Firefox settings to change

In Firefox 2, type "about:config" in the location bar, and press enter. You'll get some settings. Here are the ones I change:

Old New Setting/Affect
3 1 browser.cache.check_doc_frequency - check page every load.
true false browser.cache.disk.enable - don't cache to disk
140 140 browser.tabs.tabClipWidth - don't shot close button on tabs narrower than this
100 30 browser.tabs.tabMinWidth - let tabs become this narrow
1 3 browser.startup.page - restore your previous browsing session

## 2006/12/29

### MS SQL Tips

Here are some MS SQL Tips, Tricks, Recipes, etc.:

• Find out who's using what databases:
1. Open SQL Query Analyzer
2. type "exec sp_who" into the Query window.
3. Click "Execute Query" or press F5.
• From cryptosid at experts-exchange:
• before using DBCC REBUILD_LOG better check this article and read it through
http://www.sqlmag.com/Articles/Index.cfm?ArticleID=9011

a safe alternative would be
Backup the consistent Database.
and RESTORE the database with the MOVE option using which u can move the database files to whichever drive u want...
• Get information on a DB's logfile:
1. Open Query Analyzer
2. Type this in the query window, then click Execute Query:
• use db_name
• Detach and re-attach a database:
1. confirm that nothing has the db open. Open QA and run "exec sp_who"
2. If nobody is using the db, detach the database with the QA command "EXEC sp_detach_db 'db_name' ", or right-click the DB in the enterprise mgr and select "detach database".
3. Re-attach the DB by using the QA command "EXEC sp_attach_db 'db_name', 'x:\full\path\to\db\file\db_filename.MDF' " or by right-clicking the databases in the enterprise mgr, and select "attach database".
• How to set up SQL mail
• http://support.microsoft.com/?id=263556
• Safely delete a transaction log:
1. make sure nobody's using the database, as above under "Detach..."
2. Backup the database.
3. make sure nobody's using the database still.
4. detach the database, as above.
5. rename the log file (.LDF file)
6. re-attach the database, as above.
7. logfile should be automatically re-created.
• From rsrm at experts-exchange, http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20823435.html

## 2006/12/18

### bash shortcuts

from http://www.howtogeek.com/howto/ubuntu/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/

Ctrl + A : Go to the beginning of the line you are currently typing on
Ctrl + E : Go to the end of the line you are currently typing on
Ctrl + L : Clears the Screen, similar to the clear command
Ctrl + U : Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + H : Same as backspace
Ctrl + R : Let’s you search through previously used commands
Ctrl + C : Kill whatever you are running
Ctrl + D : Exit the current shell
Ctrl + Z : Puts whatever you are running into a suspended background process. fg restores it.
Ctrl + W : Delete the word before the cursor
Ctrl + K : Clear the line after the cursor
Ctrl + T : Swap the last two characters before the cursor
Esc + T : Swap the last two words before the cursor
Alt + F : Move cursor forward one word on the current line
Alt + B : Move cursor backward one word on the current line
Tab : Auto-complete files and folder names

## 2006/12/15

### SCSI Tape status codes in Linux

Status Bit   DescriptionBOT          The tape is positioned at the beginning of the first            file.EOT          A tape operation has reached the physical End Of            Tape.EOF          The tape is positioned just after a filemark.WR_PROT      The tape (or drive) is write-protected. For some            drives this can also mean that the drive does not            support writing on the current medium  type.ONLINE       The drive has a tape in place and ready for            operation.DR_OPEN      Door is open. Depending on the type of drive, this            usually means that the drive does not have a tape in            place.IM_REP_EN    Immediate report mode. This bit is set if there are            no guarantees that the data has been physically            written to the tape when the write call  returns. It            is set to zero only when the driver does not buffer            data and the drive is set not to buffer data.SM           The tape is currently positioned at a setmark. DDS            specific.EOD          The tape is positioned at the end of recorded data.            DDS specific.D_6250D_1600D_800        This "generic" status information reports the current            density setting for 9-track 1/2 inch tape drives only.

## 2006/12/13

### Linux kernel debugging first steps on i386

(from the SGI XFS mailing list)If you have compiled in kdb and you get an oops (at least in 2.4 series kernels):Next time it hangs, enter these kdb commands andcapture the output on the serial console.set LINES 10000set BTAPROMPT 0-md1c320 system_utsname-id %eip-0x40-cpu-ps-dmesg 200-bt-bta

## 2006/12/01

### Hide OS and Apache version number

By default (at least on RHEL 4, CentOS 4.x, and related distros), Apache web server will give the version number of Apache, as well as your OS. This will make it easier for an attacker to guess what vulnerabilities your web server (or host OS) may have. This information can be hidden by changing these two lines in /etc/httpd/conf/httpd.conf:
ServerTokens ProductOnlyServerSignature Off
Note that this won't actually fix any vulnerabilities, but it will make an attacker have to either guess or scan to determine what vulnerabilities you may have.

An even better idea is to front your apache with modsecurity (perhaps even on a separate (virtual) server), and have modsecurity tell everyone that your apache web server is really an IIS server.

To hide the Apache PHP version number, add/change this line in /etc/php.ini:
expose_php = Off