this helps found the biggest folder in the same folder:
du -h --max-depth=1 /home | sort -n -r
this helps found the biggest folder in the same folder:
du -h --max-depth=1 /home | sort -n -r
this error means that too many files are open for the given process. There is a read-only mysql variable called open_files_limit
that will show how many open files are allowed by the mysql server.
A lot systems set this to something very low, like 1024. Unfortunately, the following will NOT work:
SET open_files_limit=100000
MySQL will respond with:
ERROR 1238 (HY000): Variable 'open_files_limit' is a read only variable
However, it is possible to make a change to /etc/my.cnf
. This file may not exist, if not, just create it. Be sure it has the following contents:
[mysqld] open_files_limit = 100000
Then, be sure to restart mysql:
sudo /etc/init.d/mysql restart
Now, SHOW VARIABLES LIKE 'open%'
should show 100000. The number you use may be different.
rsync -aAXv /* /destination --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}
First of all stop mysql server and run:
mysqld_safe –skip-grant-tables
In new console connect to mysql:
mysql –user=root mysql
update user set Password=PASSWORD(‘reseted_password’) where user=’root’;
flush privileges;
If your server in under ddos, sometimes tcpdump is quit useful:
time tcpdump -tnn -c 20000 -i em1 | awk -F "." '{print $1 "." $2 "." $3 "." $4}' | sort | uniq -c | sort -nr | awk '$1 > 100'
directadmin pre-install:
yum install wget screen gcc gcc-c++ flex bison make bind bind-libs bind-utils openssl openssl-devel perl quota libaio libcom_err-devel libcurl-devel gd zlib-devel libcap-devel bzip2 db4-devel cyrus-sasl-devel perl-ExtUtils-Embed autoconf automake libtool
run screen and install:
screen
wget http://www.directadmin.com/setup.sh && chmod 755 setup.sh
begin directadmin installation: ./setup.sh
Its very simple to list MySQL users:
use mysql;
SELECT User FROM mysql.user;
ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Created directory ‘/root/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
43:c9:50:3d:3f:28:b5:c5:88:60:79:bb:35:f3:c7:35 [email protected]
The key’s randomart image is:
+–[ DSA 1024]—-+
| ++.o o |
| ..oo.= o |
| .+o * |
| .o * o E.|
| S+ + o ..|
| .. . o |
| . |
| |
| |
+—————–+
Now you can use ssh-copy-id to move your public key to remote server.
Fix:
/scripts/update_local_rpm_versions --edit target_settings.munin uninstalled
Sometimes its very useful, to kill all user active process in Linux:
killall -9 -u bad_user
Just:
:%s/^/#/
vi /etc/squid/squid.conf
tcp_outgoing_address 127.0.0.1
squid -k reconfigure
Assuming you have a running container identified by $CTID
. The following needs to be done:
# Known snapshot ID ID=$(uuidgen) VE_PRIVATE=$(VEID=$CTID; source /etc/vz/vz.conf; source /etc/vz/conf/$CTID.conf; echo $VE_PRIVATE) # Take a snapshot without suspending a CT and saving its config vzctl snapshot $CTID --id $ID --skip-suspend --skip-config # Perform a backup using your favorite backup tool # (cp is just an example) cp $VE_PRIVATE/root.hdd/* /backup/destination # Delete (merge) the snapshot vzctl snapshot-delete $CTID --id $ID
Assuming you have a running container identified by $CTID
. The following needs to be done:
# Known snapshot ID ID=$(uuidgen) # Directory used to mount a snapshot MNTDIR=./mnt mkdir $MNTDIR # Take a snapshot without suspending a CT and saving its config vzctl snapshot $CTID --id $ID --skip-suspend --skip-config # Mount the snapshot taken vzctl snapshot-mount $CTID --id $ID --target $MNTDIR # Perform a backup using your favorite backup tool # (tar is just an example) tar cf backup.tar.xz $MNTDIR # Unmount the snapshot vzctl snapshot-umount $CTID --id $ID # Delete (merge) the snapshot vzctl snapshot-delete $CTID --id $ID
In addition:
How to start?
In global VZ configuration file /etc/vz/vz.conf:
VE_LAYOUT=ploop
If you see this error message or something like WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! you should don’t worry if you know your server RSA key was really changed, like your server was re installed. What to do?
The RSA host key for linux4you.tk has changed,
and the key for the corresponding IP address 5.199.164.77
is unchanged. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
ssh-keygen -R linux4you.tk