Looking for a SHOUTCast Host ? look no further!

Check out http://lmas-networks.com you seriously cant beat what they offer for only £1.00 p/month tons of features in the centova cast control panel and if you currently have shoutcast services hosted elsewhere just drop them an email they will give you a price match deal and give you a month free 😮 !!

Shoutcast hosting

They also allow you to use your own amazon affiliate ID (free to get) so you can make some money if anyone buys a track they hear on your stream!

Try them or ask for a free trial you wont be dissapointed.

Using the /proc Filesystem to Examine Your Linux Inner Working

Quick – answer me this: How much swap space is in use on your system right now? How big is the cache on your CPU? What kernel modules are currently loaded? How many total drives and partitions are you running? If you’re running Linux, all these questions (and a whole lot more) can be answered one easy way: take a look in /proc. It’s a goldmine of system information, just waiting to be retrieved by users, administrators, and scripts. In this guide we’ll take a trip through /proc to see just what valuable system information you’ve been missing out on.

About /proc

Probably the most important thing to understand about /proc is that it’s not a normal directory with normal files. It’s more like a viewscreen into the system internals. Files in this directory are not read and saved to the hard drive like your average document or MP3, they’re generated by the Linux kernel on the fly. Accessing the file /proc/meminfo will likely give you different results each time, because memory usage is nearly always fluctuating.

By putting this kind of system information into a virtual filesystem like proc, the developers adhere to the UNIX philosophy “everything is a file”. They do this so that it can be easily read by any person or software as easily as a normal text file, no special libraries or languages necessary. For us, this means that up-to-date system information is always easily available.

Note: The files mentioned here should all open cleanly in any text editor of your choice. The examples here are showing the contents using the standard cat command from within a terminal.

/proc/cpuinfo

If you’ve spent any time at all in proc, there’s a good chance you’re familiar with this file. Displaying the contents of cpuinfo will give you a detailed picture of exactly what CPU you have and what features it supports.

proc-cpuinfo

/proc/meminfo

The other most well known file in proc, meminfo is an extremely handy file to keep around. It shows you information about memory and swap usage, and is one way that scripts and programs can find out what’s available.

proc-meminfo

/proc/cmdline

This file shows the options that were used to start the kernel. This can be handy when troubleshooting boot problems, or if you need to verify exactly which kernel file was used for boot.

proc-cmdline

/proc/filesystems

A lesser known but still useful file is filesystems. From here you can read the (somewhat extensive) list of filesystems currently supported by your kernel. Not all of these are the type of filesystems you’d use to store your data, some are like proc itself and have special-purpose uses.

proc-filesystem

/proc/PID

In this case, PID is the process ID of a running program. Each process has a unique number that the system uses to identify that particular instance of that particular program. For example, when you run the program top from the command line, you see a list of running processes and their PIDs. Each process has its own subdirectory in proc, which you can browse for information about that particular process.

proc-pid

/proc/modules

One of the most vital of the files in proc, modules contains a complete list of the currently active kernel modules. If you’ve ever had to work through video driver issues, you likely know how useful this can be. While likely not something you’d use every day, this file can be a lifesaver for troubleshooting.

proc-modules

/proc/mounts

You can quickly and easily check all your mounted devices by opening the mounts file. Once again, many of the items here are not necessarily mounts points that a user need be aware of. Most of the sections relevant to you will be found toward the bottom.

proc-mounts

Conclusion

There’s certainly more to proc than can be covered here, so I’d greatly encourage anyone reading this to do some poking around in proc to find the bits of information that could be really useful to you. While many of the files you’ll find there are intended to be used by the OS itself, they can all provide a valuable look into Linux’s operations.

Beginner’s Guide to Grep

There is a classic bit of computer wisdom that states “If you’ve got a problem, and decide to solve it with regular expressions, now you’ve got two problems.” This of course stems from the perception that regular expressions are a complicated mix of magic characters and Voodoo. Regular expressions can allow you to achieve elegant and concise program logic quickly and easily, but only once you’ve learned to understand how they work and why. Just about any Linux or Mac system comes with a powerful regex tool call grep and learning grep is an essential task for any power user or system administrator. Today, we’ll explore some of what you can do with grep and how it can be one of the most powerful tools in your geek arsenal.

How It Works

In short, grep’s job is to search through a block of input. That’s pretty vague, so it’s best described by example. Let’s say you’ve got a text file called distros.txt that has a list of Linux distributions, such as the one below.

Debian – Stable server distribution
Ubuntu – Desktop distro originally based on Debian
Kubuntu – Uses KDE desktop instead of Gnome
Fedora – Continuation of the free Red Hat desktop system
Gentoo – A fast, source-based Linux system for pro users
SuSE – Commercial Linux owned by Novell
Mint – Ubuntu-derived distro with additional restricted software

Grep can be used to read through the text and filter it to show only the parts you want. If you wanted to see only the lines that contain the word “Ubuntu”, you’d run the following command:

grep Ubuntu distros.txt

grep-simple

(Your version of grep may or may not include color highlighting like in the example above)

Case Sensitivity

You may have noticed that our last search did not return Kubuntu. Unless told otherwise, grep will assume that you entered your expression exactly the way you wanted it, and this applies to upper and lower case. If you search for “ubuntu” but your text file contains “Ubuntu”, your search will find nothing. To make your search case-insensitive, use the -i switch, as in

grep -i ubuntu distros.txt

grep-dashi

Whole Word

With the previous search, you included all capitalization variants of the word “Ubuntu”. It included Kubuntu because it contains the word you searched for. You may want to only include the standard version, not Kubuntu or Edubuntu, etc. If that’s the case, you can tell grep to match the whole word only by passing the -w option.

grep -i ubuntu distros.txt

grep-dashiw

Exclusion

Much as you can use grep to show only matching entries, you can also use it to show everything BUT the matching entries. To expand on our previous searches, we can now use the -v option to reverse our results and only show the lines that don’t match.

grep-exclude

Wildcards

Grep has full support for wildcards when matching patterns. When using wildcards and other special characters, you want to make sure your search pattern is in quotes, so the Linux shell doesn’t try to interpret them before grep can. Common wildcards include * for groups of characters and . to represent a single unknown character.

grep-wildcards

Ranges

If the wildcards are a little too broad for you, you can specify individual characters or a range to include in your search. Characters within square brackets will be included in your search pattern. For example, if you had a file with a list such as

Item 1 - apples
Item 2 - bananas
Item 3 - coconuts
Item 4 - peaches
Item 5 - Grapes
Item 6 - Apricot

You can choose a particular range by using something like

grep "Item [2-4]" items.txt

Grep is an immensely powerful tool, and learning it thoroughly can pay off in all kinds of ways. Understanding grep is also makes it much simpler to move on to other powerful console tools like sed and awk. Between those three tools, an amazing amount of console and script magic can be done with far less effort than seems possible. If you’re a fan of grep, or would like to see other tools like sed and awk covered here, please drop a note in the comments.

Introduction to the Nano Text Editor

Nano is an ncurses-based editor (which means it must be run from a terminal window) that focuses on simplicity. Nano is a clone of the aging Pico text editor,  the editor for the Pine email client that was very popular, back in the early ’90s, on UNIX and UNIX-like systems. Pine has now been replaced by Alpine and Pico by Nano, but some things haven’t changed — like the simplicity of editing with Nano.

Nano was first created in 1999 under the name “TIP” (a charming, recursive acronym that stands for “TIP Isn’t Pine”) by Chris Allagretta. Mr. Allagretta decided to create this clone of Pico because Pico wasn’t released under the GPL.  The name was officially changed on January 10, 2000 to alleviate confusion between the new editor and the tip command (The tip command is common in Sun Solaris).

Nano uses very simple key combinations in order to work with files. A file is either opened or started with the command:

nano FILENAME

Where FILENAME is the name of the file you want to open. Or, if you need to edit a file that only the root user has access to:

sudo nano FILENAME

When you have the file open in Nano you will notice, at the bottom of the terminal window, a short list of command key-combination examples. All key combinations for Nano start with the CTRL key. To execute a command you hold the CTRL (commonly referred to as the “Control Key”) key down and click the secondary key to perform the action. The most common key combinations for Nano are:

  • CTRL-x – Exits the editor. If you are in the middle of editing a file the exit process will ask you if you want to save your work.
  • CTRL-r –  Read a file into your current working file. This enables you to add text from another file while working from within a new file.
  • CTRL-c – Display the current cursor position.
  • CTRL-k – Cut text.
  • CTRL-u – Uncut (or Paste) text.
  • CTRL-o – Save file name and continue working.
  • CTRL-t – check the spelling of your text.
  • CTRL-w – Search your text.
  • CTRL-a – Go to the beginning of your current working line.
  • CTRL-e – Go to the end of the current working line.
  • CTRL-g – Get help with Nano.

There are plenty more commands to use in Nano. To see the command listing use the Get help command.

Installation

Not all distributions will ship with Nano pre-installed. Ubuntu, for one, does. If your distribution does not have Nano installed, fear not, you will find it in the default repositories. To install this tool all you need to do is follow these steps:

  1. Open up your Add/Remove Software utility.
  2. Search for “nano” (no quotes).
  3. Mark Nano for installation.
  4. Click Apply to install.

That’s it! Nano will now be installed. All you have to do now is open up a terminal and start editing.

Fun fact

The recursive acronym is very common within the Linux community. Although originated back in the early, often romanticized, days of the computer hacker, this type of acronym is one that humorously refers to itself. You have more than likely come across the acronym GNU in your Linux travels. Did you know that GNU stands for GNU is Not UNIX? Recursive acronym. Other fun recursive acronyms are:

  • LAME: LAME ‘AIN’T an MP3 Encoder
  • JACK: JACK Audio Connection Kit
  • LINUX: Linux Is Not UNIX
  • WINE: Wine Is Not an Emulator

You will often find Linux developers trying to create names for their applications that include recursive acronyms.

Install XOOPS for Powerful Open Source Content Management

Content is king. It always has been and always will be. It drives our businesses and motivates our customers. But when you think content management, so many tools come to mind. There’s Drupal and Joomla! for starters. Both of those tools are outstanding solutions for content management. But many organizations are projects are choosing XOOPS.

So what would make one choose XOOPS over other strategies? XOOPS offers the following features:

  • Database driven: XOOPS is powered by MySQL database.
  • Modular: Add or remove as many modules as you like.
  • User customization: Your users can edit profiles, select personal themes, upload custom avatars, and more.
  • World-wide support: Official support sites can be found all over the world (in many languages).
  • Multi-byte languages: Including Japanese, simple and traditional Chinese, Korean, and more.
  • Group permission system: Granular control over group and user permissions.
  • Skinnable interface: Over 800 themes available.

But features alone don’t always demonstrate why you should choose a particular project, especially when a feature set is matched almost feature-for-feature by other projects. If you look at sourceforge.net, you will find XOOPS one of (if not the) highest ranked CMS tool. You’ll find many reasons to select XOOPS as your CMS. Once you have made that choice, it is then time to get going on the build. You might be surprised to know that, regardless of power, XOOPS isn’t all that difficult to get up and running. In this tutorial I will lay out the steps to installing XOOPS on your already running Linux box.

It should be noted, just for clarification, that this tutorial will be using Ubuntu 9.10 as a base for installation.

Requirements

Let’s take a look at the requirements, before we begin the installation. In order to successfully install XOOPS, you will need:

  • Web server: For this install, we will use Apache. XOOPS can be installed on other platforms using other servers.
  • PHP >= 4.3.0 (5.2 recommended)
  • MySQL >= 3.23 (>= 4.1 recommeded)

Pre-flight setup

You will be using your web browser for the actual installation of XOOPS. But before you can get to that stage, there are a few steps you must take:

  1. Make sure your server is set up and running properly (with PHP and MySQL support). 
  2. Set up your database for XOOPS.
  3. Prepare the directory structure for XOOPS

Let’s tackle these steps one at a time.

Step One

If you have set up your server as a LAMP (Linux Apache MySQL PHP) server, you should be good to go. If you haven’t done so, you can do this easily on a Ubuntu machine with the command:

sudo tasksel

You will then select LAMP server and follow the simple instructions.

Step Two

The next step is to set up your database. We will create a database called “xoops” (no quotes) with the following steps:

  1. Create the database with the command: mysqladmin -u db_user -p create xoops
  2. Change to the MySQL prompt with the command: mysql -u db_user -p (Where db_user is the MySQL administrative user — usually root, unless you’ve made a change to this in order to heighten security).
  3. Grant privileges to the user on the xoops database with the command: GRANT ALL PRIVILEGES ON xoops.* TO root@localhost IDENTIFIED BY 'password'; Here password is the actual password of the database administrator.
  4. Flush all privileges with the command: flush privileges;

Step Three

Now it’s time to prepare the directory structure. The first thing you will do is download the XOOPS file from Sourceforge.  Once you have downloaded that file move the file to /var/www/. But before you unpack the file you need to consider one thing: Are you planning on having more than XOOPS served up on this server? Will you have multiple web sites here? If so you will want to contain XOOPS inside of its own directory. If not, you can unpack the XOOPS file directly into /var/www. I will go on the assumption you plan on having more than one site on your server, so we will create a container folder for XOOPS. Follow these steps:

  1. From within your terminal (and from within the /var/www directory) issue the command su mkdir XOOPS.
  2. Move the XOOPS file into the newly created XOOPS directory with the command sudo mv xoops-XXX.zip XOOPS (Where XXX is the release number).
  3. Change into the XOOPS directory with the command cd XOOPS.
  4. Unpack the XOOPS file with the command sudo unzip xoops-XXX.zip (Where XXX is the release number).

So far so good. Remember where we mentioned we were going to serve XOOPS from within its own directory? Well, as it stands, you would have to be pointing your browser to http://SERVER_ADDRESS/XOOPS/htdocs/. We want to avoid this so move into the the /var/www/XOOPS/htdocs and move the entire contents of this directory into /var/www/XOOPS. You can do this with the command sudo mv * ../. Now you can back out into /var/www/XOOPS and all of those files will be found.

You now need to create the directory /var/www/XOOPS/uploads with the command sudo mkdir /var/www/XOOPS/uploads. 

The next step is to check to see if the directory /var/www/XOOPS/xoops_data exists. If it does not, create it with the command sudo mkdir /var/www/XOOPS/xoops_data. Now you have to change some permissions. You must give the following directories/files write permission:

  • /xoops_data/configs/
  • /xoops_data/caches/
  • /xoops_data/caches/xoops_cache/
  • /xoops_data/caches/smarty_cache/
  • /xoops_data/cache/smarty_compile/
  • /var/www/XOOPS/mainfile.php

The above is done with the command chmod 777 "DIRECTORY/FILE NAME". And that is the difficult aspect of the installation. Now you only need point your browser to http://ADDRESS_TO_SERVER/XOOPS/ to begin the web-based installation.

Web install

There will be approximately fourteen screens to walk through for this installation. All of these screen will be very intuitive. The screens are:

  1. Language selection: Select the language for the installer.
  2. Introduction: Read about the installation process.
  3. Configuration check: XOOPS installer checks to see if everything is ready.
  4. Paths settings: Are all of your paths correct?
  5. Database connection: Database server settings.
  6. Database configuration: XOOPS database settings.
  7. Configuration save: Write settings to mainfile.php.
  8. Tables creation: Create tables on database.
  9. Initial settings: Admin user creation.
  10. Data insertion: Data is inserted into tables.
  11. Site configuration: Configure your site.
  12. Select theme: Choose the default theme for your site.
  13. Modules installation: Select modules to install.
  14. Welcome: Final notes.

Only a couple of these screens really need any explanation. The first is Figure 1. This is the second screen you will come across. This screen not only serves as an introduction, but also outlines everything you will need to do for the installation. There are a couple of steps I intentionally left out. Should you choose to add those steps, the instructions are fairly obvious on this screen. 

You might think the next screen(s) that would need attention would be related to the database. If you have created the database in the manner outlined above, you can accept the defaults from the screens. The only exception will be the MySQL admin password.

After the database screens (screens 5 and 6) the next screen that requires user-input is screen 9. Screen 9 requires you to fill out information for an administrator account — very simple.

The Site Configuration screen (see Figure 2) might be the next screen that could trip you up. As you can see there is a bit of pre-configured data added to each section. If your site is a public site, you will want to play close attention to the Meta Tags and Description as these can help your search rankings. You will also want to make sure Yes is selected, if you want to allow New User registration.

The next two screens (Select theme and Modules installation) are also both very intuitive. Upon installation you will only have two themes to choose from and three modules to install. You will need to download more themes and modules in order to further extend the look and functionality of your XOOPS site. You can find more modules at the XOOPS Module Repository and XOOPS themes from the XOOPS Theme Gallery.

Final thoughts

Congratulations! You now have a running XOOPS site installed and ready to go. Make sure you log in as the administrator you created in screen 9 (Initial Settings) so you can further customize your XOOPS site.

Xoops InstallationFigure 2

 

Xoops installFigure 1

Yum Cheat Sheet

Hi Folks,

Had a few “yum howto” hits on my blog according to my search results so thought I would pop up a quick and easy cheat sheet.

package = e.g. proftpd or php or httpd etc etc..

Install package:
yum install package

Update package:
yum update package

Remove package:
yum remove package

yum erase package

Search for a package:
yum search string

Search for a package by file:
yum provides file

Display package information:
yum info package

List installed packages:
yum list installed

Update package list:
yum check-update

Update everything:
yum update

List repositories:
yum repolist

Hope it helps someone.

If anyone would like to see any other commands on here leave a comment and I will update.

Best desktop for linux beginners

 

Seriously though how good is the as a reference guide 🙂

%d bloggers like this: