2015-12-18

Get Nginx HTTP Server 3rd Edition and any other book from Packt Publishing for just $5


Dear readers, bloggers, fellow administrators, I have been informed by my excellent publisher Packt Publishing that they are currently running an amazing offer: you can get any of their books for just $5. This includes my recent publication - Nginx HTTP server 3rd edition. The promotion started yesterday and will last until New Year. Hurry up and get as many books as you can before the promotion ends!

2015-12-10

Outlook 2010 stuck in safe mode - just uninstall KB3114409

Yesterday (December 9th, 2015) Microsoft rolled out a faulty update for Microsoft Office 2010 (KB3114409) which accidentally causes Outlook 2010 to start in safe mode systematically, ignoring registry and computer settings.

To solve the problem, simply go to the "Programs and features" control panel applet, click on "View installed updates", search for KB3114409, and uninstall it. After you reboot your computer, Outlook will start normally again.


This solution has been tested successfully at work for dozens of users.

Microsoft stated: “After you install this update, Outlook 2010 may start only in safe mode. If this issue occurs, uninstall the update. This update is no longer available now."

Source: Microsoft message boards

2015-11-12

Nginx HTTP Server - Third Edition now available!

I am glad to announce that the third edition of "Nginx HTTP Server" (the book) is now available! You can already buy the ebook over at Amazon.com or directly from Packt Publishing. Paperback version will follow on December 1st.


Aside from the numerous corrections, chapter overhauls, and section rewrites, this new edition comes with two entirely new chapters:
  • an introduction to load balancing and optimization
  • real life case studies, starting from scratch
It is much more practice-oriented, focusing on examples rather than endless directive bullet lists. We learned a lot from reader reviews and I can safely say that this edition is the best by far! Congratulations to everyone who's been working hard on the project over the past months - especially Siddhesh, Kirti, and Indrajit! If you are interested in getting a free copy of this book (ebook version), please feel free to post a comment here. I will get back to you quickly!

2015-09-12

Disqus comments, 3rd edition, 2 million page views

Just a quick update that most likely no one will read, but here it is anyway:
  • I have switched comment systems, we're now with Disqus. Blogger did a terrible job at preventing spam so I'm hoping I'll get luckier with Disqus. I removed about 2000 spam comments so far.
  • Nginx HTTP Server, 3rd edition is coming up soon! The first draft is complete. After checking out user reviews online we decided that this edition should focus on examples and case studies, rather than standing for the ultimate directive reference or index. The first edition from 2009/2010 was meant as an exhaustive reference that people could use at all times, but several readers complained that the information was readily available online. We never pretended otherwise but we tried to make the documentation in the book more accessible and legible. Hopefully this new edition will prove satisfying to all.
  • 2 million page views on the blog - we're almost there! In a couple of days the amazing milestone of 2,000,000 page views will be reached, I never thought it would go this far when I started the blog a few years back. I haven't posted much lately but that's because I have been busy working on all sorts of projects. I try to post at least 8 to 10 times a year.
Thanks for visiting! Clement

2015-08-04

How to fix: jQuery UI progress bar not animating when indeterminate value

Once again I find myself in this situation:
- I run into a small problem
- I google it: can't find a solution
- Try to fix it myself: success
I am hoping that by posting this article I will help out a person or two.

UPDATE: a day later, the problem is back, this post is thereby useless. If you know a proper solution I'm all ears! ;-(

What's the problem?

The jQuery UI progress bar widget is useful in a lot of situations and it's easy to use. When you set its value to "false" (indeterminate/unset), the progress bar animates nicely. The end user feels like something is actually happening. 

The problem I've been having is that the progress bar RANDOMLY doesn't animate in my project. I'm sure I must have done something wrong at some point, but the project is so huge that it would take too long to root out the issue on my end. As a result, my users are under the impression that my application has crashed and they reload the page (while they should just be waiting for the operation to complete).

This is a simple fix. When animated, the progress bar uses the CSS class "ui-progressbar-overlay". This class gets its background from an inline GIF (base 64 encoded within the CSS file).

How to fix it?

Open your jQuery UI CSS file, look for the "ui-progressbar-overlay" class, and replace the inline GIF by an external image (the original image can be found here). 
Example:
.ui-progressbar-overlay{background:url("images/overlay.gif")

That's it! Save your files, refresh your cache and voila.

NOTE: this article has been updated. This did not actually solve the problem. I thought it did because it worked for a while, but now it has stopped working again.

2015-06-22

Word 2007/2010/2013: attaching a template (containing custom styles) to a document

As I am writing the third edition of Nginx HTTP Server I often find myself in a situation where I have to apply a specific variety of styles, which are supplied to me by my publisher under the form of a .dot file. There are two operations to perform if you want to be able to see all the styles when editing your document:
  • attaching the .dot / .dotm template file to your document
  • editing the settings to display all styles (not only the "recommended" ones)

Attaching a .dot or .dotm file to your document

Open the Options dialog in Word. This is usually achieved by going in the "File" (1) menu then clicking "Options". Then open the Add-ins section at the bottom (2). Select "Templates" (3) and click "Go" (4)

In the window that pops up, click the "Attach..." button to attach your template file. That's the first step.

Editing the settings to display all styles

At the bottom right corner of the style selection box there is a small arrow (1), click it to reveal a floating or side bar with a larger selection of styles. At the bottom of that bar, click the "Options" link (2). A window shows up (3), select the following options:
  • All styles
  • Alphabetical
  • Tick all check boxes
Press OK to apply the changes. There you go! A full list of styles from your imported template.


2015-04-14

wkHTMLToPDF chinese character support on Linux based systems

This post will explain how to add support for Chinese characters in wkHTMLToPDF - the famous tool that converts HTML pages to PDF documents seamlessly. By default, if you have Chinese characters in your HTML page and convert the page to PDF with wkHTMLToPDF, nothing comes out (blanks replace chinese characters). I doubt this subject will be helpful to a lot of people around the world, but I might need to use this trick again in the future so why not blog about it?

The trick is to install Chinese character support on your OS and rebuild the cache. Under Ubuntu, I ran this command to install Chinese fonts:
apt-get install fonts-wqy-microhei ttf-wqy-microhei fonts-wqy-zenhei ttf-wqy-zenhei 
Note: package names might be different if you aren't under Ubuntu (try apt-cache search ... to search for packages)
Then, run this command to update the font cache:
fc-cache -f -v

After that, try generating a PDF again with wkHTMLToPDF: it works! Huge thanks to an anonymous user on StackOverflow for finding the solution.

2015-03-11

Sublime Text vs phpDesigner vs PhpStorm

Lately I have been trying out several IDE solutions in order to improve my development productivity. Working on large projects made me realize that I was probably not using the right tools. Over the past year I have tried three in particular and I've got a clear winner here. So clear in fact that I thought I should write about it.

The three solutions that I am comparing are:
They all have trial periods so you are free to try them out for a limited time. Also please bear in mind that I am only working on PHP projects, so if that is not the case for you, you might find this article irrelevant.

Sublime Text

I was originally using Notepad++ as code editor, but when I started working on larger projects I quickly felt the need for something more. I was recommended Sublime Text by a friend. Let me list the pros and cons of the solution before discussing further.

Pros:
- Fully multi-platform, though I have only been using the Windows version
- Lots of plugins to extend functionality
- Very lightweight and responsive

Cons:
- Default functionality is somewhat feeble (you have to resort to plugins)
- Steep learning curve, documentation clearly lacking, terrible support even for paid users
- Can be unstable, plugins and application sometimes crash



My thoughts:
It took me weeks to really finalize my Sublime Text set up: first you need to know that the program doesn't do much if don't install plugins. And there is no actual GUI for configuring the program: all the program and plugin settings have to be written in text format in the editor (and guess what? you will not find an up-to-date list of all the settings that can be configured). Then you realize installing and managing plugins is pretty easy and cool, so you install tons of them, turning Sublime Text into a pretty good IDE. The thing is, some of the plugins that I've used have been upgraded over time and changed the behavior of the application (I'm talking about SublimeCodeIntel specifically, but there are other examples). In addition, some features just don't work properly at all -- code folding, indenting -- and some things are just downright missing (ie. automatic indenting, full code folding, ...) and aren't available as plugins. On top of that, it is nearly impossible to get support. There is a message board available but nobody really cares at all and messages are left unanswered. In conclusion I would only recommend Sublime Text if you are working on big projects with tons of files open (because it is really lightweight) as long as you don't need extensive functionality.

phpDesigner

I found out about phpDesigner accidentally during a Google Search. It looked nice and appeared to be free (official website states "Free Download"), but it actually isn't. You even have to pay for upgrades. That isn't usually a big problem because when an application really improves your productivity, it is worth purchasing. I had a good run with phpDesigner but I gave up for several reasons. Let me list the pros and cons.

Pros:
- Easy to install and use, fast learning curve
- Comes with tons of power features (intelligent syntax highlighting, autocompletion, ...)
- Relatively lightweight

Cons:
- Windows only, other platforms are unsupported 
- The GUI can be cumbersome and annoying
- Doesn't work well on high DPI settings


My thoughts:
When I first installed this program, I thought: wow, it looks completely broken. Toolbars looked terrible, UI fonts were too small or too large, and so on. I quickly realized that this was due to the DPI settings I was using on Windows (150% -- I have a high res monitor). When I switched back to 100%, the program looked perfectly fine. I reported the issue to the developer about a year ago and he replied nicely, but the program was never updated since. It's a shame because it has potential. There are some particularly useful features such as a full fledged code explorer, very relevant code completion, code reformatting tools and many more. In the end, I gave up on it because of the UI issues. I hope it gets fixed in the future, but I wouldn't be too hopeful. In conclusion, I would recommend phpDesigner if you're a Windows user with regular OS settings and conditions, but if you are the kind of person who requires very specific work environment settings I think you might be turned off by the UI.

PhpStorm

I recently stumbled upon a survey of the best PHP IDE (2014 edition) showing overwhelming results in favor of PhpStorm. Strangely I had never heard the name before, and it was not for lack of Googling! So I looked into it, downloaded the trial version and... well, what a shock this has been. I could not dream of a better IDE. It is absolutely perfects for my needs.

Pros:
- It has every feature you could dream of, and more
- Extremely configurable, in a very easy way
- Excellent and friendly user interface
- Fully multiplatform

Cons:
- Somewhat heavy, if you compare it to Sublime Text
- I really can't find another con



My thoughts:
After downloading the program, I was surprised to see that they have a very nicely written guide that helps you go through the first steps of installing and configuring the IDE. It answered pretty much every question I had, right off the bat. It took me a few minutes to figure out how to fully and properly import my existing projects into the application. Then I spent hours configuring the IDE -- not because I had to, but because I enjoyed it! They actually have a theme download website (themes are easy to install), a thousand settings which can either be language-specific or global, at the end of the day you can really have it the way you want. In addition, there is a nice little community of users which makes it easy to get help. After a few days of use, I ended up purchasing the license. No regrets at all, that's a well spent $99. In conclusion, I would recommend PhpStorm if you're after a powerful IDE and have a decent computer (since it's not as lightweight as Sublime Text, for example).

If you've read the article fully, you'll probably have understood that my personal favorite is PhpStorm by far!

Search This Blog