Installing GeoIP On WAMP - wamp

I found about this PHP Extension before few days. Can anyone explain me how to install GeoIP on WAMP?

I got solution myself.
Here the steps:
First download geoip dll file respectively my phpversion from
http://pecl.php.net/package/geoip.In my case my php vesion is 5.5.So download the geoip files from http://pecl.php.net/get/geoip-1.0.8.tgz
Copy php_geoip.dll and php_geoip.pdb file paste it to
wamp\bin\php\php[PHP_Version]\
add the line extension=php_geoip.dll in php.ini file for enable php geoip extension on wampserver
then restart your wamp
check php info.

geoip extetion type is PECL extetion that for installing it in windows not the same other pear extention ( just copy theme in ext directory and in php.ini add extension = geoip.dll ).
geoip.dll in php 5.3 not avaible and and if you want use it i suggest you read this doc carfeully thislink and use "Using mod_geoip" with PHP method.'
be win ;)

Usually you do two things:
Place the extension / file into PHP's \ext folder.
extension=geoip.dll
Edit PHP's php.ini file to load the extension and set up any of it's settings. *Though I don't think there are any php.ini settings for this extension.

To PHP 7.2.0 and forward:
Use this file to add an extension: phpForApache.ini
Add:
extension=geoip

Related

Opencart extension not creating files

I have a custom Opencart shipping extension. It has upload/ and install.xml. When I upload extension.ocmod.zip through extension installer, it completes installation. But the extension is not visible under Extensions > Shipping.
I checked the code and none of the files from the extension is present under upload/admin/controller/extension/shipping.
I have refreshed modifications and cache from the dashboard.
Make sure that your file extension.ocmod.zip contains:
the upload folder and install.xml file directly
and there is not another subdirectory contains them
Without knowing the OC version you're using, my guess is that your path structure should be:
install.xml
upload/admin/view/extension/shipping/*
upload/admin/model/extension/shipping/*
upload/admin/controller/extension/shipping/*
upload/admin/language/en-gb/extension/shipping/*
upload/catalog/view/theme/default/extension/shipping/*
upload/catalog/model/extension/shipping/*
upload/catalog/controller/extension/shipping/*
upload/catalog/language/en-gb/extension/shipping/*

Using custom fonts on shinyapps.io

I would like to use a custom font in my shiny app (on plots) on shinyapps.io. I have my Roboto-Regular.ttf in the ./www/ directory. And this is the upper portion of my app.R file:
dir.create('~/.fonts')
system("chmod +x ./www/Roboto-Regular.ttf")
system("cp ./www/Roboto-Regular.ttf ~/.fonts/")
system('fc-cache -f -v ~/.fonts/')
system('fc-match Roboto')
library(ggplot2)
library(shiny)
library(shinythemes)
library(extrafont)
font_import(pattern="Roboto",prompt=FALSE)
loadfonts()
print(fonts())
Upon deploying the app, I end up with an error that looks like this:
Registering fonts with R
Scanning ttf files in /usr/share/fonts/, ~/.fonts/ ...
Extracting .afm files from .ttf files...
/home/shiny/.fonts/Roboto-Regular.ttfWarning in gzfile(dest, "w") :
cannot open compressed file '/opt/R/3.5.1/lib/R/library/extrafontdb/metrics/Roboto-Regular.afm.gz', probable reason 'Permission denied'
Error in value[[3L]](cond) : cannot open the connection
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
Does anyone see what might be wrong?
After a bit of struggle I found an even simpler solution that works on shinyapps.io:
Here we go:
Place custom font in www directory: e.g. IndieFlower.ttf from here
Follow the steps from here
This leads to the following upper part of the app.R file:
dir.create('~/.fonts')
file.copy("www/IndieFlower.ttf", "~/.fonts")
system('fc-cache -f ~/.fonts')
Since Linux looks into the .fonts directory to search fonts, you don't need the extrafont package, but you can directly use those fonts like:
ggplot(mapping=aes(x=seq(1,10,.1), y=seq(1,10,.1))) +
geom_line(position="jitter", color="red", size=2) + theme_bw() +
theme(text=element_text(size = 16, family = "IndieFlower"))
This is the answer I received from RStudio regarding this. I haven't tested this out myself.
Hi,
Our developer was able to advise this is due to a possibly unfortunate design choice made when they created extrafont and the associated extrafontdb package. The extrafont font database is stored in the extrafontdb package directory -- that's essentially all that the extrafontdb package is used for.
This means that the extrafontdb directory needs to be user-writable. If the user installs the package, this will work fine, but if root installs the package (as is the case on shinyapps.io), then it won't work.
One potential workaround is to install the extrafontdb package to library that is in subdirectory of the app.
To do it: create an r-lib/ subdir, and download the extrafontdb source package there:
dir.create('r-lib')
download.file('https://cran.r-project.org/src/contrib/extrafontdb_1.0.tar.gz','r-lib/extrafontdb_1.0.tar.gz')
When deployed, the app will include this r-lib/ subdirectory and the extrafontdb source package.
Then, at the top of the app, install the extrafontdb package from the source package, into the r-lib directory.
.libPaths(c('r-lib', .libPaths()))
install.packages('r-lib/extrafontdb_1.0.tar.gz',type = 'source',repos = NULL)
They deployed an app on shinyapps.io that does the extrafontdb installation, and it works fine. The libpath is set so so that install.packages() will install from the provided source package to the r-lib/ subdirectory of the app.
Please let us know if you're able to implement the above or have any additional questions.
Thanks,
Adding an alternative answer to symbolrush's answer which I found did not work. Here was the code I used initially:
# Add fonts to shiny linux server
if (Sys.info()[['sysname']] == 'Linux') {
dir.create('~/.fonts')
fonts = c(
"www/IBMPlexSans-Regular.ttf",
"www/IBMPlexSans-Bold.ttf",
"www/IBMPlexSans-Medium.ttf"
)
file.copy(fonts, "~/.fonts")
system('fc-cache -f ~/.fonts')
}
# Load fonts and set theme
font_paths("fonts")
font_add("IBMPlexSans", regular = "IBMPlexSans-Regular.ttf")
font_add("IBMPlexSans-Bold", regular = "IBMPlexSans-Bold.ttf")
font_add("IBMPlexSans-Medium", regular = "IBMPlexSans-Medium.ttf")
showtext_auto()
The bizarre thing is that the first instance of the app on shinyapps.io worked, including the custom fonts. However when the app went to sleep and was opened a second time, I get this error in the log:
Error in value[[3L]](cond) : font file not found for 'regular' type
I was never able to debug why this was the case, but I tried a simpler solution that has worked perfectly so far. I moved my fonts to a /font folder in the app folder (I don't think using the /www folder is necessary) and added the /font folder using path_folder():
library(showtext)
# Load fonts and set theme
font_paths("fonts")
font_add("IBMPlexSans", regular = "IBMPlexSans-Regular.ttf")
font_add("IBMPlexSans-Bold", regular = "IBMPlexSans-Bold.ttf")
font_add("IBMPlexSans-Medium", regular = "IBMPlexSans-Medium.ttf")
showtext_auto()
I hope this helps anyone who is having problems with their app not running after the first instance, as I could not find the same situation anywhere on stackoverflow.

Install third-party Markdown extension in Pelican

I'm using Pelican for a static blog, and attempting to install the figure-ref extension. Since I'm using Markdown, the plugin relies on the figureAltCaption third-party Markdown extension. However I have no idea how to install it.
Pelican has an MD_EXTENSIONS configuration option, but I've tried a few obvious options with no luck. It seems like this is a dead-simple gimme but it's not clear how to proceed. Would love some suggestions.
Unfortunately, the author of figureAltCaption appears to have not provided an install script. My suggestion would be to create one and contribute it as a pull request. This tutorial about creating Extensions for Python-Markdown covers creating an install script as well.
However, as a shortcut, you should be able to just copy the figureAltCaption.py file to the appropriate directory. Usually you want the site-packages directory. As this answer shows, just do the following from Python:
>>> import site; site.getsitepackages()
Then copy the figureAltCaption.py file to the first directory returned.
Now that the extension is on your PYTHONPATH, it should be importable. From the Python prompt, try:
import figureAltCaption
If you get no errors, then it worked and you just need to tell Pelican about it.
MD_EXTENSIONS = ['figureAltCaption']

GeoIPCity.dat file where do I find it?

I have a file GeoIPCity.day on one of my sites. The original developer told me it was a free file from maxmind.com and I should update it every month. I have looked on maxmind.com and haven't been able to find a file with the exact same name. Any idea what file I should used as the update? Here are the list of files I was able to find on the website: http://dev.maxmind.com/geoip/legacy/geolite/#Downloads
The Legacy "dat" format DBs are discontinued:
https://support.maxmind.com/geolite-legacy-discontinuation-notice/
Free version of the GEO IP City was rename from GeoIPCity.dat TO GeoLiteCity.dat.
Download the data. This should work on CentOS 7/7.1
wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz -O /usr/share/GeoIP/GeoLiteCity.dat.gz && gunzip --force /usr/share/GeoIP/GeoLiteCity.dat.gz
this maintenance a backward compatible version
ln -s /usr/share/GeoIP/GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat
The old files can be download from the following: https://mirrors-cdn.liferay.com/geolite.maxmind.com/download/geoip/database/
A copy of the file "GeoLiteCity.dat" is also available from github at the following url:
https://github.com/mbcc2006/GeoLiteCity-data
Click on Code button then download

Postgresql with Postgis Geodjango Installation

I'm trying to get Geodjango set up with Postgis but cannot enable the Postgis extension in the database. I am following the settings that are found on the Geodjango Documentation, but when I hit this step:
mydb=# CREATE EXTENSION postgis;
I get the following error:
ERROR: could not open extension control file "/usr/local/Cellar/postgresql/9.3.1/share/postgresql/extension/postgis.control": No such file or directory
Is this a problem with my paths? If so, how do I fix it? I found that my postgresql is located here:
admins-macbook:postgis-2.1.0 Admin$ find . -iname postgresql
./java/jdbc/src/org/postgresql
./java/jdbc/stubs/org/postgresql
Thanks for any ideas that will help!
First I'd check if the files exists at all on your system with: find /usr -name postgis.control
Chances are it doesn't exist...
I believe this is a problem with the way 9.3.1 is packaged.
Look in /usr/pgsql-9.3/share/contrib/postgis-2.1 (change this path according to your postgis version)
If you see files in here like postgis.sql and spatial_ref_sys.sql then you can manually create a spatial database template using the instructions here: https://docs.djangoproject.com/en/dev/ref/contrib/gis/install/postgis/#creating-a-spatial-database-template-for-earlier-versions
You will just have to change POSTGIS_SQL_PATH to point to the .sql files mentioned above.