Upgrade WordPress 2.7 in 3 Simple Steps

Posted on in Categories GNU/Open source, Howto, Linux, Shell scripting, Sys admin, Tips, UNIX last updated August 9, 2016

Wordpress version 2.7 has been released and can be upgraded easily using UNIX / Linux shell prompt. A few assumptions:

  1. Wordpress database name: wptheosblog
  2. Wordpress directory name: /var/www/html/theos.in
  3. Wordpress domain name: theos.in
  4. Operating system: Linux
WARNING! If you are not comfortable with UNIX shell prompt (IF YOU ARE new to a UNIX/Linux os), please follow traditional way of upgrading wordpress and DO NOT use the three Steps described here.

How to: Linux Play DivX .avi video codec file

Posted on in Categories Debian Linux, Linux, Linux desktop, Linux distribution, Ubuntu Linux last updated September 2, 2012

From my mail bag:

I’ve downloaded .avi files which is compressed into small sizes while maintaining relatively high visual quality using DivX format. How do I play DivX compressed files under Debian / Ubuntu Linux?

The current version of the DivX Community Codec for the Windows platform is version 6.6, and for Mac OS X is 6.6x. There is no Linux version available however with the help of VLC and DivX for Linux codec, you should able to play all sort of DivX files.

Download and Install DivX Linux Codec

Open terminal and type the following command to download DivX codec:
$ cd /tmp
$ wget http://download.divx.com/labs/divx611-20060201-gcc4.0.1.tar.gz

Untar DivX 6.1.1 codec for Linux:
$ tar -zxvf divx611-20060201-gcc4.0.1.tar.gz
Install divx611 codec:
$ cd divx611-20060201-gcc4.0.1
$ sudo ./install.sh

Press Q after reading agreement, please type yes to install codes.

Install vlc player

The VLC media player can be installed using apt-get command, type:
$ sudo apt-get update
$ sudo apt-get install vlc

How do I play files?

Open VLC player by Visiting Applications > Sound and Video > VLC Player. You can also open terminal and type the command:
$ vlc /path/to/my-downloaded-movie.avi

Further readings:

Linux: Monitor Hard Disks Temperature With hddtemp

Posted on in Categories CentOS, Debian Linux, Hardware, Howto, Linux, Monitoring, RedHat/Fedora Linux, Suse Linux, Tips, Troubleshooting, Tuning, Ubuntu Linux last updated July 7, 2010

There is a nice utility to monitor hard drive temperature. Most modern x86 computer hard disk comes with S.M.A.R.T (Self-Monitoring, Analysis, and Reporting Technology). It is a monitoring system for computer hard disks to detect and report on various indicators of reliability, in the hope of anticipating failures.

Display or list web server headers

Posted on in Categories Apache, CentOS, Debian Linux, Howto, lighttpd, Linux, UNIX, Windows server last updated August 16, 2007

If you are looking to debug a problem with HTTP server and would like to see HTTP requests / header responses in raw format, use shell tools or Firefox extensions.

Why do I need to dig out web server headers?

[a] Help debugging web application.

[b] See which kind of web server the remote site is using.

[c] See the cookies sent by remote site

[d] Learn http protocol and much more

Let us see Linux / UNIX command line tools to dig out headers.

wget command

wget command is not just downloading utility. It can be served as debugging tool. You need to pass -S option to wget command, which will print the headers sent by HTTP servers and responses sent by FTP servers.
$ wget -S http://theos.in
Output:

--01:32:15--  http://theos.in/
           => `index.html'
Resolving theos.in... 74.86.49.131
Connecting to theos.in|74.86.49.131|:80... connected.
HTTP request sent, awaiting response... 
  HTTP/1.0 200 OK
  Connection: close
  X-Pingback: http://theos.in/xmlrpc.php
  Content-Type: text/html; charset="UTF-8"
  Date: Thu, 16 Aug 2007 20:02:16 GMT
  Server: lighttpd
Length: unspecified [text/html]

    [     <=>                                                                                                                              ] 44,214        32.56K/s             

01:32:17 (32.50 KB/s) - `index.html' saved [44214]

If you are just intrested in headers pass –spider option to wget. With this option wget behave as a Web spider, which means that it will not download the pages, just check that they are there.
$ wget -S --spider http://theos.in/

Other command line tools

UNIX / Linux offers so many options. You can try out old good telnet command, lynx browser, curl command and other tools:
$ lynx -head -dump http://theos.in/
$ curl -I http://theos.in/

You can use telnet as follows:
$ telnet theos.in 80
Output:

HEAD /index.php HTTP/1.1

Firefox extension

If you are using Windows or just wanted to get information on fly, try firefox extension – LiveHTTPHeaders. It adds a ‘Headers’ tab in ‘View Page Info’ of a web page. You can also see a tool in the ‘Tools->Web Development’ menu to be able to display http headers in real time while pages are being downloaded from the Internet or web server. It also allows you edit request headers and replay an URL (good for testing web app security).

Download LiveHTTPHeaders

=> Visit project download page here

Other options

You can use specialized tools such as WireShark network protocol analyzer or tcpdump for the same purpose.

Lighttpd block wget useragent for specific urls

Posted on in Categories Ask nixCraft, lighttpd, Linux, Security, Tips, Tuning, UNIX last updated August 12, 2007

One of regular reader asks a question:

My website powered by Lighttpd web server. I’d like to block Wget useragent for entire my domain.com site except for /downloads/ url section. How do I configure lighttpd?

You need to use $HTTP filed useragent and url combination. Just open your lighttpd.conf file and append code as follows.

Lighttpd block useragent wget configuration

# vi /etc/lighttpd/lighttpd.conf
Append config directive as follows:

$HTTP["useragent"] =~ "Wget" { 
        $HTTP["url"] !~ "^/download($|/)" { 
                url.access-deny = ( "" )  
        }
  }

Where,

  • $HTTP[“useragent”] : Match on useragent i.e. Wget
  • $HTTP[“url”] : Match on url section such as /download/*. If there are nested blocks, this must be the most inner block.
  • =~ : Perl style regular expression match
  • !~ : Perl style regular expression not match

Just restart the webserver, enter:
# /etc/init.d/lighttpd restart

Now user can run wget on http://domain.com/download/* urls but not on http://domain.com/file.html or http://domain.com/dir/file