geoip

Using Pygeoip on Appengine - no module named mmap

心不动则不痛 提交于 2019-12-13 02:27:51
问题 I'm trying to do some IP-lookup on Python Google Appengine like this: import pygeoip gi = pygeoip.GeoIP('GeoIP.dat') Location = gi.country_code_by_addr(self.request.remote_addr) (pygeoip can be found here: http://code.google.com/p/pygeoip/) The above code executes fine locally but when I push it to the live server I get the following error: <type 'exceptions.ImportError'>: No module named mmap Traceback (most recent call last): File "/base/data/home/apps/tomcritchlow1/geoip.347423765058502279

How to inject $_SERVER variable into a Service

强颜欢笑 提交于 2019-12-12 20:01:11
问题 a service of my application needs to access a $_SERVER variable (which is provided by apache) called: $_SERVER['GEOIP_COUNTRY_CODE']; What are good ways to achieve this? My current guess would be to inject the RequestStack but on the other hand I dont want to couple the complete RequestStack to this service. Are there other ways of achieving this? P.S. Please don't answer me with links to bundles like https://github.com/aferrandini/Maxmind-GeoIp etc. 回答1: You have to tell your service to

Redirecting viewers to other site based on country geoip

梦想的初衷 提交于 2019-12-12 19:26:28
问题 let's say I have a website (www.abc.com/featured/abc) and wanted to redirecting (only that link) the viewer from other country except Malaysia to youtube video.. But www.abc.com is still worldwide. And yes, my server is already compiling with geoip module. here is what i did in etc/nginx/sites-available/abc.com location featured/abc/ { if ($geoip_country_code != "MY") { rewrite ^ https://www.youtube.com/watch?v=MaMuQPmzrrU; } } but it still not working. Do I did somewhere wrong in the code

NginX GeoIP Module Config - load_module not allowed on First Line of Conf

天大地大妈咪最大 提交于 2019-12-12 18:22:40
问题 My nginx conf looks like this: include /usr/share/nginx/modules/mod-http-geoip.conf; server { } server { } I had installed mod-http-geoip via sudo yum install nginx-mod-http-geoip and i have these: /usr/share/nginx/modules/mod-http-geoip.conf: load_module "/usr/lib64/nginx/modules/ngx_http_geoip_module.so"; /usr/lib64/nginx/modules/ngx_http_geoip_module.so The error I get: 2018/07/09 09:37:14 [emerg] 9552#0: "load_module" directive is not allowed here in /usr/share/nginx/modules/mod-http

php country dropdown by maxmind geoip

久未见 提交于 2019-12-12 02:58:09
问题 I would like to create a country drop down which can pre-select user country based on his/her Ip address. e.g., if user is in Italy, it must show Italy first while keeping all other countries in the list. I searched a lot and I started by downloadin Maxmind GeoIP API and database. This is what I tried and it only shows a normal dropdown list without pre-select the country by ip: <select name="" multiple="multiple" width="200px" size="10px"> <?php require 'vendor/autoload.php'; //I put this is

ELK - Kibana doesn't recognize geo_point field

南笙酒味 提交于 2019-12-11 11:34:13
问题 I'm trying to create a Tile map on Kibana, with GEO location points. For some reason, When I'm trying to create the map, I get the following message on Kibana: No Compatible Fields: The "logs" index pattern does not contain any of the following field types: geo_point My settings: Logstash (version 2.3.1): filter { grok { match => { "message" => "MY PATTERN" } } geoip { source => "ip" target => "geoip" add_field => [ "location", "%{[geoip][latitude]}, %{[geoip][longitude]}" ] #added this extra

parsing ip address in php

半城伤御伤魂 提交于 2019-12-11 05:20:43
问题 I am trying to create a page that shows the user their zip code when they are on my page. (if any of you are familiar with GeoIP data, thats what I am using. ) I have a conversion that converts the users IP address into an IP number, that conversion is: ipnum = 16777216*w + 65536*x + 256*y + z where w.x.y.z are the ip sections (000.000.000.000) My question is, using $_SERVER['REMOTE_ADDR']; is there a way for me to section the users ip address and assign the section of the ip address to

How accurate is GeoIP and $_SERVER['REMOTE_ADDR']?

时光毁灭记忆、已成空白 提交于 2019-12-10 14:57:21
问题 I make a website for my girlfriend and she recently wants to know who is accessing her site. So I use the database of MindMax and I got the list and count of access by country. However, after monitoring it for a few days, it is comes to our surprise that there are accesses from some countries which the website is not target to. Of course, it does not means that I think it is impossible for people from those countries will be interested but it just rises a question of accuracy. So How accurate

Rails 4 - How would I automatically detect a user's location and display it on the web app?

你。 提交于 2019-12-10 11:23:18
问题 I currently have a working app and I would like to have Rails detect a visitor's location by the IP address and display the city and state on the homepage of my website. For example, it would display "Hello {Name} from City, State". Visitors do not have to enter anything. I'm aware of things like GeoIP and Geocode. As far as I know about them, they are used to search for locations from IP or vice versa but they require manually inputting the info. I need it to do it automatically as soon as

Logstash

谁都会走 提交于 2019-12-10 09:48:36
Logstash介绍 Logstash是一个开源数据收集引擎,具有实时管道功能。Logstash可以动态地将来自不同数据源的数据统一起来,并将数据标准化到你所选择的目的地。 集中、转换和存储你的数据 Logstash是一个开源的服务器端数据处理管道,可以同时从多个数据源获取数据,并对其进行转换,然后将其发送到你最喜欢的“存储”。(当然,我们最喜欢的是Elasticsearch) 输入: 采集各种样式、大小和来源的数据 数据往往以各种各样的形式,或分散或集中地存在于很多系统中。Logstash 支持各种输入选择 ,可以在同一时间从众多常用来源捕捉事件。能够以连续的流式传输方式,轻松地从您的日志、指标、Web 应用、数据存储以及各种 AWS 服务采集数据。 过滤器:实时解析和转换数据 数据从源传输到存储库的过程中,Logstash 过滤器能够解析各个事件,识别已命名的字段以构建结构,并将它们转换成通用格式,以便更轻松、更快速地分析和实现商业价值。 Logstash 能够动态地转换和解析数据,不受格式或复杂度的影响: 利用 Grok 从非结构化数据中派生出结构 从 IP 地址破译出地理坐标 将 PII 数据匿名化,完全排除敏感字段 整体处理不受数据源、格式或架构的影响 输出:选择你的存储,导出你的数据 尽管 Elasticsearch 是我们的首选输出方向