Archive

Archive for the ‘Uncategorized’ Category

Beginner’s Guide to Command Line: Part 1

August 9, 2008 Leave a comment

The command line interface will either be from a terminal or a SSH window like putty. Here is an example of the Gnome terminal (Applications/Accessories/Terminal from the menu). You can see that it is only text but it does have a menu system for modifying the color of the screen and text or allowing you to open multiple terminals at one time.

If you login from a putty session from a Windows machine or if you are logged into a TTY session on the Linux box you will not have the option of a terminal and so you will be using text only as there will be no menus or graphics of any kind. Text is exactly the same as you can see in the next example. The biggest difference is that it will typically be a black screen with white text.

As you change users the prompt will show the change in user as you can see from these examples:

fred@ub:~$
mary@ub:~$
tom@ub:~$
jane@ub:~$

As you change to different servers the hostname will change. The hostname is a name that is applied to a server so that users and applications may refer to the server with a name and not an IP Address. An example would be of a hostname of ub instead of the IP Address 192.168.5.43. As you connect to different servers or workstations, this name will change. These names can be anything the system administrator would like to assign.

fred@mail:~$
fred@ftp:~$
fred@ubuntuserver:~$
fred@mystuff:~$

As you change locations in the file system the location will change. The ~ symbol indicates that a user is located in their home directory. The home directory in Linux is located in a directory, Windows calls them folders, labeled /home. So if fred is in his home directory he is really located in /home/fred. Each user has a home directory named for the user. If fred changes location in the directory system to /var, his prompt will reflect that change.

fred@ub:/var$

If mary changes to the /usr/share directory it will reflect that change.

mary@ub:/usr/share$

If tom changes to the /usr/bin directory it will reflect that change.

tom@ub:/usr/bin$

And finally if jane moves to the / directory it will reflect that change.

jane@ub:/$

Changes in location in the file system will list the location in the prompt. It is important that you use this as a clue to location especially when you begin to issue commands.

Ubuntu Shines with Linux Terminal Servers

August 8, 2008 Leave a comment

One of the major projects that Ubuntu is doing right for the whole Linux world is LTSP, Linux Terminal Server Project. The focus of this project is to create low cost networks using diskless computers. A diskless computer runs without a hard drive and can be an old box that is not powerful enough to run Windows any longer but could work great for a diskless system.

Many of the significant changes are part of the hard work from the people at LTSP.org and the Ubuntu distribution. LTSP 5 took me only 45 minutes to set up. I have been building LTSP servers for schools for 8 years now so I was greatly impressed. My first install took over 100 hours. It was very ugly back in those days having to configure the XWindow for each different video card. Today it is a project that people need to give a look at because of cost savings and savings with the central management features. If you purchase LTSP ready workstations, cost is $100-$300, they are almost plug-and-play. See the links for the few steps you need to take.

LTSP would be a great option for a small company wanting to move their users to Linux because one central server can be configured to work very well for a number of desktops. The server is your major cost in this adventure because you need the RAM and CPU power for all of the desktops. A dual XEON with 4 GB of RAM can run 100 computers. That is a significant cost savings. Even if you paid $5000 for the server and $200 a piece for the pre-built workstations you end up having a major network(100 workstations) for around $30,000. That includes cables, switches, keyboards, mice and monitors. How many kids could benefit from computer access in schools? LTSP is the way to make it happen fast.

Related Links
LTSP Set Up on Ubuntu 8.04
LTSP Client
Managing Users in LTSP
Samba with LTSP on Ubuntu 8.04
Troubleshooting LTSP
UFW Firewall for LTSP

LTSP works so well because the whole operating system is transferred over the network to the diskless workstation.

Notable Changes in LTSP 5

There are several significant changes in LTSP 5 which make the system much more usable. You will get enhanced security as now the GUI is exported using ssh -X and not the old XDMCP. SSH offers encryption of course which is actually faster and safer. The remote connection is made with LDM a python application that connects using SSH and not the old KDM or GDM. NFS has been dropped and replaced with NBD. NBD or Network Block Device is a network block device which emulates a block device like a hard drive over the network. This allows you to either use this space as swap or use it as network diskspace.

How to Automate an Action to Occur Only One Time

August 2, 2008 Leave a comment

The at command will run a script at a specified time. The command is used by typing at and then the time you want the activity to occur. This will create the at> prompt enabling you to enter the commands you desire to run. When you are done press Control+D.
Here is the basic format for an at command:

at [-c | -k | -s] [-f filename] [-q queuename] [-m] -t time [date] [-l] [-r]

[-c | -k | -s] — refers to the shell you are using C, Korn or Bourne

-f filename

You could create a file that would be run by at. For example a bash shell script.

-m send mail to the user when it is complete sent by default with /usr/sbin/sendmail

-d this is an alias for atrm which will delete at jobs

-v shows the time a job will be executed

-c cats job to standard output

-t set a time for job to run ([[CC]YY]MMDDhhmm)

-q queue The a queue is reserved for at and the b queue is reserved for batch. If you add a queue then that queue will increase in niceness, which means it will have less priority.

-V prints version number

Who can use at is controlled by /etc/at.allow and /etc/at.deny

If at.allow exists, only those in allow can use it. If at.deny exists and allow does not then everyone not in deny can use it. If neither exist only root can use it.

HH:MM format
MMDDYY, MM/DD/YY, or MM.DD.YY formats
now + time the current time is in minutes, hours, days, or weeks. For example, now + 3 days

atq to view pending jobs

Here is an Example:
at 5:32am
at> touch mkdir test
at> Contol+D

Unlike cron, these jobs will only run once.

Options
-l list jobs
-d jobnumber delete a job
This example shows that the user root has two jobs waiting.

at -l
2 2005-09-11 09:07 a root
at -d job1
This will delete job1.

Practice Lab: Using at

This is simply an easy practice exercise to get familiar with at.
In order to get at to work the first thing you need to do is enter at in the terminal with a time:

at 11:00

Once you do this an at> will be shown on the screen. This is where you will enter your command. So if you wanted to create a directory called test in the /root directory enter this information for the command:

at> mkdir /test

When you hit enter the at> will show up again waiting for a second command you may want to provide. But if you are only doing one command the next thing you do is hit CTRL+D. This will install the at command you did and initiate the command.

Once you do CTRL+D it will list your job or jobs that are currently waiting
to happen. It will all look like this:

at 10:35
at> mkdir /root/test
at>
job 1 at 2006-09-02 10:35

Now check to see if the /test directory was created.

Categories: Uncategorized Tags: ,

How to Pause Downloads in Firefox

Pausing downloads can be important if you’d like to start a download, close Firefox, and come back to the download at a later time. To do this simply open up Firefox and find a file you’d like to download.

After selecting Save File your download will begin to download automatically. Here we can see the status of the download along with two icons to the right of the status bar. The first one is a pause icon and the second a stop sign. Press the pause icon to pause your download and come back to it later. Press the stop icon to completely stop the download.

After pressing the pause icon you will see that the download status stands still. The pause icon is now a play icon and clicking it will begin the download right where you left off.

This screen shot shows the download completed successfully.

How to Create an Internet Radio Station

July 30, 2008 10 comments

This tutorial will help you set up an Internet Radio station on your server. You can create the content and then provide it for your listeners. The example uses an Ubuntu server for the set up.

Step #1: Download the Shoutcast Server (latest version):

http://www.shoutcast.com/download/files.phtml

Copy it to the /usr directory and create a folder called shout:

sudo cp sc_serv_1.9.8_Linux.tar.gz

sudo mkdir shout

cd /usr/shout

tar zxvf sc_serv_1.9.8_Linux.tar.gz

chmod 755 sc_serv

Edit the config File:
vim sc_serv.conf

Password=MakeANewPassword
Be sure you document your password for the furture.

Start the Server:

./sc_serv

You should see that it is running.

Step #2: Create a way to feed Music Into the Server
This will use ices0.4 so you will be able to use mp3s.

http://downloads.us.xiph.org/releases/ices/ices-0.4.tar.gz

Save the file to the /usr directory.

tar -zxvf ices-0.4.tar.gz

This will create a folder called ices-0.4. Move into this folder.

cd ices-0.4

Make sure your /etc/apt/sources.lst has these sources as you will need them to download the files you need. Use all of the usual sources but be sure these three are included so you can draw from them.

backports main restricted universe multiverse
partner
free non-free

sudo apt-get update

sudo apt-get install libshout3 libshout3-dev liblame-dev libxml-dev

Make sure you have a compiler.

sudo apt-get install gcc g++ make

Compile ices
Move into the directory that you created.

cd /usr/ices-0.4

./configure –with-lame

If you do not have errors then continue, if you do have errors then download the needed dependencies.

make

sudo make install

Step #3: Create a mp3 Directory
You can create the directory anywhere but one good location might be /mp3.

sudo mkdir /mp3

Copy your mp3s into that location.

find /mp3 -type f -name “*.mp3” > /mp3/playlist.txt

Now edit your config file for ices.

sudo vim /usr/local/etc/ices.conf.dist

Change the Playlist to /mp3

Change the Hostname

Change the Password

Change Protocol to icy

ices -c /usr/local/etc/ices.conf.dist

Typically the port to connect to the radio station is port 8000 but you can change that in the config.

Desktop Virus Scanner for Ubuntu

July 22, 2008 3 comments

The first question you may ask is why a virus scanner for Linux? Well, the level of sharing that is done between Windows computers and Linux computers suggests that it may be a nice option to be able to scan files and directories to protect your Windows machines. In addition, if you are using Wine to run Windows computers you will need to verify that those files are not infected. Who knows, there may be a time when Linux is also dealing with virus activity as well, yes I know there are a few active Linux viruses now.

I found this easy to install and use graphical tool that many will like, called clamtk.

In order to install ClamTK in Ubuntu 8.04 open Synaptic Package Manager and search for clamav. Once you have a list install these programs:

clamtk
clamav
clamav-base
clamav-daemon
clamav-freshclam

Here are some quick ways to scan with various options.

Type of Scan Command
Scan a File Ctrl+F
Quick Home Scan Ctrl+Q
Full Home Scan Ctrl+Z
Scan a Directory Ctrl+D
Recursive Scan Ctrl+R

Your virus signatures automatically update every hour…nice feature.

Categories: Uncategorized Tags: , , ,

PolicyKit Solutions with Ubuntu 8.04

July 12, 2008 8 comments

Imagine my joy, when having just install all of the updates for Ubuntu 8.04, and finding that I have lost my network connection because the hardware access layer, hal, has failed. Not only that, I now have no access to the administration tools as the PolicyKit will not allow the Unlock process on any administrative tools, including my network connection. This is a total show stopper….no network connection, no permissions to change the no network connections!!!

Here is the Error after an Update:
Setting up hal (0.5.11~rc2-1ubuntu8.1) …
* Reloading system message bus config… [ OK ]
polkit-read-auth-helper: needs to be setgid polkituser
polkit-auth: NotAuthorizedToReadAuthorizationsForOtherUsers: uid 0 is not authorized to read authorizations for uid 111 (requires org.freedesktop.policykit.read)
polkit-read-auth-helper: needs to be setgid polkituser
polkit-auth: NotAuthorizedToReadAuthorizationsForOtherUsers: uid 0 is not authorized to read authorizations for uid 111 (requires org.freedesktop.policykit.read)
dpkg: error processing hal (–configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
hal
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here is how I fixed it.

First…panic…this is a disaster, but it can be fixed.

Second…create a network connection.
You desperately need a network connection in order to fix this. Configure your network interface with a static IP Address as my problem was that it would no longer accept an IP supplied by DHCP.

sudo vim /etc/network/interfaces

iface eth0 inet static
address 192.168.5.2
netmask 255.255.255.0
gateway 192.168.5.1

auto eth0

Make sure you enter the information for your network. You also need to enter the gateway IP or internal IP Address of your router. Save your configuration and then restart your network with this command:

sudo /etc/init.d/networking restart

This should provide you with a network connection. It will allow you the ability to do research and download any updates that you might need.

Third…reinstall PolicyKit.
You can see from the information below that this is for PolicyKit .7-2. Before you make any changes verify that this is the version you are having problems with.

sudo dpkg -l policykit*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii policykit 0.7-2ubuntu7 framework for managing administrative polici
ii policykit-gnom 0.7-2ubuntu1.1 GNOME dialogs for PolicyKit

Now reinstall PolicyKit

apt-get install –reinstall policykit

Fourth…reinstall hal.

apt-get install –reinstall hal
Reading package lists… Done
Building dependency tree
Reading state information… Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0B/420kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database … 118858 files and directories currently installed.)
Preparing to replace hal 0.5.11~rc2-1ubuntu8.1 (using …/hal_0.5.11~rc2-1ubuntu8.1_i386.deb) …
* Stopping Hardware abstraction layer hald [ OK ]
Unpacking replacement hal …
Setting up hal (0.5.11~rc2-1ubuntu8.1) …
* Reloading system message bus config… [ OK ]
* Starting Hardware abstraction layer hald [ OK ]

Fifth….Restart Your System.
That should do it….just another fix.

Categories: Uncategorized
Follow

Get every new post delivered to your Inbox.

Join 58 other followers