span.fullpost {display:none;}
Showing posts with label Ubuntu Tutorials. Show all posts
Showing posts with label Ubuntu Tutorials. Show all posts

Tuesday, May 18, 2010

Install Ubuntu Netbook Edition with Wubi

Netbooks, along with the growing number of thin, full powered laptops, lack a CD/DVD drive. Installing software isn’t much of a problem since most programs, whether free or for-pay, are available for download. Operating systems, however, are usually installed from a disk. You can easily install Windows 7 from a flash drive with our tutorial, but installing Ubuntu from a USB flash drive is more complicated. However, using Wubi, a Windows installer for Ubuntu, you can easily install it directly on your netbook and even uninstall it with only a few clicks.

Download and run the Wubi installer for Ubuntu (link below). In the installer, select the drive you where you wish to install Ubuntu, the size of the installation (this is the amount dedicated to Ubuntu; under 20Gb should be fine), language, username, and desired password. Also, from the Desktop environment menu, select Ubuntu Netbook to install the netbook edition. Click Install when your settings are correct.


Wubi will automatically download the selected version of Ubuntu and install it on your computer....

Read The Full Article HERE


Read more!

Wednesday, July 23, 2008

Check your Disk Usage on Ubuntu from the command line

Ubuntu Linux, like all unix varieties, includes the du command line utility. du stands for Disk Usage, as I'm sure you assumed.

Go ahead, just type the command in your home directory :

deadmix@ubuntu-desktop:~$ du
8 ./.gconf/desktop/gnome/accessibility/keyboard
12 ./.gconf/desktop/gnome/accessibility
8 ./.gconf/desktop/gnome/screen/default/0
12 ./.gconf/desktop/gnome/screen/default
16 ./.gconf/desktop/gnome/screen
8 ./.gconf/desktop/gnome/font_rendering
40 ./.gconf/desktop/gnome
44 ./.gconf/desktop
8 ./.gconf/apps/panel/applets/clock_screen0/prefs
16 ./.gconf/apps/panel/applets/clock_screen0
8 ./.gconf/apps/panel/applets/trashapplet_screen0
8 ./.gconf/apps/panel/applets/workspace_switcher_screen0/prefs
16 ./.gconf/apps/panel/applets/workspace_switcher_screen0


It shows you a very verbose output by default, which isn't always extremely useful. Thankfully it also includes a lot of extra options.

To find the total size of files and folders in our current directory, listed by MB:

deadmix@ubuntu-desktop:~$ du -s -m *
1 Desktop
0 Examples
17 VMwareTools-5.5.2.tar.gz


Now we are getting somewhere. That's some pretty useful output.


Read more!

Monday, July 21, 2008

Change your Network Card MAC Address on Ubuntu

There are a lot of reasons you might want to manually set your MAC address for your network card. I won't ask you what your reason is.

To change this setting, we'll need to edit the /etc/network/interfaces file. You can choose to use a different editor if you'd like.


sudo gedit /etc/network/interfaces

You should see the line for your network interface, which is usually eth0. If you have dhcp enabled, it will look like this:

auto eth0
iface eth0 inet dhcp


Just add another line below it to make it look something like this:

auto eth0
iface eth0 inet dhcp
hwaddress ether 01:02:03:04:05:06


Obviously you would want to choose something else for the MAC address, but it needs to be in the same format.

sudo /etc/init.d/networking restart

You will need to restart networking or reboot to take effect.


Read more!

Change the GRUB Menu Timeout on Ubuntu

When your Ubuntu system boots, you will see the GRUB menu if you hit the Esc key, or if you've enabled the menu to show by default. The only issue with this is that the default timeout is only 3 seconds. You may want to increase this amount… or you may even want to decrease it. Either one is simple.
Open up the /boot/grub/menu.lst file in your favorite text editor.

We'r using Gedit :

sudo gedit /boot/grub/menu.lst

Now find the section that looks like this:

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3


The timeout value is in seconds. Save the file, and when you reboot you will have that many seconds to choose the menu item you want.


Read more!

Show the GRUB Menu by Default on Ubuntu

When Ubuntu boots, you normally briefly see a screen that says "GRUB loading. please wait… Press Esc to enter the menu…"
If you are hacking around your system and would prefer to always see the GRUB menu (to enter command-line options, for instance), there's an easy fix.

Open up the /boot/grub/menu.lst file in your favorite text editor.

We'r using gedit:
sudo gedit /boot/grub/menu.lst

Now find the section that looks like this:
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu


Put a # before hiddenmenu to comment that line out:
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu


Save the file, and you should see the menu the next time you reboot.


Read more!

Wednesday, July 16, 2008

Mounting Windows Partitions in Ubuntu

Unmount the partition
If you already have your Windows partitions mounted (but with the wrong permissions), unmount them before beginning these instructions. For example, if your Windows partition is mounted as /media/hda1, then open up a terminal and type
sudo umount /media/hda1

Examine the partition table
The first thing we need to do is figure out where the Windows partitions are in the partition table. Typing
sudo fdisk -l

will tell you the location and the filesystem type (FAT32 or NTFS). For example, my sudo fdisk -llooks like this:

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 1911 15350076 7 HPFS/NTFS
/dev/hda2 1912 19457 140938245 5 Extended
/dev/hda5 1912 14716 102856131 83 Linux
/dev/hda6 14717 17278 20579233+ 83 Linux
/dev/hda7 17279 17404 1012063+ 82 Linux swap / Solaris
/dev/hda8 17405 19457 16490691 83 Linux


From this, I can see that my Windows partition is type NTFS and is located at /dev/hda1.

Create a mount point
The next thing I need to do is create a mount point. This mount point may already exist as /media/hda1, but I like creating a separate directory altogether:
sudo mkdir /windows

Edit the /etc/fstab file
Now, we need to edit the /etc/fstab file to make the Windows partition mount with the proper permissions (NTFS is read-only in Ubuntu). First, let's make a back-up copy of the /etc/fstab file:
sudo cp /etc/fstab /etc/fstab_backup

Next, let's edit the fstab file:
sudo nano /etc/fstab

This is what it might look like before we change it:

proc /proc proc defaults 0 0
/dev/hda6 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 /home ext3 defaults 0 2
/dev/hda1 /media/hda1 ntfs defaults 0 0
/dev/hda7 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/hdd /media/cdrom1 udf,iso9660 user,noauto 0 0


Note: Starting with Edgy Eft (Ubuntu 6.10), the appearance of the /etc/fstab file has changed a bit, but the principle still remains. Instead of looking like this:
/dev/hda1 /media/hda1 ntfs defaults 0 0

This is what it should look like after we change it:

proc /proc proc defaults 0 0
/dev/hda6 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 /home ext3 defaults 0 2
/dev/hda1 /windows ntfs nls=utf8,umask=0222 0 0
/dev/hda7 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/hdd /media/cdrom1 udf,iso9660 user,noauto 0 0


For FAT32 (instead of NTFS)
If we also had a FAT32 partition, say at /dev/hdb1, we would unmount it and create a new mount directory for it:
sudo umount /dev/hdb1
sudo mkdir /fat_files


Then we would add in a line so that our final /etc/fstab would look like this:

proc /proc proc defaults 0 0
/dev/hda6 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 /home ext3 defaults 0 2
/dev/hda1 /windows ntfs nls=utf8,umask=0222 0 0
/dev/hdb1 /fat_files vfat iocharset=utf8,umask=000 0 0
/dev/hda7 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/hdd /media/cdrom1 udf,iso9660 user,noauto 0 0


Save changes
When you're done editing the /etc/fstab file, save (Control-X), confirm (y), and exit (Enter).
Finally, we'd remount them both:
sudo mount -a

If, for some reason, that doesn't work, try rebooting the computer.

Enable read/write for NTFS
If you're using Ubuntu 7.04 (or newer) and want to enable read/write permissions (not just read-only, as the instructions above will give you) for an NTFS partition, follow these directions
Windows NTFS Partitions Read/write support made easy in Ubuntu Feisty

If you're using Ubuntu 6.10 (or older) and want to enabled read/write permissions for NTFS, follow these instructions:
HOWTO: NTFS with read/write support using ntfs-3g (easy method)


Read more!

How to install Nvidia drivers in Ubuntu

Ubuntu doesn't include Nvidia drivers in a default installation for a number of reasons. You can read more about Ubuntu's philosophical approach to free and non-free (think freedom, not cost) software and firmware in Mark Shuttleworth's blog. Mark Shuttleworth is Ubuntu's founder and currently its primary funder. New users tend to favor immediate functionality over long-term ideological gains, so if you have an Nvidia graphics card, you may want to install the Nvidia drivers for it.
Note: These instructions are for Ubuntu 7.04 or later. If you're using 6.10 or earlier, follow these instructions to install Nvidia drivers.

image

First, go to System > Administration > Hardware Drivers

image
You'll then see that Nvidia drivers are not in use. Check (or tick) the box underneath Enabled to enable the drivers

image

You'll then be asked (after a brief explanation about desktop effects) if you want to enable the driver. Click Enable Driver.

image
Wait for the installer file to download

image
Wait for the drivers to be installed.

image
Then, click Close once the changes have been applied.

image
You'll then see that the drivers are enabled and will be available for use upon a reboot


Read more!

Howto Setup advanced TFTP server in Ubuntu

atftp is Multi-threaded TFTP server implementing all options (option extension and multicast) as specified in RFC1350, RFC2090, RFC2347, RFC2348 and RFC2349. Atftpd also supports multicast protocol known as mtftp, defined in the PXE specification. The server supports being started from inetd as well as in daemon mode using init scripts.
Install atftp Server in Ubuntu
sudo aptitude install atftpd

This will complete the installation By default atftpd server starts using inetd so we need to tell atftpd to run as a server directly, not through inetd.Edit /etc/default/atftpd file using the following command

sudo gedit /etc/default/atftpd

Change the following line

USE_INETD=true

to

USE_INETD=false

save and exit the file

Now you need to run the following command

sudo invoke-rc.d atftpd start

Configuring atftpd

First you need to create a directory where you can place the files

sudo mkdir /tftpboot

sudo chmod -R 777 /tftpboot

sudo chown -R nobody /tftpboot

sudo /etc/init.d/atftpd restart

Security configuration for atftp

Some level of security can be gained using atftp libwrap support. Adding proper entry to /etc/hosts.allow and /etc/hosts.deny will restrict access to trusted hosts. Daemon name to use in these files is in.tftpd.

/etc/hosts.allow /etc/hosts.deny

in.tftpd : FQD or IP

atftp client installation

Advance Trivial file transfer protocol client,atftp is the user interface to the Internet ATFTP (Advanced Trivial File Transfer Protocol), which allows users to transfer files to and from a remote machine. The remote host may be specified on the command line, in which case atftp uses host as the default host for future transfers.

sudo aptitude install atftp

That’s it you are ready to transfer your files using tftp clients

Testing tftp server

Tranfering file hda.txt from 192.168.1.100 (Client using tftp) to 192.168.1.2 (Server 192.168.1.100). Get an example file to transfer (eg. hda.txt)

touch /tftpboot/hda.txt

chmod 777 /tftpboot/hda.txt

ls -l /tftpboot/

total 0
-rwxrwxrwx 1 ruchi ruchi 223 hda.txt

atftp 192.168.1.2

atftp> put hda.txt

Sent 722 bytes in 0.0 seconds

atftp> quit

ls -l /tftpboot/

total 4
-rwxrwxrwx 1 ruchi ruchi 707 2008-07-07 23:07 hda.txt


Read more!

Tuesday, July 8, 2008

Change the DHCP IP Address Range for VMware NAT

VMware Workstation includes a network utility that allows you to manage the virtual networks. Typically virtual machines will use NAT (Network Address Translation) to automatically assign a virtual IP address that hides behind your host address, but the default range of 192.168.200.0/24 may not work for everybody.

You can change this address range to anything you like easily. Note that you should not have virtual machines running during this.

First open the Manage Virtual Networks start menu item :


Click the Host Virtual Network Mapping tab, and then click the arrow button next to the VMnet8 dropdown box. VMnet8 is the default NAT adapter for VMware.


Choose the Subnet option, and you will see a dialog where you can change the network range:


Once you have changed the network here, you can click the OK or Apply buttons, and after a few seconds it will update.


Read more!

Change the Default Editor From Nano on Ubuntu Linux

Many of the utilities in Ubuntu Linux use a text editor to allow you to edit configuration options and files. An example of this is using the crontab command, which allows you to edit your cron jobs using the default editor.

It's really easy to set the default editor using the update-alternatives command.

Open up a terminal window and type in the following command:

sudo update-alternatives –config editor

Here's an example of what you'll see:

$ sudo update-alternatives –config editor

There are 5 alternatives which provide `editor'.
Selection Alternative
———————————————–
1 /usr/bin/vim
2 /bin/ed
*+ 3 /bin/nano
4 /usr/bin/vim.basic
5 /usr/bin/vim.tiny
Press enter to keep the default[*], or type selection number:


You can select the editor you want by just typing in the number. For example, if I want to change the default editor to vim, I would just hit the number 1.

You can test this out by typing in crontab -e to edit your cron file. You should see the editor that you chose, instead of the default.


Read more!

Change SSH Welcome Banner on Ubuntu

Every time I connect to my Ubuntu development server through my ssh client, I receive the same message and I'm getting tired of seeing it, so I decided to change the message to something else.

Here's the message that I get every time:

Linux superfast 2.6.20-16-generic #2 SMP Thu Jun 7 19:00:28 UTC 2007 x86_64

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

Last login: Tue Jul 09 01:05:46 2008 from ipaddress removed

root@superfast:~$


Changing this message requires editing two different files. The first three sections can be modified by editing the following file:

/etc/motd

This file contains the linux build number as well as the Ubuntu warranty message. I don't find this particularly useful, so I removed all of it and replaced it with my own message.

To disable the last login message (which I don't recommend doing), you will need to edit the following file in sudo mode:

/etc/ssh/sshd_config

Find this line in the file and change the yes to no as shown:

PrintLastLog no

Now when you login, you'll get a blank prompt, although I wouldn't necessarily recommend it because it's useful to see the last login to the system for security reasons. This is my prompt now:

This is a superfast system. Please max out the cpu accordingly.

Last login: Mon Aug 13 01:24:14 2007 from ipaddress removed
root@superfast:~$


Linux is really great.



Read more!

Assign a Hotkey to Open a Terminal Window in Ubuntu

Since we spend so much time at the command line in Ubuntu, it sometimes makes it simpler to launch a new terminal window with a shortcut key.

Ubuntu has a built-in utility for assigning shortcut keys. Go to System \ Preferences \ Keyboard Shortcuts:


Scroll down to where it says "Run a terminal", and click in the Shortcut column. When you see "New accelerator…", the next keystroke that you use will set the keyboard shortcut.

I assigned Ctrl+Alt+X as mine…. one press of the key combination and up pops a terminal. What a time saver!


Read more!

Allow Remote Control To Your Desktop On Ubuntu

Enabling remote desktop mode is extremely easy on Ubuntu since Dapper. You can allow other users to access your desktop using the VNC Viewer utility that is bundled with Ubuntu, or offered as a free download for Windows.

Note that enabling remote control of your desktop is never a safe thing to do unless you have a firewall installed and configured correctly, and even then is still a potential security problem. Now that you've been warned of the risks, let's move on.

Navigate to the System \ Preferences \ Remote Desktop on the Gnome top menu.

You'll see this window:


The first two checkboxes need to be checked in order for remote desktop to be enabled.

The Security section is important: If you select the "Ask you for confirmation" code, then you will need to be at the computer in order to allow the other person to access your desktop. If you are trying to remotely access one of your own computers, you will want to uncheck this box.

The second checkbox should always be checked, and you should enter a secure password. You will be prompted for this password when you try to log on.

Tested on: Ubuntu Dapper Drake, Ubuntu Edgy Eft


Read more!

Adding extra Repositories on Ubuntu

Repositories on Ubuntu are the locations that you can download software from. As a general rule, the default repositories don't contain the right locations for most software packages that you'll want to install. You will want to open up the /etc/apt/sources.list file, find and uncomment the following lines

deb http://us.archive.ubuntu.com/ubuntu dapper universe main restricted universe

deb http://security.ubuntu.com/ubuntu dapper-security universe


Note that if you are using a different version than Dapper Drake (6.06), you will probably see a different name there, something like breezy or edgy.

Once you are done adding the repositories, you'll need to run this command:

sudo apt-get update


Read more!

Add the Trash Can Icon to Your Ubuntu Desktop

Ubuntu has an option for adding a Trash Can icon to the desktop, which might be a comfort for those of you migrating from Windows.

Just type gconf-editor into the Alt+F2 run dialog to open the Gnome Configuration Editor.


Now browse down to the following key:

apps \ nautilus \ desktop


On the right hand side, you'll see an entry called trash_icon_visible. Just check the box. You can also change the trash_icon_name if you'd like.



And there's the icon.


Read more!

Add Sudo to Your Last Bash Command With "!!" Syntax

How often have you typed in a command in your linux shell, and then realized that you forgot to type sudo, so you end up with an error or editing the dreaded read-only file? This happens to me much more than I'd like to admit, so I'm writing about it.
You have a couple of options, the easiest one is to just use !! to tell bash to use the last command.

For instance, if you tried to type this, you'd get an error that you are editing a read-only file:

vi /etc/apt/sources.list

Once that happens, then you can just use this command:

sudo !!

Which bash will then expand into this command:

sudo vi /etc/apt/sources.list

An alternative method would be to just hit the up arrow key, hit either the Home key or Ctrl+A, and then type sudo.


Read more!

Add a User on Ubuntu Server

Ubuntu Server is like any Linux variety, and has full multi-user capabilities, and a common task on any server is adding users.

useradd

The useradd command will let you add a new user easily from the command line:

useradd

This command adds the user, but without any extra options your user won't have a password or a home directory.

You can use the -d option to set the home directory for the user. The -m option will force useradd to create the home directory. We'll try creating a user account with those options, and then use the passwd command to set the password for the account. You can alternatively set a password using -p on the useradd command, but I prefer to set the password using passwd.

sudo useradd -d /home/testuser -m testuser

sudo passwd testuser

This will create the user named testuser and give them their own home directory in /home/testuser. The files in the new home directory are copied from the /etc/skel folder, which contains default home directory files. If you wanted to set default values for your users, you would do so by modifying or adding files in that directory. If we take a look at the new home directory for the user:

root@ubuntuServ:/etc/skel$ ls -la /home/testuser
total 20
drwxr-xr-x 2 testuser testuser 4096 2006-12-15 11:34 .
drwxr-xr-x 5 root root 4096 2006-12-15 11:37 ..
-rw-r–r– 1 testuser testuser 220 2006-12-15 11:34 .bash_logout
-rw-r–r– 1 testuser testuser 414 2006-12-15 11:34 .bash_profile
-rw-r–r– 1 testuser testuser 2227 2006-12-15 11:34 .bashrc


You'll notice that there are bash scripts in this directory. If you wanted to set default path options for all new users, you would do so by modifying the files in /etc/skel, which would then be used to create these files by the useradd command.

adduser

The adduser command is even easier than the useradd command, because it prompts you for each piece of information. I find it slightly funny that there are two virtually identically named commands that do the same thing, but that's linux for you. Here's the syntax:

adduser

Example:

root@ubuntuServ:/etc/skel$ sudo adduser tutorialsland
Password:
Adding user `tutorialsland'…
Adding new group `tutorialsland' (1004).
Adding new user `tutorialsland' (1004) with group `tutorialsland'.
Creating home directory `/home/tutorialsland'.
Copying files from `/etc/skel'
Enter new UNIX password:
Retype new UNIX password:
No password supplied
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for tutorialsland
Enter the new value, or press ENTER for the default
Full Name []: The tutorialsland
Room Number []: 0
Work Phone []: 555-1212
Home Phone []: 555-1212
Other []:
Is the information correct? [y/N] y


Read more!

Access Your MySQL Remotely Over SSH

So you've got MySQL on your web server, but it's only opened to local ports by default for security reasons. If you want to access your database from a client tool like the MySQL Query Browser, normally you'd have to open up access from your local IP address… but that's not nearly as secure.

So instead, we'll just use port-forwarding through an SSH tunnel, so your MySQL client thinks it's connecting to your localhost machine, but it's really connecting to the other server through the tunnel.

If you are using the command line ssh, the command would look like this. (You can do the same thing graphically in Putty or SecureCRT options if you need to)

ssh -L 3306:localhost:3306 dftutorials.com@webserver.com

The syntax is ssh -L hostname @. We're using localhost as the hostname because we are directly accessing the remote mysql server through ssh. You could also use this technique to port-forward through one ssh server to another server.

If you already have mysql running on your local machine then you can use a different local port for the port-forwarding, and just set your client tools to access MySQL on a different port.

image
Once you've got the ssh tunnel going, you can open up MySQL Query Browser and enter in the details for your remote server, using localhost as the server host, and adjust the port to whatever you used.

Once you get used to this method, you'll wonder why you ever used phpmyadmin or the command line version.


Read more!

A "live" view of a logfile on Linux

This approach works for any linux operating system, including Ubuntu, and is probably most often used in conjunction with web development work.

tail -f /path/thefile.log

This will give you a scrolling view of the logfile. As new lines are added to the end, they will show up in your console screen.

For Ruby on Rails, for instance, you can view the development logfile by running the command from your project directory:

tail -f log/development.log

As with all linux apps, Ctrl+C will stop it.


Read more!

Friday, July 4, 2008

Add "Open with gedit" in Ubuntu Menu

The file browser in Ubuntu provides the ability to run scripts on a selected
file. These scripts can be used to do anything from opening a file to zipping or
uploading, or anything that you can do from the command line.

To start off, we will need to open a terminal window and type in the
following command, which will create a new script file in our nautilus scripts
directory

gedit ~/.gnome2/nautilus-scripts/Open\ with\ gedit

Paste in the following script, found on the G-Scripts site, which is a great resource
for finding scripts.


#!/bin/bash

#

# Nautilus script -> open gedit

#

# Owner : Largey Patrick from Switzerland

#

patrick.largey@nazeman.org

This e-mail address is being protected from spam
bots, you need JavaScript enabled to view it



# www.nazeman.org

#

# Licence : GNU GPL

#

# Copyright (C) Nazeman

#

# Ver. 0.9-1 Date: 16.02.2002

# Add multiple file open in the same windows

#

# Ver: 0.9 Date: 27.10.2001

# Initial release

#

# Dependence : Nautilus (of course)

# Gnome-utils (gdialog)

#

filesall=""

while [ $# -gt 0 ]

do

files=`echo "$1″ sed 's/ /\?/g'`

filesall="$files $filesall"

shift

done

gedit $filesall&



Save and close the gedit window, and then execute the following command to
make the script executable:

chmod u+x ~/.gnome2/nautilus-scripts/Open\ with\ gedit


Note that tab completion really helps here

Now when you right click a file, you should see this:

Tested on: Ubuntu Dapper, Ubuntu Edgy Eft


Read more!
Tutorialsland By - Templates4all | Free Blogger and web Templates
Free Website templatesFree Flash TemplatesFree joomla templatesSEO Web Design AgencyMusic Videos OnlineFree Wordpress Themes Templatesfreethemes4all.comFree Blog TemplatesLast NewsFree CMS TemplatesFree CSS TemplatesSoccer Videos OnlineFree Wordpress ThemesFree Web Templates