Connect to serial console from Linux command line

The easiest way to connect to a serial console from Linux command line is using the screen command. In my example below, I will show you how to connect to a serial console of a server using the serial to usb cable.

[root@test ~]# screen /dev/ttyUSB0
******************************************
 Connected to *******
******************************************

Enjoy 🙂

Rename a host in BackupPC

Follow the below steps to rename a host in BackupPC.
1. Stop BackupPC service :

service backuppc stop

2. Login to the configuration folder

cd /etc/BackupPC

2. Change the host file to the corresponding one :

vi hosts

*change old_host to new_host*

3. Rename the pl file in pc folder :

cd pc

mv old_host.pl new_host.pl

4. Make the changes in the backup location (I assume your backup is storing in the location /backup):

cd /backup/filesystem/pc/

mv old_host new_host

5.Start Backuppc service:

service backuppc start

6. Login to the backuppc console and make sure that the changes are replicated there.

 

Enjoy 🙂

Update the host entry of a user in MySQL

First of all find all the users in your database having permissions.

mysql> select user,host from mysql.user;

If you want to see their permissions,

mysql> show grants for 'root'@'localhost';

Now you want to change the host part of a user. You can issue the below command :

mysql> UPDATE mysql.user SET host = 'New_IP' WHERE host = 'Old_IP' AND user = 'user_you_want_to_change';
mysql> flush privileges;

Very easy 🙂

 

Proper Permissions in Linux

It is always a bad idea to keep all the files and folders with full permissions (file : 666 and folders : 777) for the sake of getting rid of the errors. Use the below commands to find out all the files and folders with full permission under the account /home/theg :

find /home/theg -type f -perm 666 -print
find /home/theg -type d -perm 777 -print

 

Use the below command to change all the permissions to 755 for all the folders and 644 for all the files :

find /home/theg/ -type d -perm 777 -exec chmod 755 {} \;
find /home/theg/ -type f -perm 666 -exec chmod 644 {} \;

Enjoy !!! 🙂