MySQL set Fulltext Min_Word_Len

add the following to my.cnf under [mysqld]

ft_min_word_len=2

stop mysql
myisamchk –recover –ft_min_word_len=2 /var/lib/mysql/*/*.MYI
start mysql

MySQL Dump database to Email

To backup a database and send it to email, add a cron job like:

mysqldump -ce –user=user –password=pass dbname | gzip |uuencode dbbackup.gz| mail -s “xxxx Database Backup” me@mydomain.com

MSSQL Express Scheduled Backups

The Express edition of SQL server lacks automated scheduled backup functionality.  The following script will back up your databases.  It retains them for 7 days but can be easily edited:

Create a directory called c:\SQLBackup and go into it

Create a backup.sql file:

DECLARE @name VARCHAR(50) — database name
DECLARE @path VARCHAR(256) — path for backup files
DECLARE @fileName VARCHAR(256) — filename for backup
DECLARE @fileDate VARCHAR(20) — used for file name

Mailman reset password

Reset a mailing list password in Mailman:

/usr/lib/mailman/bin/change_pw -d mydomain.com -ptemppass

Linux reset root password

A Linux servers root password can be reset in a few simple steps via single-user mode.

To enter single-user mode, reboot your computer. If you use the default boot loader, GRUB, you can enter single user mode by performing the following:

1. At the boot loader menu, use the arrow keys to highlight the installation you want to edit and type [A] to enter into append mode.
2. You are presented with a prompt that looks similar to the following:

grub append> ro root=LABEL=/

3. Press the Spacebar once to add a blank space, then add the word single to tell GRUB to boot into single-user Linux mode. The result should look like the following:

ro root=LABEL=/ single

4. Press [Enter] and GRUB will boot single-user Linux mode. After it finishes loading, you will be presented with a shell prompt similar to the following: sh-2.05b#

5. You can now change the root password by typing:

passwd root
6. You will be asked to re-type the password for verification. Once you are finished, the password will be changed.

You can then reboot by typing reboot at the prompt; then you can log in to root as you normally would.

Linux / nix Error Codes

Not comprehensive, but comes in handy:

*  EPERM 1 /* Operation not permitted */ (Linux)
*  EPERM 1 /* Not owner */ (SCO Unix)
*  ENOENT 2 /* No such file or directory */
*  ESRCH 3 /* No such process */
*  EINTR 4 /* Interrupted system call */
*  EIO 5 /* I/O error */
*  ENXIO 6 /* No such device or address */
*  E2BIG 7 /* Arg list too long */
*  ENOEXEC 8 /* Exec format error */
*  EBADF 9 /* Bad file number */
*  ECHILD 10 /* No child processes */

IPTables Examples

As it is a table of rules, the first rule has precedence. If the first rule dis-allows everything then nothing else afterwards will matter.

* INIVIDUAL REJECTS FIRST
* THEN OPEN IT UP
* THEN BLOCK ALL

List iptable rules:
iptables -n -L (-n prevents slow reverse DNS lookup)

Add rule to Reject all from an IP Address:
iptables -A INPUT -s 136.xxx.xxx.xxx -d 136.xxx.xxx.xxx -j REJECT

Add rule to Allow in SSH from everywhere:
iptables -A INPUT -s 0.0.0.0/0 -d 136.xxx.xxx.xxx -p tcp –dport 22 -j ACCEPT

-I will insert the rule on top -A will append it last in list

You can either delete by number or by recreating the rule. “iptables -D
INPUT 3″ will remove the 3rd (counting from 1) rule. Or “iptables -D
INPUT -s 65.75.152.40 -j DROP” will remove the corresponding entry

iptables -D INPUT -s 127.0.0.1 -p tcp –dport 111 -j ACCEPT
// -D = delete appropriate rule. If you dont know the exact syntax of the rule to delete do the following:
iptables -L
//count down the number of lines until you reach the rule you wish to delete
iptables -D INPUT 4
//format = iptables -D CHAIN #Rule_No

Examples:

http://defindit.com/readme_files/iptables.html

Identifying Rogue Processes in IIS

Bring up a command prompt and execute:

iisapp.vbs

This gives you a mapping of process id to application pool.  Next bring up the task manager and identify the process that you are interested in.  If process ids are not currently shown, go to the view menu, select Choose Columns and tick PID.

You should now know the Application Pool that your process belongs to.

Next you need to run DebugDiag.

Test HTTP with Telnet

# Telnet to server on port 80

GET /index.html HTTP/1.0

Host: www.test.com

For HTTPS you will need to use openssl:

openssl s_client -connect localhost:443

GET /index.html HTTP/1.0

openssl s_client -connect localhost:443

Horde Plesk enforce signature

To enforce a signature/footer on all users:

Edit /usr/share/psa-horde/imp/config/trailer.txt