An inode is used for every file in the filesystem. If the system is running out of inodes that means there are some directories with a lot of files in them.
The following command will find the directories with most files.
find / -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n
The following command list free inodes on all filesystems
Empty an in-use nohup.out file
cat /dev/null >nohup.out
If the file is not in use, the following works in bash
The command above empties out the file foo.log
If sudo is needed, truncate can be used as well
sudo truncate -s 0 foo.log
-s is the size option. 0 in this example sets the size to 0 bytes
ERROR 1130 (HY000): Host ‘xx.xx.xx.xx’ is not allowed to connect to this MySQL server
Fix for this error:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'rootpassword' WITH GRANT OPTION;
This article applies to Red Hat, Fedora, CentOS, AWS Linux distros.
For enabling, disabling and listing system services, use the script called chkconfig.
List all services
List a specific service
chkconfig --list httpd
Turn a service on for specific levels
chkconfig httpd on --level 2,3,5
Disable a service
chkconfig httpd off
For stopping, starting and restarting a service, use the script called service.
service httpd stop
service httpd start
service httpd restart
The Amazon EC2 Linux instances come without a swap file. The steps below show how to add a swap file to an EC2 Linux server.
dd if=/dev/zero of=/mnt/swapfile bs=1M count=4096
chown root:root /mnt/swapfile
chmod 600 /mnt/swapfile
To make these changes permanent (reboot proof). Add the following line to /etc/fstab
/mnt/swapfile swap swap defaults 0 0