Automating WordPress wp-cron on debian

timeSome simple steps to automate the execution of wp-cron.php.

Advantages:

  • You can schedule it at convenient hours without affecting performance for users
  • wp-cron.php become more reliable for almost time-critical tasks (updates, autopost, etc)

Continue reading “Automating WordPress wp-cron on debian”

(Visited 538 times, 1 visits today)

Using wget to download from svn (subversion)

Well sometimes you could need to download software that it is available just for svn checkouts, without having or using any svn client.

For example I’m on a machine where I cannot install subversion but I have wget wich, at the end, it is just a normal http client just like a browser or subversion itself, without all the svn-related stuff (checkin, checkout, lock, etc.). Continue reading “Using wget to download from svn (subversion)”

Incoming search terms:

  • wget svn (23)
(Visited 5,019 times, 1 visits today)

How to download, install and change phpMyAdmin Themes within shell

Here we are, if you read this article about phpmyadmin, mysql, phpminiadmin and my suggestions about the importance to have a immediate visual perception on which server you are working on, well you probably want to change the phpMyAdmin theme on some of your machine or website, in order to distinguish them (it’s very comfortable when migrating data across two servers). Continue reading “How to download, install and change phpMyAdmin Themes within shell”

(Visited 5,598 times, 1 visits today)

Automating Moodle: basic cronjob solution

If you navigate your moodle administration side and click on “Notifications” you will probably see this statement:
The cron.php maintenance script has not been run for at least 24 hours.

just like this one:

Unless you have already setup an automated way to accomplish this, you want to Continue reading “Automating Moodle: basic cronjob solution”

(Visited 2,718 times, 1 visits today)

Debian, Apache2, PHP5 AND GEOIP Logging

geolocalization apache ipHelo there! In these last days one client of mine asked me how to prevent non-italian visitors from seeing national ADS when they visit one or more websites.
The solution comes alog with builtin geoip functions in the php5-geoip package to be installed as usual using apt-get
After installed this package typing:
apt-get install php5-geoip

Now, what you have is a countries database, and if you want to be much more precise (as me for example) you can download a detailed Cities database typing the following set of commands:

cd /tmp
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz
sudo mv -v GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat

Now you own the entire planet cities database! 🙂

Let’s try it within a PHP web page: create a new file (or edit an existent one) and type:

print_r(geoip_record_by_name('php.net'));

It should return something like this:

Array
(
[country_code] => US
[country_code3] => USA
[country_name] => United States
[region] => CA
[city] => Sunnyvale
[postal_code] => 94089
[latitude] => 37.4249000549
[longitude] => -122.007400513
[dma_code] => 807
[area_code] => 408
)

Comments or questions are welcome, Also if you neew to setup a geo based service, now you know who could do it for you!

Cheers

Incoming search terms:

  • yesterdayxbc (1)
(Visited 1,146 times, 1 visits today)