Update maxmind geoip database for iplocation splunk command

If you are using outdated maxmind db in your splunk version, you will see some of the location is not right for a few IPs. Follow these steps to update the maxmind GeoLite2-City db file:

  1. You can go to this site, http://dev.maxmind.com/geoip/geoip2/geolite2/
  2. Download GeoLite2-City.mmdb
  3. Replace it with $SPLUNK_HOME/share/GeoLite2-City.mmdb, usually at /opt/splunk/share in any Linux host
  4. Don’t need to restart splunk, run new query in splunk and the db will be refreshed itself.
Update maxmind geoip database for iplocation splunk command

Task was canceled – ‘Default Repository’ of type com.atlassian.bamboo.plugins.vcs:task.vcs.checkout.

Error on atlassian bamboo when proceeding checkout task:

Task was canceled - 'Default Repository' of type com.atlassian.bamboo.plugins.vcs:task.vcs.checkout.

Solution:

Check if git does exist on bamboo agent

Upgrade bamboo remote agent atlassian-bamboo-agent-installer-x.x.x.x.jar to latest version

Task was canceled – ‘Default Repository’ of type com.atlassian.bamboo.plugins.vcs:task.vcs.checkout.

PHP Delete element from array with array_splice()

array_splice()

If you use array_splice() the keys will be automatically reindexed, but the associative keys won’t change opposed to array_values() which will convert all keys to numerical keys.

Also array_splice() needs the offset, not the key!, as second parameter.

Code

php

    $array = array(0 => "a", 1 => "b", 2 => "c");
    array_splice($array, 1, 1);
                       //↑ Offset which you want to delete

?>

Output

Array (
    [0] => a
    [1] => c
)

array_splice() same as unset() take the array by reference, this means you don’t want to assign the return values of those functions back to the array.

PHP Delete element from array with array_splice()

configure: error: mcrypt.h not found. Please reinstall libmcrypt

On Centos6/7, when compile PHP from source:

configure: error: mcrypt.h not found. Please reinstall libmcrypt

To fix this:

yum update epel-release
yum install -y libmcrypt-devel

or if it doesn’t work, use epel-release from Fedora:

rpm -ivh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install -y libmcrypt-devel

 

 

 

configure: error: mcrypt.h not found. Please reinstall libmcrypt