How to test nginx configuration without breaking down the server

You simply use t and c flags followed by config file

  1.  sudo nginx -tc /etc/nginx/nginx.conf
  2.  

This can give you output like this when ok:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

t flag according to man nginx means : Do not run, just test the configuration file. nginx checks the configuration file syntax and then tries to open files referenced in the configuration file.

c flag means: Use an alternative configuration file. the config file path should come after the c flag.

Why you should use this instead of restart? or reload? because when you do sudo service nginx restart and your config file is broken you’ll affect the whole server and if you have multiple websites that means all sites go down possibly because of some little curly boi ; . reload might not do anything when there is error. to be safe always test config before reloading or restarting. even if you do simple changes to main nginx config or sites configs.

IE 11 not opening, crashing on Windows 10 after upgrade from windows 7, How to solve

After upgrading from windows 7 to 10,  IE 11 doesn’t open.  I have searched a lot but didn’t find a solution.  One solution suggested it was due to logitech camera’s process monitor. but removing that didn’t solve the problem.   The error log in event viewer was this:

Faulting application name: iexplore.exe, version: 11.0.10240.16412, time stamp: 0x55b99d3f
Faulting module name: ntdll.dll, version: 10.0.10240.16430, time stamp: 0x55c59f92
Exception code: 0xc0000409

After some digging, it turned out it was due to EMET 5.2 Microsoft mitigation service.  seems Microsoft security service breaks its own program.   I uninstalled it, IE 11 worked. I reinstalled it after downloading it again from Microsoft site.  IE 11 stopped working.  I opened EMET notification and went into apps and tested the different checkboxes for IE.  unchecked EAF and leaving other checks worked.

TL;DR;  If you have EMET 5.2 installed, opening EMET, going to APPS -> unchecking EAF in front of Internet Explorer and then OK should make IE work again.  what security implication that means not sure. but Microsoft should fix this soon.

 

Why site is so slow on IE even to scroll – Poor IE 8,9 performance

Stop using IE

IF your site is running too slow on IE 8 or IE 9, but it is working perfectly fine on Chrome and Firefox. Check if you are using shadow filter in your css. While Internet Explorer is generally slower than Chrome and Firefox, It is not as slow as when using shadow filters. It really performs terribly that render your site useless and deter visitors from ever daring to visit your site. This is why you should never use filters again. Even scrolling becomes too slow and jumpy. Opening javascript dialog boxes such as jquery lightbox takes extra seconds that it makes the website hard to navigate. While Microsoft describe shadow filter as depreciated on MSDN for IE 9 and above. it is still inexcusable to have it perform this slow especially that IE 8 only supports that way.

The following css makes a huge performance degradation in IE :


  1.   filter: progid:DXImageTransform.Microsoft.Shadow(Color=#777777, Strength=2, Direction=0),
  2.   progid:DXImageTransform.Microsoft.Shadow(Color=#777777, Strength=2, Direction=90),
  3.   progid:DXImageTransform.Microsoft.Shadow(Color=#777777, Strength=2, Direction=180),
  4.   progid:DXImageTransform.Microsoft.Shadow(Color=#777777, Strength=2, Direction=270);

Here is a demo of the issue, try this on IE and then on Chrome/Operate/Firefox/Safari. Try to click remove and add filters and notice the difference. Click the images to trigger lightbox and see how slow it is when the filters implemented. Even on simple text page, it is still slow when scrolling. On Chrome and Firefox, the shadow implemented using box-shadow which performs excellently.

Demo showing IE shadow filters performance

How to view wikipedia on SOPA blackout day

On Wednesday wikipedia English is blacked out in protest of proposed anti-piracy law SOPA in US congress. you are greeted with blacked out page with information about SOPA. However you don’t have to postpone your research or daily wikipedia reading. You can still view wikipedia site despite the blackout, by simple javascript code bookmarlet that can show all hidden elements on page.

So how to show hidden element on page using Javascript?


  1.  var tags=document.getElementsByTagName("*"); //get all tags
  2.  for (var tg in tags){
  3.   try{
  4.   if (tags[tg].style.display=="none")tags[tg].style.display="block"; //check if they are hidden, display if they are
  5.   }catch(e){ }
  6.  }

Or you can copy the same code as bookmarklet to your browser bookmark bar. simply drag the link/button below and drop it on your browser’s bookmark bar or favorites. when on wikipedia on SOPA day or a page that you need to show all hidden elements , click Show all hidden elements.

Show all hidden elements

Bookmarklet to turn off Google instant search and turn off search filter

Here is a useful bookmarklet to turn off Google’s instant search (another annoying feature from Google) the following bookmarklet consist of two buttons, one to take you to Google preferences, and the other will set the settings automatically, it will turn off instant search and turn off safesearch (adult filter). this is useful when working in incognito mode or private browsing .

Go Pref
Go Set

Drag each of the buttons above and drop it onto your bookmark bar.  Obviously you should FIRST go to Go pref then hit Go Set. When you first visit google preferences directly, you might see a message that claims that your cookies are disabled, ignore that. it still works unless your cookies are actually disabled.

 

UPDATE:  

I updated the bookmarklet so now it works with Google new setting page.