Posts

Showing posts from September, 2014

Automation with Cron

In every linux cron service we found and it is most familiar command to every system administrator. I am proud to be one of them. CRON - Introduction : The cron is a daemon and we can manage it with service names crond. Cron is the best solution in all sort of Linux Operating systems to run scritps,commands at a determined or specified time. So as I did mentioned it is a service it will start with system and do its running as long as system running. Generally cron will executes commands or scripts in "sh" shell (/bin/sh) . If you want to run your script in a different shell dont forget mentioning it before executing the command. Cron Configuration file will be called as cron table and we can invoke it with command named as "crontab". Every user in linux have his/her own crontab and all users cron configurations will store at /var/spool/cron. All the cron jobs will be recorded at location /var/cron/log or /var/adm/cron/log. CRON - Format : Minute     Hour      DayofM

How to remove Shutdown,restart options from startmenu in windows server 2008.

1. Open run 2.Type gpedit.msc 3.choose User Configuration -> Administrative Templates -> Start menu & Task Bar Choose  Remove and prevent access to the Shut Down, Restart, Sleep, and Hibernate commands and open it and select enabled. Then see whether it is updated or not. If its not updated then open run and type as gpupdate /force and now shutdown,restart removed from start menu.

Basic MySQL Administration

1. How to create a user and along with his privileges automatically ? GRANT ALL PRIVILEGES ON database.* To 'username'@'hosr or IP ' IDENTIFIED BY 'password'; flush privileges; 2. How to give only specific privileges to users ? GRANT select,lock tables ON *.* To 'user'@'host or IP ' IDENTIFIED BY 'password'; flush privileges; 3. How to see permissions of a user ? show grants for 'username'@'hostanme'; 4. How to revoke all given privileges ? revoke all privileges on *.* from 'user'@'host'; 5. How to take backup of database ? mysqldump --user <username> --password=<password> databasename > databasebackup.sql 6. How to take backup of two databases ? mysqldump --user <username> --password=<password> databasename1 databasename2 > databasebackup.sql 7. How to take backup of all databases in MySQL ? mysqldump --user <username> --password=<password> -all-databases   >

Reset root password in CentOS 6

In CentOS base version , I mean v6 there is a bug and you cant reset the password in the usual way. I am going to mention both the ways. To reset root password of CentOS machine, Start your PC. You will get GRUB screen and there choose " e" to edit booting kernel. After that It will open in a new window with current configuration. If you observe there you can find a line with two last words like  " rhgb quiet \" Dont worry about "\" , use backspace and remove " rghb quiet". Then add in that line as " a 1 " and then press F10 key to boot. it will successfully boot into /bin/sh and there by using passwd command you can reset the root  password of the server. If its not working . 1 . SELinux may be causing the problem , to take care of it you have to restart Machine and again edit GRUB , but this time we have to one more parameter extra. Now add parameters like " a selinux=0 1 " , So CentOS will boot into /bin/sh with permissive

CentOS 7 not detecting Windows

Install ntfs-3g package and you should be able to mount your Windows OS installed partition then after mounting it run command as grub2-mkconfig -o /boot/grub2/grub.cfg There you will see Windows getting detected in updated grub configuration. Hope it helps.

CentOS 7 Repositories

EPEL for CentOS 7 ## RHEL/CentOS 7 64-Bit ## # wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm # rpm -ivh epel-release-7-0.2.noarch.rpm RPMForge for CentOS 7 sudo rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt sudo yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm Remi for CentOS 7 sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm sudo sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/remi.repo Note: Didnt get full information about RPM Fusion , if anybody get it let me know.

Explanation of /etc/fstab

Image
What is fstab file? fstab is a configuration file that contains information of all the partitions and storage devices in your computer. The file is located under  /etc , so the full path to this file is /etc/fstab. /etc/fstab contains information of where your partitions and storage devices should be mounted and how. If you can't access your Windows partition from Linux, aren't able to mount your CD or write to your floppy as a normal user, or have problems with your CD-RW, you probably have a misconfigured /etc/fstab file. So, you can usually fix your mounting problems by editing your fstab file. /etc/fstab is just a plain text file, so you can open and edit it with any text editor you're familiar with. However, note that you must have the root privileges before editing fstab. So, in order to edit the file, you must either log in as root or use the su command to become root. Sample fstab file looks like this Note that this system has two IDE partitions, one which is used a