Friday, August 26, 2011

Viewing changed files on Linux

I thought that it would be useful to scan your system for changed files periodically. Instructions below explain how to generate a list of all your files along with the md5 information. If a file is changed, the md5sum will also be different. It would be more beneficial to have the system configured perfectly before doing this.

Create an index of the system:

Linux:
find / -type f | xargs md5sum > original-`date +%m%d%y`

OSX:
find / -type f | xargs md5 > original-`date +%m%d%y`


This will create a file called original along with the date in the filename. This may take awhile to complete. The next step is to generate a new list to see the changes. This should not be done immediately after the first step because the output files will probably be the same.

Repeat the steps above except change the output file from "original" to "changes"

View the changes:

diff original changes


To constantly view the the activity of changed files:

for((i=1;i<=16;i++)) do find ~/ -type f > new;diff original new; done

Saturday, July 30, 2011

Mephisto Backup v1.14 released for Linux

This program can do simple backups and syncs over a network or locally. Mephisto Backup was made with the Java programming language. The key feature of this program is the ability to backup your system to an image and copy it to a Linux Live DVD for future restoration. The user can then take that cd and move his or her system to any PC.

http://code.google.com/p/mephistobackup/

Wednesday, July 20, 2011

Compiling Linux 3.0

#!/bin/bash
kernel=linux-3.0.tar.bz2
patch=patch-3.0.bz2
download=http://www.kernel.org/pub/linux/kernel/v3.0/
wget $download/$kernel
wget $download/$patch
tar xvf $kernel
mv $patch.bz2 $kernel/
cd linux*
bunzip2 -d $patch.tar.bz2 | patch -p1
make clean
make menuconfig
make -j3 all
make -j3 modules_install
make install

Wednesday, May 11, 2011

Updating RedHat Linux and avoiding issues

Updating Redhat systems while using third-party repositories can result in dependency issues. I created this little script that will scan the installed packages and only update the packages installed from that specific repository. For example, I require VLC from RPMFORGE. With this script. the RPMFORGE version of VLC will be upgraded. Before using this script, you should have a system installed just the way you want with no dependency issues.


#!/bin/bash
yum --enablerepo=* makecache
yum list installed | grep -i atrpms | cut -c1-25 | xargs perl -e 'foreach (@ARGV) { s/.x86_64//; print "\n$_";}' | xargs yum --disablerepo=* --enablerepo=a* install

yum list installed | grep -i epel | cut -c1-25 | xargs perl -e 'foreach (@ARGV) { s/.x86_64//; print "\n$_";}' | xargs yum --disablerepo=* --enablerepo=e* install -y

yum list installed | grep -i rpmforge | cut -c1-25 | xargs perl -e 'foreach (@ARGV) { s/.x86_64//; s/.noarch//;print "\n$_";}' | xargs yum --disablerepo=* --enablerepo=rpm* install -y

yum update -y

Saturday, March 5, 2011

How to get RHEL 6 for free

I thought of a way to get RedHat Enterprise Linux for free. RHEL clones such as CentOS and Scientific Linux takes the sources from RedHat and rebuild them. I am going to install CentOS or Scientific Linux and then update via a SRPMS repository. This is also significant if you are a current non-RHEL user that wants the security updates faster than what your current non-RHEL distro provides. The biggest downside to this is that each package will have to be compiled.

SRPMS location:
Desktop ftp://ftp.redhat.com/redhat/linux/enterprise/6Workstation/en/os/SRPMS/
Server ftp://ftp.redhat.com/redhat/linux/enterprise/6Server/en/os/SRPMS/

Add the following REPO to /etc/yum.repos.d/ or yum.conf


[rhel-src-Desktop]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6Workstation/en/os/SRPMS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-src-Server]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-src-Client]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6Client/en/os/SRPMS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

A new perl script has been made to make this much easier. If you decide to use the automated script, ignore the instructions below.Click here to see the script.

Wednesday, February 16, 2011

Check your linux system for errors!

This is a little perl script that I wrote to check log files for hardware and other errors.

To download the latest version:

svn co http://mephistobackup.googlecode.com/svn/branches/error-checker

To Run:

cd error-checker
perl error.pl <--Running with no arguments will scan /var/log/messages, /var/log/mcelog, /var/log/dmesg
perl error.pl ~/messages <--will scan a file called messages in your home directory for errors.


To update to the latest version:

cd error-checker
svn update

If you like to scan files for more terms, modify the following part of the code:


#Array for the default items to search the files for
@search = ('ecc','mce','error'); <--add search terms there!