Optimize MySQL tables

Optimize single database table:

mysql> OPTIMIZE TABLE my_table

 

Optimize entire database:

shell# mysqlcheck -op -u root your_database_name

 

Optimize ALL databases:

shell# mysqlcheck -u root -p --auto-repair --check --optimize --all-databases

Fix: send-mail: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol

Here’s how to fix the following Postfix issue:

send-mail: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol
send-mail: warning: inet_protocols: configuring for IPv4 support only
postdrop: warning: inet_protocols: IPv6 support is disabled: Address family not supported by protocol
postdrop: warning: inet_protocols: configuring for IPv4 support only

# /usr/sbin/postconf | grep inet_protocols
inet_protocols = all

# vi /etc/postfix/main.cf

Search for: inet_protocols and change it from “inet_protocols = all” to “inet_protocols = ipv4”
Save /etc/postfix/main.cf and and restart Postfix service:

# /etc/init.d/postfix restart

HOWTO INSTALL RKHUNTER (QUICK GUIDE)

HOWTO INSTALL RKHUNTER (QUICK GUIDE)
1. Download the later rkhunger version from sf.net: http://sourceforge.net/projects/rkhunter/
2. shell# tar -zxvf tar -zxvf rkhunter-1.4.0.tar.gz
3. shell# cd rkhunter-1.4.0
4. shell# ./installer.sh –layout default –install
5. shell# /usr/local/bin/rkhunter –update
6. shell# /usr/local/bin/rkhunter –propupd
7. shell# vi /etc/cron.daily/rkhunter.sh
8: Add the following configuration to rkhunter.sh cron script:

-=-=- cut -=-=-
#!/bin/sh
(
/usr/local/bin/rkhunter –versioncheck
/usr/local/bin/rkhunter –update
/usr/local/bin/rkhunter –cronjob –report-warnings-only
) | /bin/mail -s ‘rkhunter Daily Run (PutYourServerNameHere)’ your@email.here
-=-=- end -=-=-

9. chmod 700 /etc/cron.daily/rkhunter.sh
10. You’re good to go :)

Moving solaris zones between different global zones (hosts)

Suppose you have a Solaris zone (ZONENAME) on one host and want to move it on other global zone.

On first server:

1. zoneadm -z ZONENAME halt
2. zoneadm -z ZONENAME detach
3. cd $ZONEHOME
4. tar -cf ../zonename.tar .
5. scp ../zonename.tar user@server2:/$ZONEPATH

On the second server:

1. mkdir $ZONEHOME
2. cd $ZONEHOME
3. tar -xf ../zonename.tar .
4. zonecfg -z ZONENAME
>create -a $ZONEHOME
>exit
5. zoneadm -z ZONENAME attach
6. zoneadm -z ZONENAME boot

You’re good to go :)

List the 10 Largest Files & Directoris with “du” command

[smrad.net ~] du -sh * | sort -nr | head -10

Ценоразпис

Обаждате се за да питате дали тази ценова листа е истинска ))))
( Ако изобщо ви хрумне да зададете този въпрос по-добре не четете надолу ) $ 40
Обаждане с въпрос $ 10
Обаждане с тъп въпрос $ 20
Обаждане с тъп въпрос, като при това не можете точно да обясните проблема $ 30
Да настоявате, че аз съм некомпетентен защото не мога да разбера за какво точно става въпрос от неясните ви обяснения $ 1000
Задаване на въпрос, чийто отговор е в HELP -$ 10 ( а трябва да е повече ! )
Да ме питате трябва ли ви модем за да влезете в Интернет $ 20 независимо от отговора

Continue reading