Category: Linux

  • Update DynDNS from the command line

    My router is not updating DynDNS correctly, so I wanted to use a simple cron job to do the same. Here is a simple BASH/Shell script to update DynDNS: IP=$(curl -s icanhazip.com) curl -v -k -u username:password “https://members.dyndns.org/nic/update?hostname=DNSHOSTNAME.dyndns.org&myip=$IP”

  • How to setup a remote syslog server in CentOS 6

    I wanted to have a cisco device send it’s logs to a Centos box for troubleshooting. I just wanted to do a “tail -f” against the error logs. Seems that syslog is now rsyslog in Centos 6. To setup rsyslog to accept syslog logs from other devices, you need to: 1. uncomment out the following…

  • CentOS 6 in a VM – Console resolution

    I can NEVER remember this, and every time I re-install CentOS in a VM I have to go searching. If you want the console size to be larger in a vm add vga=791 (for 1024×768) to the end of the kernel line in /etc/grub.conf. The VESA values (for linux) are here

  • How to add Gnome to a CentOS 6 minimal install

    I have been using the minimal iso (CentOS-6.0-x86_64-minimal.iso) to install CentOS 6. I wanted to add a GUI to my vm, but I could not find easy documentation showing how to add a GUI, or Gnome in this case, to a CentOS 6 minimal install. I was not looking for the smallest X windows install,…

  • Quick bash script to change .htpasswd passwords across a server

    I wanted to change passwords for a users that is in all of our htpasswds. Here is a quick bash find script to do that: for PATH in $(find / -name .htpasswd); do htpasswd -b $PATH username NewPassword; done

  • BASH script to email if WordPress plugins or themes need updating

    This one took me all day. But I got it. I wanted to have a script that could look through all WordPress sites and find if there are outdated themes or plugins. All I need to do is slap it into a cron job and I am good to go! Here is the BASH code…

  • How the cloud failed me.

    We host our Linux boxes on Rackspace’s Cloud Server platform. We pay extra per month to use their Redhat Linux images. In return we receive all our patches and updates through Rackspace’s RHN Satellite server. Our thinking was that, we could purchase a Redhat support contract, and  since we were running Redhat we would have OS/Application support if needed. We…

  • How to remove a machine from a RHN Satellite

    I wanted to move a VM from a RHN Satellite back to the default Red Hat Network. I found these two files contained all the info: /etc/sysconfig/rhn/up2date /etc/sysconfig/rhn/systemid I just moved them aside and ran rhn_register to re-register the system. Then I ran “yum clean all” to make yum happy

  • Rebuild your the default CentOS yum.repo.d folder

    On a dev machine, somehow, I managed to erase my yum.repo.d contents. I wanted to rebuild the repo files back to their default. First you need to figure out what version you are using: cat /etc/redhat-release Then visit the correct release at : http://vault.centos.org/ navigate to the correct os/x86_64/CentOS/ directory (could be os/x86_64/CentOS/ i386/) Download the following files to…

  • php53 included in CentOS 5.6

    I wish I read release notes, it would make my life easier. In my previous post, I was worried about CentOS 5.x not having a new enough version of PHP to run the soon to be release WordPress 3.2. Well, RedHat’s 5.6 release notes clearly say: Version 5.3.3 of PHP is now available in Red…