Skip to Content

develCuy's blog

by Fernando Paredes García


HOWTO loss-less compress PDF files in Linux

Image Magick is an awesome tool that also does a great work compressing PDF files.

Just run the following command:

$ convert -compress jpeg -density 150 file.pdf file-compressed.pdf

Notice that -compress is the compression type, and -density is the image quality.

There are more details in the Image Magick manual.

Blessings!


The future of Menu Token module

Menu Token has good reception in the community, thanks to hardworker co-maintainers and great patches from the community!

Now is time to make an small pause and think about the future.

So, following feature requests given me an idea on what would be the next steps:
- Features integration: http://drupal.org/node/1289302
- Additional tokens: http://drupal.org/node/973882
- Selectively expand menus with tokens: http://drupal.org/node/978948

Of course I want to see them implemented.

Additionally:


MeQuejo.PE: a test case for Ophal

With the purpose of testing Ophal in a real use case, just implemented a proof of concept.

The result is the pre-alpha of: MeQuejo.PE, which seems to be a news aggregator, but it really is a list of search results provided by Google Custom Search API, thanks to a search engine with several custom criteria. Such results are consumed with the help of Lua Spore module.


HOWTO Install XHProf in Ubuntu and HOWTO use in Drupal 6.x and 7.x

1. Install dependencies

# apt-get install php5-dev

2. Download xhprof source

$ cd /tmp
$ git clone git://github.com/facebook/xhprof.git

3. Install xhprof PHP extension

$ cd xhprof/extension
$ phpize
$ ./configure
$ make
# make install
# echo "extension=xhprof.so" > /etc/php5/conf.d/xhprof.ini
# echo "xhprof.output_dir=/tmp" >> /etc/php5/conf.d/xhprof.ini
# service apache2 restart

4. Install XHProf module in Drupal

a. Install in Drupal 6.x
# cp -a /tmp/xhprof/xhprof_* /var/www/
$ cd myproject


Hello CDN, bye bye OpenDNS

There was a time when using OpenDNS was of amazing help, a time when CDNs and geoIP were just emerging. Now those technologies are mandatory for our social media lifes. So some weeks ago I have experienced issues accessing many sites that used Akamai CDN: facebook.com, apple.com to highlight some. Then, after googling for a while, found some interesting articles:


develcuy.com Finally running on PostgreSQL

3 years ago I have announced my disagree on how Sun was crossing the red line and my decision to move out of MySQL, so now is time to announce that develcuy.com is successfully migrated to PostgreSQL 9.1!

If you are wondering how I have achieved it, let me share that is not an easy job in Drupal 6, you should have good experience on MySQL, PostgreSQL and Drupal database schema. Fortunately, In Drupal 7, migration between database engines seems to be so easy thanks to DBTNG.


Understanding Drupal's cache while improving your source code performance (Good Practices)

There are several ways to improve Drupal performance, and to be more honest, there are several ways to improve your infrastructure supporting Drupal (e.g. Web Server, MySQL Server, PHP opt-code cache, Varnish/Boost HTML cache, Application cache (Memcached/APC), Pagespeed (output compression/optimization), etc). You can also add gigs of RAM to your server, more processors and perhaps deploy your Drupal site on a cluster of 10+ dedicated servers. In the end, if your source code does not perform well, you will be just wasting CPU, Memory and Bandwidth and that equal money.


Hiding a conflicting module on-fly in Drupal 6.x

Sometimes we need to hide a module to avoid certain known conflicts on a site. The Following is a specific use case for doing as such:

Note: Use jQuery UI 1.8 in an specific admin page

  • Module jquery_ui is installed and provides version jQuery UI 1.7
  • jQuery UI 1.8 is needed in admin page: "admin/build/custompage"

Issue

Once "jquery_ui" module is installed, the "context" module plugin "reaction block" will load "jquery_ui" on every page load.

Solution alternatives

  1. Patch module "jquery_ui" to load desired version when needed

The birth of Ophal project

I were very frustrated with PHP in my very beginnings doing web development (8 years to date). But 2 years ago discovered my favorite programming language: Lua, and then decided to start the Nutria project. For more than a year I have tried several ways to "port" my web knowledge to Lua, and finally two months ago decided to do use my new Lua skills for real world web development.

And the result is: "Ophal... a highly scalable web platform, easy to maintain and extend. It is not married with a particular technology, just the essence will be kept on any major change needed to achieve its mission". Let me remark that Ophal has many influences, but the highest comes from Drupal, more will be elaborated about it in the future. Also, I'm giving a lot of credit to Lua, but LuaJIT is the actual compiler used behind scenes.


RIP IE6 in 2 steps

In answer to the article "To Reduce IE6 Pain, Don't Leave It Until the End", let me show you a way to let IE6 rest in peace:

First Step: Create the file "ripie6.html"

Put it in the same folder as your ".htaccess" file. Be inspired to write a nice warning message, by example:

RIP IE6
Sorry, this site only works with Internet Explorer 7 or later. Mozilla Firefox is also a good one!

NOTE: I have written an example of "ripie6.html" file for you.



Syndicate content