1. Update WordPress automatically from linux command line

    by admin

    In order to upgrade your version of wordpress via linux command line perform the following steps.

    curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
    mv wp-cli.phar wp-cli
    chmod u+x wp-cli
    /root/wp-cli --allow-root core update --path=/path-to-wordpress-install

    This will perform an update as a root user.  Typically you may not want to use a root user so you can run as any user desired.  You can also add this to crontab to happen on a regular basis




  2. Error: ruby(selinux) is needed by puppet

    by admin

    While installing the puppet rpm’s we ran into an error. Note, we downloaded some prerequisite rpm’s first then attempted to install them.


    [root@centos01 software]# ls -1
    facter-2.4.1-1.el7.x86_64.rpm
    hiera-1.3.4-1.el7.noarch.rpm
    puppet-3.7.4-1.el7.noarch.rpm
    puppet-server-3.7.4-1.el7.noarch.rpm
    ruby-augeas-0.4.1-3.el7.x86_64.rpm
    ruby-shadow-2.2.0-2.el7.x86_64.rpm


    [root@centos01 software]# rpm -ivh *.rpm
    warning: facter-2.4.1-1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 4bd6ec30: NOKEY
    error: Failed dependencies:
    ruby(selinux) is needed by puppet-3.7.4-1.el7.noarch

     

    It would seem that selinux is causing some issue here. In this case we are missing a dependency. You will need to install the selinux ruby library. It can be done as follows


    [root@centos01 software]# yum install libselinux-ruby
    Loaded plugins: fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
    * base: mirror.pac-12.org
    * extras: repos.redrockhost.com
    * updates: repos.redrockhost.com
    Resolving Dependencies
    --> Running transaction check
    ---> Package libselinux-ruby.x86_64 0:2.2.2-6.el7 will be installed
    --> Finished Dependency Resolution

    Dependencies Resolved

    ==================================================================================================================================================
    Package Arch Version Repository Size
    ==================================================================================================================================================
    Installing:
    libselinux-ruby x86_64 2.2.2-6.el7 base 127 k

    Transaction Summary
    ==================================================================================================================================================
    Install 1 Package

     

    Now that the library is installed we can now perform the installation of the puppet rpm’s


    Preparing... ################################# [100%]
    Updating / installing...
    1:ruby-shadow-1:2.2.0-2.el7 ################################# [ 17%]
    2:ruby-augeas-0.4.1-3.el7 ################################# [ 33%]
    3:hiera-1.3.4-1.el7 ################################# [ 50%]
    4:facter-1:2.4.1-1.el7 ################################# [ 67%]
    5:puppet-3.7.4-1.el7 ################################# [ 83%]
    6:puppet-server-3.7.4-1.el7 ################################# [100%]

     




  3. Change hostname in centos and redhat 7

    by admin

    Changing the hostname in redhat and centos 7 has changed since versions 5 and 6. To do it now you will have to use the “nmtui” command, which is a text user interface for modifying network parameters.


    [root@centos01 ~]# nmtui

    Select “Set system hostname” and you will be prompted with a screen to set it.

    Now you can verify in /etc/sysconfig/network to make sure it is set correctly

    [root@centos01 ~]# cat /etc/sysconfig/network
    # Created by anaconda
    hostname=centos1

    Try not to modify the file directly, use the nmtui command as a best practice.




  4. `require’: cannot load such file — openssl (LoadError)

    by Computer

    When your ruby and rails tools are installed, you will need to create a rails project. To do this use the rails command

    rails new /var/www/rails-project
    

    The following error was noticed when trying to create a rails project

    
    /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- openssl (LoadError)
    

    The problem is that the openssl-devel package was missing from our system. Often times linux systems contain the openssl package, however, this does not contain the correct header files that are necessary.

    [showads ad=midpost]

    The openssl-devel package luckily has everything needs, and is generally a good thing to install. This package can easily be installed using

    yum install openssl-devel
    

    The issue now is that ruby requires that this package be present during installation. Meaning we will need to re-install ruby and ruby gems. Perform the installation process again

    For the ruby installation

    ./configure --prefix=/usr/local
    make
    make install
    

    And to install ruby gems, change directory to the ruby gems package and

    ruby setup.rb
    

    Now we can execute the rails new command once again. After successful installation of the project, you should see

    Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
    

    Now you can begin your ruby and rails development. See you project install directory for more details.




  5. PackageKit ERROR:dbus.proxies:Introspect error

    by Computer

    This error message appears when PackageKit is malfunctioning. It continually shows up in your yum package manager output

    ERROR:dbus.proxies:Introspect error on :1.167:/org/freedesktop/PackageKit: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 1 matched rules; type="method_call", sender=":1.935" (uid=0 pid=18850 comm="/usr/bin/python) interface="org.freedesktop.DBus.Introspectable" member="Introspect" error name="(unset)" requested_reply=0 destination=":1.167" (uid=0 pid=11720 comm="/usr/sbin/packagekitd))
    Unable to send message to PackageKit
    

    Not very nice. It also causes a hang for a while. It also appears there is some kind of communication error between the PackageKit and freedesktop.

    First let’s verify we have this package installed on our system:

    [root@computer www]# rpm -qa | grep Package
    PackageKit-glib-0.5.8-13.el6.i686
    PackageKit-yum-plugin-0.5.8-13.el6.i686
    PackageKit-yum-0.5.8-13.el6.i686
    PackageKit-0.5.8-13.el6.i686
    PackageKit-glib-devel-0.5.8-13.el6.i686
    PackageKit-gtk-module-0.5.8-13.el6.i686
    PackageKit-device-rebind-0.5.8-13.el6.i686
    

    Looking at yum, we can see this set of packages have minimal dependencies, so we should be fine to remove it if not needed.

    [root@computer www]# yum remove PackageKit*
    Loaded plugins: fastestmirror, refresh-packagekit
    Setting up Remove Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package PackageKit.i686 0:0.5.8-19.el6.centos set to be erased
    --> Processing Dependency: PackageKit >= 0.5.0 for package: gnome-packagekit-2.28.3-3.el6.i686
    ---> Package PackageKit-device-rebind.i686 0:0.5.8-19.el6.centos set to be erased
    ---> Package PackageKit-glib.i686 0:0.5.8-19.el6.centos set to be erased
    ---> Package PackageKit-glib-devel.i686 0:0.5.8-19.el6.centos set to be erased
    ---> Package PackageKit-gtk-module.i686 0:0.5.8-19.el6.centos set to be erased
    ---> Package PackageKit-yum.i686 0:0.5.8-19.el6.centos set to be erased
    ---> Package PackageKit-yum-plugin.i686 0:0.5.8-19.el6.centos set to be erased
    --> Running transaction check
    ---> Package gnome-packagekit.i686 0:2.28.3-3.el6 set to be erased
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    =================================================================================================
     Package                          Arch         Version                       Repository     Size
    =================================================================================================
    Removing:
     PackageKit                       i686         0.5.8-19.el6.centos           @base         2.2 M
     PackageKit-device-rebind         i686         0.5.8-19.el6.centos           @base         229 k
     PackageKit-glib                  i686         0.5.8-19.el6.centos           @base         715 k
     PackageKit-glib-devel            i686         0.5.8-19.el6.centos           @base         441 k
     PackageKit-gtk-module            i686         0.5.8-19.el6.centos           @base         229 k
     PackageKit-yum                   i686         0.5.8-19.el6.centos           @base         493 k
     PackageKit-yum-plugin            i686         0.5.8-19.el6.centos           @base         222 k
    Removing for dependencies:
     gnome-packagekit                 i686         2.28.3-3.el6                  @base         7.8 M
    
    Transaction Summary
    =================================================================================================
    Remove        8 Package(s)
    Reinstall     0 Package(s)
    Downgrade     0 Package(s)
    

    Now from this point on you shouldn’t see any of the introspect error messages in your yum command. If you wish you can re-install the PackageKit set of tools again. This may resolve the issue since it is likely the error originated from some corruption during the original installation of PackageKit.




  6. Ruby on Rails Quick Start

    by Computer

    Installing ruby on rails requires a few steps, the first of which is installing the ruby framework. Ruby is a programming language that can be downloaded and installed from the ruby website. We recommend compiling from source, since it will tailor the installation to your system’s specifications. Or, you can install the copy from your local machine’s package manager. Below is an example of a seource install

    wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
    tar –xzvf ruby-1.9.3-p0.tar.gz
    cd ruby-1.9.3-p0
    ./configure --prefix=/usr/local
    make
    make install
    

    Next you will need to install the rubygems application. Ruby gems is the package manager for the ruby platform, and can be easily used to install various ruby packages. This would be similar to the perl CPAN, but ruby’s implementation of it. After you download and unzip rubygems install it in the following manner

    ruby setup.rb
    

    Now you should be able to invoke the “gem” command. If you installed your ruby into /usr/local, then it should already be in your path

    [root@computer rubygems-1.8.17]# which gem
    /usr/local/bin/gem
    

    Next we will need to install the rails framework, hence ruby on rails. Rails is easily installed via the gem package manage we installed previously. Install rails as follows

    gem install rails
    

    All gems needed for the rails framework will be installed accordingly.

    ...
    Successfully installed mail-2.4.1
    Successfully installed actionmailer-3.2.1
    Successfully installed thor-0.14.6
    Successfully installed rack-ssl-1.3.2
    Successfully installed railties-3.2.1
    Successfully installed bundler-1.0.22
    Successfully installed rails-3.2.1
    28 gems installed
    

    Now we can create our first rails project using the “rails new” command as follows

    rails new /var/www/rails-test
          create
          create  README.rdoc
          create  Rakefile
          create  config.ru
          create  .gitignore
          create  Gemfile
          create  app
          create  app/assets/images/rails.png
          create  app/assets/javascripts/application.js
          create  app/assets/stylesheets/application.css
          create  app/controllers/application_controller.rb
          create  app/helpers/application_helper.rb
          create  app/mailers
    ...
    

    Any dependencies that are needed for the project will be installed at this time. And from here on out, your rails project can be developed upon.

    At this point you are ready to start your project. Enjoy the ruby on rails fun.




  7. Upgrade Ubuntu 10 to Ubuntu 11

    by Computer

    The Ubuntu operating system makes fantastic use of the latest features and abilities. One of the ways it is able to establish this is through effective package management. Including providing a robust repository of various packages, and implementing an easy to way to integrate them into your system. One of these features includes seamless upgrades to the operating system.

    If you are running Ubuntu 10 and you want to upgrade to Ubuntu 11 without re-installing then you can use the following command:

    do-release-upgrade -d
    

    This will upgrade your distribution accordingly. Be sure to reboot the operating system after the upgrade for it to load the updated kernel.

    Ubuntu has great package manager and upgrading options that make it easy to perform tasks such as this. Keeping up to date with the latest packages and upgrades is recommended, since it helps to address numerous bugs and security concerns. If you would like to install other Ubuntu packages, but not upgrade the entire system, the “apt-get” tool can be used. Bellow is an example as to how to install a particular package using page get:

    apt-get install <package>
    

    Through the use of do-release-upgrade and apt-get, one can easily add/remove/upgrade packages.




  8. Amazon Mapreduce Overview

    by Computer

    Amazon provides mapreduce computation on their resources, which is a great option for many different types of computation. To get started you will need an amazon account. From a top menu bar you can select mapreduce. There will be a few steps to perform before you start:

    1. Define a Job Flow – Specify whether you want to run your application including a Hive Program, Custom JAR, Streaming, or Pig Program. Sample applications are also available for use.
    2. Specify Parameters – Next you will be prompted for input parameters such as Input Location, Output Location, A Mapper, A Reducer, and extra arguments. One can even read/write directly to Amazon S3, which is great for not being limited in space.
    3. Configure EC2 Instances – Now configure your EC2 Instances, which will perform the computation. You can select an instance type and number of instances you wish to compute on.
    4. Specify Advanced Options – Configure any advanced options such as ec2 keypairs, vpc subnet, s3 log path, debugging and keepalive parameters.
    5. Bootstrap Actions – you can choose to use or not use bootstrap actions. If you choose to use it action types will be prompted and can be configured accordingly.

    Amazon provides great flexibility and cost savings when performing advanced computation using mapreduce.




  9. 10periodic not found in Ubuntu

    by Computer

    You may notice the 10periodic file is not available in the /etc/rc3.d directory. If it does not exist you will need to install the package that uses it.

    apt-get install unattended-upgrades update-notifier-common
    



  10. What package contains org.debian.apt.policy

    by Computer

    To get the org.debian.apt.policy you will need file you will need to install the following package

    apt-get install aptdaemon
    

    You will then be able to find the target file under the /usr directory tree. Use the “find” command to find the exact location.