Disable IPv6 on Ubuntu

Ubuntu updates occasionally fail due to IPv6 update servers not being reachable. While I prefer to keep IPV6 activated, this approach will allow you to disable it for updates, simply reverse the steps to re-enable afterwards!

  1. Update the configuration file…

    sudo vi /etc/sysctl.conf

    ADD:

    # IPv6 disabled
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1

  2. Then, you must enable the change…

    sudo sysctl -p

  3. To verify…


    ifconfig

Upgrade Splunk server

Initially this seemed a bit problematic for me. Each time the browser client is started it (by default) checks for a new server release and prompts the user to upgrade. The installation automatically identifies the currently installed version and takes the necessary steps to migrate configuration.

Steps are similar to initial installation.

  1. Download the appropriate build for your server (i386 vs. amd64)
  2. transfer to the server via sftp or other secure means
  3. sudo /opt/splunk/bin/splunk stop
  4. sudo dpkg -i splunk*
  5. sudo /opt/splunk/bin/splunk start
  6. … accept terms… Y
  7. MIGRATE “y”
  8. http://HOSTNAME:8000
  9. sudo /opt/splunk/bin/splunk enable boot-start

Install New Relic Server Monitor on Ubuntu

I’ve found New Relic to be a great free addition to my suite of tools for server monitoring and alerting as I shifted to a DevOps support environment.

Installation is very fast an simple once you’ve created a free accound. Paid options are available and allow for more features.

You will need to record/save YOUR_LICENSE_KEY from your account for step 5 below.

  1. sudo sh -c 'echo deb http://apt.newrelic.com/debian/ newrelic non-free > /etc/apt/sources.list.d/newrelic.list'
  2. wget -O- https://download.newrelic.com/548C16BF.gpg | sudo apt-key add -
  3. sudo apt-get update
  4. sudo apt-get install newrelic-sysmond
  5. sudo nrsysmond-config --set license_key=YOUR_LICENSE_KEY
  6. sudo /etc/init.d/newrelic-sysmond start

You are done! Within a few minutes you should start seeing data on your consoles at the New Relic website.

REFERENCES:

Ubuntu grub timeout warning on update

Shortly updating to Ubuntu Trusty (14.04), I noticed the following warning on my console during updates. I finally got around to looking into it deeper and found that many users have seen this too.

Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.

If you edit the ‘grub’ file, you can comment out the GRUB_HIDDEN_TIMEOUT line by adding a hash in front of it.

sudo vi /etc/default/grub

Verify that the error is fixed by executing the following:

sudo update-grub

If you are interested, you can also go and look at the updated ‘grub’ file at

/boot/grub/grub.cfg

NOTE: I’d also seen that the following command could be used, but it was of no use in my testing.

/usr/share/grub/default/grub

REFERENCES:

Install Opera Browser on Ubuntu

I was recently attempting to port some older Selenium tests to a new Linux machine and found that I did not have the Opera browser installed. Thus, I submit the following.

There are several ways to go about doing this, depending upon your skills.

1. Most simple IMHO…

  • Add the path to the application file, then install, updates will come as they are released.
    sudo vi /etc/apt/sources.list
  • Add the following line to the file.
    deb http://deb.opera.com/opera/ stable non-free
  • Update the software registry:
    sudo apt-get update
  • Install:
    sudo apt-get install opera

2. Another method, with the same results:

  • sudo sh -c ‘echo “deb http://deb.opera.com/opera/ stable non-free” >> /etc/apt/sources.list.d/opera.list’
  • sudo sh -c ‘wget -O – http://deb.opera.com/archive.key | apt-key add -’
  • sudo apt-get update
  • sudo apt-get install opera

3. Additionally, you can simply download the files from the Opera website and uncompress wherever desired on your drive.

REFERENCES:

/////

Install SonarQube for Continous Inspection

Installation of Sonar requires but a few simple steps, though they can be rather obscure to many developers.

Connect to MySQL:

  1. CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
  2. grant all privileges on sonar.* to 'sonar@localhost' identified by 'sonar';
  3. flush privileges;

Easiest method, if you are on Ubuntu:

  1. sudo vi /etc/apt/sources.list
  2. Then add the following line:
    deb http://downloads.sourceforge.net/project/sonar-pkg/deb binary/
  3. sudo apt-get update
  4. sudo apt-get install sonar
  5. You will then have to stop/start as above to edit the configuration, generally to change database config:
    sudo vi /opt/sonar/conf/sonar.properties

Manual installation (and upgrade?) if you prefer to do things the hard way 🙂

  1. Download and unzip the release:
    wget http://dist.sonar.codehaus.org/sonar-3.6.1.zip
    unzip sonar-3.6.1.zip
    sudo mv sonar-3.6.1 /opt/sonar
    sudo rm -r /opt/sonar (to remove old link)
    sudo ln -s /opt/sonar-3.6.1/ /opt/sonar
  2. cd /opt/sonar/conf
  3. vi sonar.properties
    (uncomment lines for MySQL, comment out H2)
  4. sudo cp /opt/sonar/bin/linux-x86-64/sonar.sh /etc/init.d/sonar
  5. sudo vi /etc/init.d/sonar
    add the following 2 lines:
    SONAR_HOME=/opt/sonar
    PLATFORM=linux-x86-64

    change:
    WRAPPER_CMD="${SONAR_HOME}/bin/${PLATFORM}/wrapper"
    WRAPPER_CONF="${SONAR_HOME}/conf/wrapper.conf"
    PIDDIR="/var/run"

  6. sudo update-rc.d -f sonar remove
  7. sudo chmod 755 /etc/init.d/sonar
  8. sudo update-rc.d sonar defaults
  9. /etc/init.d/sonar start

REFERENCES:

Upgrades can be a little odd, if you see the maintenance page at http://localhost:9000/maintenance, go to http://localhost:9000/setup and do the required steps.

REFERENCES:

Automatically update Java on Ubuntu Linux

With the rate of updates and security patches for Java, administration of your Ubuntu machines can become tedious. There’s a better way… allow it to check for and update with your other software. The steps are easy…


sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

NOTE: You can also install java8 in the same manner with:
sudo apt-get install oracle-java8-installer

NOTE: The Java Control Panel can sometimes be hard to locate, it will be at the following:
/usr/lib/jvm/java-7-oracle/bin/ControlPanel

REFERENCES:

Prevent Firefox browser auto update

Often you find a neeed to keep an old copy of Firefox around for testing or to use a specific plugin (Example: Selenium). In these cases it can often prove problematic to allow the browser to auto-update. Here are some simple steps to prevent this behavior.

Enter “about:config” into the Firefox URL bar, then change the following values. You can click on them to toggle.

app.update.auto = false
app.update.enabled = false

Alternately, on Windows you can edit the config file at: %APPDATA%\Mozilla\Firefox\Profiles\.default\prefs.js

REFERENCES:

Linux kernel updates without reboot

Here’s another great reason to use Linux over Windows.    Ksplice Uptrack provides for runtime patching of the Linux kernel without rebooting of the machine.  This has great advantages where you need to maintain the security of a server but have limited opportunites to reboot due to SLA’s (Service Level Agreements).   Ubuntu Linux was the first supported operating system, other variants are now available too, though often for a fee.

Scan for Windows System updates

Most IT professionals are already aware that Microsoft routinely publishes updates to their operating systems on the second Tuesday of each month, early notification and download access is also available to select groups.

There are also several semi-automated tools that will scan your Windows computer on demand to list updates that are available to you.

I should mention that while the application from Secunia only scans Windows, their website discusses updates for most other popular operating systems and software

Have a happy and safe 2008!