• nginx 502 Bad Gateway Error


    A routine software update on the server running nginx was done. After that the website stopped opening in the browser window and 502 Bad Gateway error along with the nginx version number was displayed. Looking in the log file showed an entry like,

    2014/06/26 11:09:53  2539#0: *15 connect() to ...
  • How to redirect non-www URLs to www in Varnish

    If a website's canonical URL has www, it is desirable, as a good SEO practice, to redirect the non-www URLs to www. That is, if the canonical URL is www.example.com, example.com should be redirected to www.example.com. How to do this when Varnish is listening on port 80 as a reverse HTTP proxy is given below ...

  • Trigonometric calculations with bc

    bc, the basic calculator under Linux and UNIX environments, provides commands for doing arbitrary precision mathematical calculations. The syntax for basic arithmetic functions is intuitive. Here, we look at the commands for doing trigonometric calculations.


    The global scale variable gives the number of digits after the decimal point. By ...

  • Unity launcher stays at the left, does not auto-hide

    Problem: After login in the Ubuntu Linux system, the Unity launcher stays at the left edge of the display. It does not auto-hide.

    Solution: Click on the Settings icon in the top right corner of the display. You will find tabs like Wi-Fi, Bluetooth, Background, etc. in the left column. ...

  • Repairing Drupal site blocks manually in database

    The text format of a block was PHP code and it contained PHP code with an error. This broke the website resulting in blank screen web pages, the white screen of death (WSOD). The error was rectified by manually updating the MySQL database. The following steps were taken.

    From the command line, connect with the website ...

  • Not able to login

    Problem: Not able to login to Ubuntu Linux system because the disk partition containing the HOME directory has become full.


    • Press CTRL ALT F1 together to switch to text mode and try to login.
    • After login, check the free space in disk partitions by give ...
  • Wireless is disabled by hardware switch

    While configuring the wired network on Ubuntu 12.04 Linux laptop, the wireless network connection broke down suddenly. On clicking the networking icon on the top panel, no wireless networks were displayed on the NetworkManager applet and a message Wireless is disabled by hardware switch was reported. The laptop wireless switch was in ...

  • Connecting two computers with Ethernet LAN cable

    Quite often, we wish to connect two computers back to back using an Ethernet LAN cable. It may be because we wish to transfer files between the two computers or because one of these has the Internet access and we wish to have one more access point to the Net. The step by step instructions ...

  • Nginx 502 bad gateway error after switching off the mobile theme

    The WPtouch plugin gives a WordPress website the capability to be displayed on mobile devices using a suitable theme. At the end of the web page, there is a toggle button to switch off the mobile theme and use the default desktop theme. That is, a user can toggle ...

  • Nginx installation and configuration

    The configuration is nginx HTTP server, PHP FastCGI Process Manager (PHP-FPM), and the Alternative PHP Cache (APC).


    The first step is to download the nginx software from the Nginx website. If using the Ubuntu distribution, following are the steps,

    (i) Download the nginx signing keys from the ...

  • Formatting the man command output for printing

    1. Limiting the width of Linux man command output

    Quite often, we need to print the output of the Linux man command. One way is to redirect the man command output to a file, open the file in LibreOffice Writer and export to PDF. The PDF can, later, be ...

  • Starting a network server after communication interface is up

    If you have a program that communicates over the network interface, say, eth0 and you wish to start the program automatically after the system startup, you need to ensure that the program starts after the interface eth0 is up. For Linux systems using the Upstart process ...

  • md5sum: no properly formatted MD5 checksum lines found

    md5sum is used for printing or checking a file's 128-bit MD5 checksum. One can download a file on the Internet and also download its checksum. The md5sum command can, then, be used to verify whether the file has been correctly received. Also, while providing a link for download for a file on a web page, ...

  • Remote Display With the X – Window System

    X – Window system is a network-transparent window system. X11 server is the display server that manages the output on the bit-mapped display hardware. An application (or client) does the work and sends requests to the X11 server, or simply, the X server for display. The client application and the X server are usually located ...

  • JRobin: Not able to save graph as a PNG file


    Not able to save graph as a PNG file.  
    Compilation error: cannot find symbol  
     symbol  : method saveAsPNG(java.lang.String,int,int)  


    saveAsPNG does not seem to be there in JRobin anymore. Use the RrdGraph.render (java.awt.Graphics g) method. For example,

    // Create a buffered image in which the ...