Giter Site home page Giter Site logo

mmdb-getting-started's Introduction

Installation

Vagrant

If you use Vagrant, you can get started easily. After cloning this repository, chdir to the top directory. Then issue the following commands:

vagrant up

Now you (hopefully) have a running VM with everything you need already installed. You can now log in to your VM and start running commands.

vagrant ssh
cd /vagrant
perl examples/01-getting-started.pl

If you've followed the instructions above, you are done. No need to read any further.

Manual Installation

libmaxminddb

First you'll need to install libmaxminddb

cpanminus

cpanm is probably the easiest Perl install tool to get up and running with. If you don't already have it, you can install it with a one-liner:

curl -L https://cpanmin.us | perl - App::cpanminus

We've chosen to install without sudo, so that we don't interfere with any modules which the system requires.

CPAN Modules

Now that we have a tool to install our Perl modules, let's go ahead and install the modules we need to write an MMDB file. I should add the caveat that we don't currently have Windows support for our writer, so you'll need access to a *nix or Mac OS X environment to play along. If you do have a Windows machine, an Ubuntu VM or something similar will be just fine.

cpanm Devel::Refcount MaxMind::DB::Reader::XS MaxMind::DB::Writer::Tree Net::Works::Network GeoIP2 Data::Printer

If you're on Mac OS X and the above install fails, you can try forcing a 64 bit architecture:

ARCHFLAGS="-arch x86_64" cpanm MaxMind::DB::Writer::Tree Net::Works::Network

Now you're ready to start running scripts:

perl /vagrant/examples/examples/01-getting-started.pl

GeoLite2-City

You'll need a copy of GeoLite2-City.mmdb somewhere on your filesystem. You may need to download this file either via geoipupdate or by downloading the file manually. If you need more details on how we set this up, you can look at the provision section of the Vagrantfile in the GitHub repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.