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 December 11, 2008

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 October 31, 2007

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 June 25, 2017

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

Linux wget: Your Ultimate Command Line Downloader

Posted on in Categories CentOS, Debian Linux, FreeBSD, Gentoo Linux, Howto, Linux, Linux desktop, Networking, RedHat/Fedora Linux, Shell scripting, Solaris, Suse Linux, Sys admin, Tips, Tuning, Ubuntu Linux, UNIX last updated June 21, 2005

It is a common practice to manage UNIX/Linux/BSD servers remotely over the ssh session. You may need to download download the software or other files for installation. There are a few powerful graphical download manager exits for Linux and UNIX like operating systems:

Linux > Command line BitTorrent client

Posted on in Categories Linux, RedHat/Fedora Linux, Shell scripting, Suse Linux, Tip of the day, Tips, Ubuntu Linux, UNIX last updated March 14, 2005

BitTorrent is the name of a peer-to-peer (P2P) file distribution protocol, and of a free software implementation of that protocol.

The BitTorrent client is a computer program developed by BitTorrent, Inc. used to download and upload files via the BitTorrent protocol. You can download python based command line BitTorrent client download for Linux/BSD/Mac OS X/UNIX link oses. This is quite useful, if you would like to download file remotely over SSH session. bittorrent.com offers bittorrent client in .deb (Debian Linux) or rpm (RedHat/Fedora Core/CentOS Linux) file formats.

To use the bittorrent in command line one you need to use command bittorrent-console or bittorrent-curses (see below for examples).

Step # 1: Find Python version

Make sure you download file according to your python version. Type following command to find out python version:
$ python -V
Output:

Python 2.4.2

Step # 2: Download bittorrent client

Use wget to download bittorrent client

Download bittorrent client for Debian Linux:

$ wget http://download.bittorrent.com/dl/bittorrent_5.0.3_python2.4.deb

Download bittorrent clientFor Red Hat / Fedora Core / Cent OS Linux

$ wget http://download.bittorrent.com/dl/BitTorrent-5.0.3-1-Python2.4.noarch.rpm

Step # 3: Linux Install BitTorrent client

First login as a root user (use su or sudo command). If you are using Debian Linux, use dpkg command install bittorrent client
# dpkg -i bittorrent_5.0.3_python2.4.deb
If you are using Red Hat / Fedora Core /Cent OS Linux, use rpm command install bittorrent client:
# rpm -ivh BitTorrent-5.0.3-1-Python2.4.noarch.rpm

Step # 4: Start using or downloading files

Use bittorrent client as follows:
$ /usr/bin/bittorrent-curses 'http://www.some.org/DesktopBSD.iso.torrent'
OR
$ bittorrent-curses 'http://www.some.org/DesktopBSD.iso.torrent'
OR
$ /usr/bin/bittorrent-curses '/path/to/file.torrent'
You can try out pure console based client bittorrent-console instead of curses based client:
$ bittorrent-console '/path/to/file.torrent'
$ /usr/bin/bittorrent-console 'http://www.some.org/DesktopBSD.iso.torrent'

Tips about using and Troubleshooting BitTorrent client

(A) If you get [Errno 2] No such file or directory, you need to use wget or lynx command to download .torrent file to local hard drive first. For example
$ bittorrent-curses 'http://www.mininova.org/get/some_file[222].torrent'
First download download .torrent file using any one of the following method:
$ lynx 'http://www.mininova.org/get/some_file[222].torrent'
When prompted save .torrent file to a hard-disk. Another option is use wget to download .torrent file:
$ wget 'http://www.mininova.org/get/some_file[222].torrent'
Now start the downloading as follows:
$ bittorrent-curses 'some_file[222].torrent'

(B) If you get error ‘This seems to be an old Python version which does not support detecting the filesystem encoding. Assuming ‘ascii’, then upgrade your python version to 2.4.xx:

Debian user upgrade python version using apt-get command:
# apt-get update
# apt-get install python2.4

Red Hat Linux user try out:
# up2date python2.4
Fedora Linux user try out:
# yum install python2.4

Remember if you have both versions (python v2.3 and v2.4) installed, you need to run bittorent client as follows:
$ python2.4 /usr/bin/bittorrent-curses '/path/to/file.torrent'
Command line BitTorrent client should work with other UNIX like operating systems such as FreeBSD/OpenBSD/Solaris etc (as long as you have Python it should work).

The current client enables a range of features including multiple parallel downloads. It also intermediates peering between itself, source file servers (read as trackers) and other clients, thereby yielding great distribution efficiencies. The client also enables users to create and share torrent files. See help files for more information.

See also: