PDFx is a free command-line tool to extract references, links and metadata from PDF files. You can also use it to find broken links in a PDF file, using pdfx -c:
For each URL and PDF reference, pdfx performs a HEAD request and checks the status code. It there are broken links, PDFx print the link with the page number where the link was found in the original pdf:
You can simply install PDFx with easy_install or pip and run it like this:
Run pdfx -h to see the help output:
For more examples and infos, take a look at the PDFx project page. You can find the code on Github, the code is released under the Apache license.
Feedback, ideas and pull requests are welcome! You can also reach me on Twitter via @metachris.
Mandrill, the beloved-by-many transactional email service, recently announced that it will switch to a paid-only model under the MailChimp umbrella. This came as a surprise to many developers who used them for sending emails for free from various servers and backends. This post provides a round-up of some of the more popular Mandrill alternatives.
Free Transactional Email Providers
This section covers a number of popular transactional email providers with a free tier.
This is a simple and effective method how to serve Wordpress pages blazingly fast: produce static HTML files with WP Super Cache, and serve them directly with nginx.
WP Super Cache (on Github) is an immensely popular, official Wordpress caching plugin with more than 1 million active installations. Basically the plugin produces static html pages of your posts and pages, and anonymous users can directly load the html without any interaction with PHP.
nginx is a very fast, flexible webserver, reverse proxy, load balancer and cache. If you are using Apache, WP Super Cache explains mod_rewrite rules to achieve the same thing as explained in this post.
After installing the WP Super Cache plugin, enable caching in the plugin settings, and configure the garbage collector timeout according to your needs.
Once enabled, visits by anonymous users (user which are not logged in) will create static .html files in the /wp-content/cache/supercache/ directory.
To achieve optimal performance, serve those .html files directly, bypassing PHP altogether. The following nginx config snippet works well for http:// and https:// sites. I save this snippet as wp-supercache.conf and reference it from the various server configs.
Now just include the above snippet from a nginx server config:
As always, test and reload the nginx config with nginx -t && nginx -s reload. This command will only reload the config if it doesn’t contain any errors.
Now let’s test if it works:
The first anonymous visit will call the PHP code and produce the static .html file
The second anonymous visit will receive the cached html
How do we know it didn’t go through the PHP WP Super Cache? Because WP Super Cache adds it’s own header, as you can see in this example with the nginx config disabled:
If you run into problems, you can always enable the WP Super Cache debugging which logs a lot of info into a logfile, and manually delete the /wp-content/cache directory for a fresh start.
You can easily verify that WP Super Cache is producing the static files by showing all files in the directory wp-content/cache, for instance with the command tree or find ./, or by opening the “Contents” tab in the WP Super Cache Settings and then clicking “Regenerate cache stats”.
And that’s it! Enjoy your blazingly fast Wordpress setup 😎🚀
If you have suggestions or feedback, let me know via @metachris.