Κυριακή 11 Νοεμβρίου 2007

Sudo and gksudo

If you've used Linux for any amount of time, you might be used to running programs as root directly whenever you need to install packages, modify your system's configuration, and so on. Ubuntu employs a different model, however. The Ubuntu installer doesn't set up a root user -- a root account still exists, but it's set with a random password. Users are meant to do administration tasks using sudo and gksudo.

You probably already know how to use sudo -- just run sudo commandname . But what about running GUI apps that you want to run as root (or another user)? Simple -- use gksudo instead of sudo. For instance, if you'd like to run Ethereal as root, just pop open a run dialog box (Alt-F2) and use gksudo ethereal.

By the way, if you really must do work as root, you can use sudo su -, which will log you in as root. If you really, really want to have a root password that you know, so that you can log in as root directly (i.e., without using sudo), then run passwd when logged in as root, and set the password to whatever you want. I'd recommend using the pwgen package to create a secure password not only for root but for all your user accounts.

Ubuntu Related Books

If you are ubuntu user and if you are looking for some ubuntu related books for free check this

Book Title: Moving to Ubuntu Linux By Marcel Gagné

Publisher: Addison Wesley Professional

Brief Introduction

Discover Ubuntu, Today’s Hottest Linux

Everyone’s talking about Ubuntuit’s not just 100% free, it’s the most useful, practical desktop Linux ever! Now, Linux expert Marcel Gagné reveals Ubuntu’s amazing power and helps you migrate from Windows faster than you ever thought possible.

Moving to Ubuntu Linux will teach you how to do virtually anything with Ubuntuwrite documents, create spreadsheets, surf the Web, use email, listen to music, watch movies, and play games.

Install Ubuntu fast, with easy, step-by-step instructions

Take control, with the GNOME desktop environment and Nautilus file manager

Browse the Internet using Firefox, the powerful browser that’s quickly replacing Microsoft Internet Explorer

Find and install all the software you’ll ever need, with Ubuntu’s powerful Synaptic package manager

Send email, track contacts, create calendars, and manage all your personal information with Evolution

Organize digital photos, rip music, burn and play CDs, watch movies, create graphics, and more

Discover the world of Linux games, and learn how to run Windows games on your Ubuntu PC

Set up an efficient, convenient network for your home or small business

Customize your desktop so it’s perfectly comfortable and totally efficient

Free E-Book Check here

Book Title: The Official Ubuntu Book By Benjamin Mako Hill, Jono Bacon, Corey Burger, Jonathan Jesse, Ivan Krstic

Publisher: Prentice Hall

Brief Introduction

Ubuntu is a complete, free operating system that emphasizes community, support, and ease of use while refusing to compromise on speed, power, and flexibility. It’s Linux for human beings–designed for everyone from computer novices to experts. Ubuntu is the most in-demand Linux distribution, and this official guide will get you up and running quickly.

Learn how to seamlessly install and customize Ubuntu for your home or small businesses. Its open source power can be used in schools, government, or by corporations, and is suitable for both desktop and server use. The Ubuntu community is built on the premise that software should be available free of charge, and that people should have the freedom to customize and alter their software in whatever way they see fit.

Written by leading Ubuntu community members, this is the only book that you need to become a savvy Ubuntu user.

Covers the latest version of Ubuntu–Ubuntu 6.06LTS

Covers every standard desktop application from word processing, spreadsheets, Web browsing, e-mail, instant messaging, music, video, and, of course, games, all the way to software development, databases, and other server applications

Includes real-world troubleshooting advice contributed by Ubuntu users from around the world

Learn about the extended Ubuntu community, which includes translators; software developers; teachers; people who love to hand out CDs and help friends try free software; artists; people who write documentation, tips, and guides; accountants; and even a lawyer or two.

Covers both Ubuntu and Kubuntu desktop systems

Explains Ubuntu Server installation and basic administration, complete with advanced installer features like LVM and RAID

This book comes with a version of Ubuntu that can run right off the DVD, as well as the complete set of supported packages for Ubuntu, including Kubuntu. Try out Ubuntu on the DVD. If you want to keep it, install it directly from your desktop.

Free E-Book Check here

Book title: Ubuntu Hacks By Bill Childers, Jonathan Oxer, Kyle Rankin

Publisher: O’Reilly

Brief Introduction

The Ubuntu distribution simplifies Linux by providing a sensible collection of applications, an easy-to-use package manager, and lots of fine-tuning, which make it possibly the best Linux for desktops and laptops. Readers of both Linux Journal and TUX Magazine confirmed this by voting Ubuntu as the best Linux distribution in each publication’s 2005 Readers Choice Awards. None of that simplification, however, makes Ubuntu any less fun if you’re a hacker or a power user.

Like all books in the “Hacks” series, Ubuntu Hacks includes 100 quick tips and tricks for all users of all technical levels. Beginners will appreciate the installation advice and tips on getting the most out of the free applications packaged with Ubuntu, while intermediate and advanced readers will learn the ins-and-outs of power management, wireless roaming, 3D video acceleration, server configuration, and much more.

Free E-Book Check here

Book Title : Ubuntu Unleashed By Andrew Hudson, Paul Hudson

Publisher: Sams

Brief Introduction

Incorporating an advanced approach to presenting information about Ubuntu, Ubuntu Unleashed aims to provide the best and latest information that intermediate to advanced Linux users need to know about installation, configuration, system administration, server operations, and security. Written by renowned open source authors, Paul and Andrew Hudson, it includes detailed information on hot topics in Ubuntu Linux, such as wireless networks, and programming in PHP, Perl and others. It thoroughly covers all of Ubuntu’s software packages, including up-to-date material on new applications, Web development, peripherals, and programming languages. It also includes updated discussion of the architecture of the Linux kernel 2.6, USB, KDE, GNOME, Broadband access issues, routing, gateways, firewalls, disk tuning, GCC, Perl, Python, printing services (CUPS), and security. The included DVD comes with a complete Ubuntu Linux distribution.

Free E-Book Check here

Howto Setup Bluetooth Keyboard and Mouse in Ubuntu

If you have a Bluetooth Keyboard and Mouse here is the procedure to follow howto setup in ubuntu

We need the MAC address (e.g. 00:00:00:00:00) of the mouse and keyboard.You can use KEYBOARD_ADDR and MOUSE_ADDR where you should find the addresses for the keyboard and mouse respectively. Press the button on the mouse that makes it visible to be found by the computer. Do the same for the keyboard. Now open a terminal window and run the following command

hcitool scan

Scanning …
KEYBOARD_ADDR Microsoft Wireless Keyboard
MOUSE_ADDR Microsoft Mouse

Adding the Keyboard and Mouse

Now we need to add the keyboard and mouse to the bluetooth configuration files. Run the following command to pop up GEdit

sudo gedit /etc/bluetooth/hcid.conf

You may be asked for your password, this is because we used sudo.

At the end of the file, add the following (replacing KEYBOARD_ADDR and MOUSE_ADDR for the keyboard and mouse MAC addresses as found earlier)

device KEYBOARD_ADDR {
name “Microsoft Wireless Keyboard”;
auth enable;
encrypt enable;
}

device MOUSE_ADDR {
name “Microsoft Mouse”;
}

Now you need to restart the bluetooth subsystem so that it refreshes it’s configuration file.

sudo /etc/init.d/bluez-utils restart

* Restarting Bluetooth services… [ ok ]

Pairing the Devices

You now need to pair the devices with the computer. Do not press any buttons on the keyboard as we’ll need to use it to enter a passcode so we can pair. Run the following command

sudo hidd --search

Searching …
Connecting to device MOUSE_ADDR
Connecting to device KEYBOARD_ADDR

They could pair with the computer in any order, you will need to remember which one is the keyboard. As soon as Connecting to device KEYBOARD_ADDR appears you must enter a PIN code into the keyboard. It must consist of numbers not using the numpad, somewhere between 4 and 8 should be fine. Type this number in to the keyboard and press Return.

A window should pop up on your computer asking you for the number you just entered on the keyboard.

You should now be set up. The devices should automatically reconnect when they go to sleep and when your computer boots up.

Troubleshooting

If you have followed all the steps above and you find your mouse or keyboard don’t automatically reconnect, we can fix it. Run the following command in a terminal

sudo gedit /etc/default/bluez-utils

Find the following lines

HIDD_ENABLED=0
HIDD_OPTIONS=”…”

Change them to

HIDD_ENABLED=1
HIDD_OPTIONS=”--master --connect KEYBOARD_ADDR --connect MOUSE_ADDR --server

Now reboot and hopefully they’ll automatically connect (give them a few seconds to connect after you move the mouse/press a key)

Numlock activate at startup in login screen

It is very annoying that the numlock is not activated at startup in the login screen GDM, especially when using a password that contains numbers.

Make sure that the universe repository is enabled.

Execute the following commands in a terminal

sudo apt-get install numlockx

sudo gedit /etc/X11/gdm/Init/Default

Add the following lines at the end before the line “exit 0″:

if [ -x /usr/bin/X11/numlockx ]; then
/usr/bin/X11/numlockx on
fi

Put off your numlock and restart X by pressing Ctrl+Alt+Backspace

The numlock should be activated now and every time when you reboot

How-To Recover password under Ubuntu

If you forgot you password for your ubuntu system you can recover using the following steps

Turn your computer on.

Press ESC at the grub prompt.

Press e for edit.

Highlight the line that begins kernel ………, press e

Go to the very end of the line, add rw init=/bin/bash

press enter, then press b to boot your system.

Your system will boot up to a passwordless root shell.

Type in passwd username

Set your password.

Type in reboot