List installed / available modules in Apache

Added on 28 Nov, 2008, categorized under Linux

To to list the compiled-in modules for your Apache installation, use the following command

$ apache2 -l
Compiled in modules:
  core.c
  mod_log_config.c
  mod_logio.c
  prefork.c
  http_core.c
  mod_so.c

For older systems running apache 1.x, the command is as the following, and should produce the same output:

$ httpd -l
Compiled in modules:
  core.c
  mod_log_config.c
  mod_logio.c
  prefork.c
  http_core.c
  mod_so.c

For loadable modules, they are normally placed in the modules directory as in the following;

$ ls /usr/lib/apache2/modules/
httpd.exp               mod_cgid.so          mod_mem_cache.so
libphp5.so              mod_cgi.so           mod_mime_magic.so
mod_actions.so          mod_charset_lite.so  mod_mime.so
mod_alias.so            mod_dav_fs.so        mod_negotiation.so
mod_asis.so             mod_dav_lock.so      mod_proxy_ajp.so
mod_auth_basic.so       mod_dav.so           mod_proxy_balancer.so
mod_auth_digest.so      mod_dbd.so           mod_proxy_connect.so
mod_authn_alias.so      mod_deflate.so       mod_proxy_ftp.so
mod_authn_anon.so       mod_dir.so           mod_proxy_http.so
mod_authn_dbd.so        mod_disk_cache.so    mod_proxy.so
mod_authn_dbm.so        mod_dumpio.so        mod_rewrite.so
mod_authn_default.so    mod_env.so           mod_setenvif.so
mod_authn_file.so       mod_expires.so       mod_speling.so
mod_authnz_ldap.so      mod_ext_filter.so    mod_ssl.so
mod_authz_dbm.so        mod_file_cache.so    mod_status.so
mod_authz_default.so    mod_filter.so        mod_substitute.so
mod_authz_groupfile.so  mod_headers.so       mod_suexec.so
mod_authz_host.so       mod_ident.so         mod_unique_id.so
mod_authz_owner.so      mod_imagemap.so      mod_userdir.so
mod_authz_user.so       mod_include.so       mod_usertrack.so
mod_autoindex.so        mod_info.so          mod_version.so
mod_cache.so            mod_ldap.so          mod_vhost_alias.so
mod_cern_meta.so        mod_log_forensic.so

These modules are however only enabled if it’s defined by the LoadModule directive in the apache configuration file.

Tags: , ,

Fedora 10 Screenshots

Added on 26 Nov, 2008, categorized under Linux

Fedora 10, codenamed Cambridge has been released earlier today, bringing along the following features;

  • AMQP (Advanced Message Queueing Protocol) Infrastructure
  • Better printing
  • Better and faster startup
  • Better webcam support
  • Better remote support
  • Glitch free audio
  • First aid kit
  • Remote virtual settings
  • Security audit
  • Virtual storage

Here are some reduced sized screenshots of this release. Click on the images for full size screenshots

 

Fedora 10 (Cambridge) screenshots
 Boot: GRUB  Boot: Media test
Boot: Detecting Media  Installation: Welcome screen
 Installation: Welcome screen  Installation: Choose installation language
 Installation:Choose keyboard type  Installation: Erase harddisk
 Installation: Set hostname  Installation: Select time zone
 Installation: Set root password  Installation: Partitioning
 Installation: partitioning confirmation  Installation: Formatting
 Installation: Retrieving package information  Installation: Package selection
 Installation: Checking package dependencies Installation: Starting installation process
 Installation: Installing packages  Installation: Performing post install configuration
 Installation: Installing bootloader  Installation: Complete
 Booting  Booting
 Booting Configuration: Welcome
 Configuration: License information  Configuration: Create user
 Configuration: Date and time  Configuration: Hardware profile
 Configuration: Hardware profile confirmation  Login: User listing
 Login: Enter password  Main window: Gnome desktop
 Gnome version 2.24.1  OpenOffice 3: Loading
 OpenOffice 3: Writer  Gimp 2.6: Loading
 Gimp 2.6: Windows Firefox 3.0.4: About
 Network profile selection Edit connections
Network connections configuration window  Transmission bittorrent client
 Nautilus file manager  Logout selection
Shut down selection  Gnome-termnal
 Firewall configuration  LVM management
 Service configuration Update system: getting updates
 Update system: refreshing package cache  

 

Xubuntu 8.10 (Intrepid Ibex) screenshots

Added on 12 Nov, 2008, categorized under Linux

Xbuntu 8.10, codenamed Intrepid Ibex has been released, and the following are features screenshots of the latest Ubuntu release.

 

Xubuntu 8.10 (Intrepid Ibex) screenshots
 The main desktop window  Latest version of Xfce
 Latest version of Abiword wprd processor  Newly added Listen Multimedia Player
 Easily search files with Catfish  Seahorse GnuPG frontend
 Latest version of Xorg and kernel  Much praised new Network Manager

 

Disable SSH timeout

Added on 05 Nov, 2008, categorized under Linux

By default, most SSH servers are configured to forcibly disconnect inactive or idle clients, or actually those with no network activity. This is not good for some people especially if one is setting up a (reverse) tunnel to the server where the tunnel should remain established whenever they need it.

There are 2 methods to overcome this problem, being the first one is not to stay idle or by keeping the network activity busy, and if you have root access to the server, change the SSHd configuration at the server.

How can the network be kept busy while you are not attending the session? The trick is to run any program that keep updating the screen, such as mtr or top. The program should generate some network activity, and keep the session active and connected. Use the program screen to create virtual terminals where one terminal is dedicated to the program mtr or top.

If you have root access to the server, you might want to just change the SSHd configuration file. To do this, edit the file /etc/ssh/sshd_config and change the following options as in the example below;

TCPKeepAlive yes ClientAliveInterval 30 ClientAliveCountMax 99999

Don’t forget to restart the SSH server afterwards with the following command;

# /etc/init.d/sshd restart

 

Tags: ,

Ubuntu 8.10 (Intrepid Ibex) screenshots

Added on 01 Nov, 2008, categorized under Linux

Ubuntu 8.10, codenamed Intrepid Ibex has been released today, bringing the following features, among others;

  • Better 3G support
  • Write Ubuntu to and install from a USB disk
  • Guest sessions
  • Gnome 2.24

. The following are the screenshots of the latest Ubuntu release.

 

Ubuntu 8.10 (Intrepid Ibex) screenshots
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

 

Access MySQL database using Python

Added on 25 Sep, 2008, categorized under Programming

The basic steps in accessing a MySQL database is normally to connect, execute statement, fetch result, and then to close the connection. The following is the steps translated into Python codes;

# Import required module
import MySQLdb

# Connect
conn = MySQLdb.connect(host="localhost", port=3306, user="root", passwd="root123", db="mysql")
cursor = conn.cursor(  )

# Execute statement
stmt = "SELECT * FROM user"
cursor.execute(stmt)

# Fetch and output the result
result = cursor.fetchall(  )
print result

# Close connection
conn.close(  )

The requirement for this is to install the MySQLdb module for Python which is available from it’s project page at http://sourceforge.net/projects/mysql-python. The connect function creates a connection to the database based on the supplied parameters, and a cursor object is then created upon the connection object. The above example only show the execute and fetchall methods, and there many other available methods from the cursor object. The conn object calls the close method to close the connection to the MySQL server.

Automatically run program on KDE’s startup

Added on 23 Sep, 2008, categorized under Linux

KDE looks for programs in the ~/.kde/Autostart directory to be executed during it’s startup. The way to execute programs as KDE starts would be to;

  1. Copy programs directly to the directory
  2. Create (soft) link to programs from the directory
  3. Create a script which will execute other programs

The first method is very straightforward, and the second method can be achieved using the ln command. The following example is to run superkaramba as KDE starts.

$ cd ~/.kde/Autostart/
$ ln -s /usr/bin/superkaramba mykaramba

The third option is my personal favorite, as it provides a great level of flexibility. The following is an example bash script placed in the ~/.kde/Autostart/ directory to run gpg-agent, export a variable, and start the program katapult and conky;

#!/bin/bash

/usr/bin/gpg-agent --daemon --use-standard-socket &
export GPG_AGENT_INFO=/home/shakir/.gnupg/S.gpg-agent
/usr/bin/katapult &
/usr/bin/conky &

Please make sure all programs are executable by running chmod, probably as the following example;

$ chmod +x ~/.kde/Autostart/*
Tags: ,

Add a new user in Linux

Added on 23 Sep, 2008, categorized under Linux

Linux administrators have few options when it comes to adding a new user to the system, from filling up forms in distribution / desktop environment specific nice GUIs, to running through the command line with options and switches. For the geeky administratorss, there are always configuration files that can manually be edited just for this purpose.

The 2 most common programs used to add a user are, adduser and useradd. They are both quite similar (heck, they do the same thing anyway, which is to add user of course), but are a bit different in their interactivity level.

adduser is quite interactive, the only required parameter to be supplied to the program is the user name to be added while running the program. The rest of the process is a matter of filling up questionaires provided by the program, and a user is then created. The following example shows how to add the user noob to the system.

# adduser noob
Adding user `noob' ...
Adding new group `noob' (1003) ...
Adding new user `noob' (1003) with group `noob' ...
Creating home directory `/home/noob' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for noob
Enter the new value, or press ENTER for the default
        Full Name []: newbie
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [y/N] y

The only mandatory field to be filled up is just the password, and surely to also key in y at the end to confirm your action.

useradd is normally the preferred choice for non-interactive uses, and at minimum it also accepts only the username as parameter. The following is and example on how to add the user noob using useradd;

# useradd noob

and that’s just it. It is however pretty useless as it lack many things, and the following example should make it more useful;

# useradd -g users -G admin -s /bin/bash -d /home/noob -m noob

The command above will add the user noob with the primary group users, and also including the user to the group admin, setting the default shell to /bin/bash, define the home directory to be at /home/noob, and to create the home directory. Password is not yet set at this point, and the following step sets up the password;

# passwd noob
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

For the geeks and those with brave heart, you are free to edit the following files to change user informations, and even to add a user to the system.

  • /etc/passwd - User account information.
  • /etc/shadow - Secure user account information.
  • /etc/group - Group account information.
  • /etc/default/useradd - Default values for account creation.
  • /etc/skel/ - Directory containing default files.
Tags: ,

Maximize browser window using Javascript

Added on 06 Sep, 2008, categorized under Web

The key to maximizing the browser window in Javascript is the window.resizeTo() function, which would resize the window to any specified size. The function somehow needs to get the screen’s width and height to be supplied as parameter, and the window itself need to be moved to the top left corner of the screen using the window.moveTo() function so that it will be displayed in full.

 The following example will maximize the browser window as the page loads:

<html>
<head>
	<script language="JavaScript">
		window.moveTo(0, 0);
		window.resizeTo(screen.width, screen.height)
	</script>
</head>
</html>

The browser window will maximize if a user click on the URL as in the following example:

<html>
<head>
	<script language="JavaScript">
		function maximizeme(){
			window.moveTo(0, 0);
			window.resizeTo(screen.width, screen.height)
		}
	</script>
</head>
<body>
	<a href="javascript:onclick=maximizeme()">Maximize</a>
</body>
</html>

 

Google Gears in 64-bit Linux

Added on 05 Sep, 2008, categorized under Linux

From it’s official website, Google Gears is a plug-in that extends your browser to create a richer platform for web applications. Web applications currently making use of Google Gears includes Google Reader, Google Docs, Zoho, Remember the milk, Picasa Web Album, Myspace, and recently the latest version of the popular blogging application Wordpress.

Google Gears is known for being able to make offline browsing of supported sites possible, though that’s actually just part of it’s aim of "enabling more powerful web application, by adding new features to your web browser".

As per the time of writing, Google Gears is not available for 64 bit Linux. As it is open sourced, some smart people at it’s user group has been able to create an unofficial patch to fix the problem and released the binary for it.

The following step is on how to install it in Linux.

  • Download the latest binary being made available at http://www-personal.umich.edu/~swolchok/gears/
  • Open the downloaded file using Firefox
  • Click Install Now when prompted
  • Restart Firefox

The installation process is illustrated by the screenshots below;

Tags: , ,


Categories





License

Creative Commons License
Unless otherwise stated, contents in this site is licensed under a Creative Commons Attribution 3.0 Unported License.

Disclaimer

The information in this weblog is provided "AS IS" with no warranties, and confers no rights. Inappropriate comments will be deleted at the authors discretion. All code samples (if any, ever) are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
Computers (Windows) - TOP.ORG