0

Managing storage devices in Ubuntu

Posted by Derek Jing on 6:14 PM in ,
Display available storge devices:
$ sudo fdisk -l

Manage partitions:
$ sudo apt-get install gparted

Manage mounting points for partitions:
$ sudo apt-get install pysdm

0

Use PartImage to backup and restore Ubuntu system

Posted by Derek Jing on 5:48 PM in ,
This summary is based on this article.
  1. This tutorial assumes that you have a Ubuntu live CD and somewhere you can save the partition (an external hard drive or another partition).
  2. boot up Ubuntu with the live CD.
  3. List available partitions
    $ sudo fdisk -l
  4. Make sure the source partition (for example: /dev/sda1) is not mounted, and the destination partition (for example: /dev/sda5) is mounted.
  5. If necessary, can use software 'pysdm' to mount/unmount a partition.
    $ sudo apt-get install pysdm
    For example, with pysdm, we can mount '/dev/sda5' to '/media/sda5'
  6. Install PartImage
    $ sudo apt-get update
    $ sudo apt-get install partimage
  7. Run PartImage



    Select '/dev/sda1' ==>partition to save/restore
    Type '/media/sda5/foldername/filename' ==>Image file to create/use
    Then follow the window to proceed until done.
    Note: Keep in mind, though, that the backup will save only the used space on the partition
    Note: ' F5' for next step, 'F6' for exit, 'Space' for changing value, 'Arrows' for navigation.

0

Install RPM under Ubuntu

Posted by Derek Jing on 8:13 AM in ,
To install the rpms you'll need to install alien as root:
$ apt-get install alien

To install rpms
$ alien -i /path_to_rpms/*.rpm


0

Install R under Ubuntu Jaunty (v9.04)

Posted by Derek Jing on 12:33 PM in , , ,
If installing from Ubuntu 'official' repository, search with 'CRAN' in Synaptic Package manager, and install components that you want.

Below guide is for installing R from 'third party' repository, which may gives newer release of R.
  1. Add pubkey
    $ gpg --keyserver keyserver.ubuntu.com --recv D67FC6EAE2A11821
    $ gpg --export --armor D67FC6EAE2A11821 | sudo apt-key add -

  2. Add repositories
    • Method 1:
      System >> Administration >> Software Sources
      Fill in 'deb http:///bin/linux/ubuntu jaunty/'
      where can be such as 'http://cran.opensourceresources.org/ '

    • Method 2:
      $ sudo gedit /etc/apt/sources.list
      add 'deb http:///bin/linux/ubuntu jaunty/'

  3. Install complete R system
    $ sudo apt-get update
    $ sudo apt-get install r-base

    Users who need to compile R packages from source [e.g. package maintainers, or anyone installing packages with install.packages()] should also install the r-base-dev package:
    $ sudo apt-get install r-base-dev

0

Install Matlab under Ubuntu

Posted by Derek Jing on 6:33 PM in ,
  1. Mount the ISO file to a temporary folder 'tmp'
    Copy the installation ISO file, matlab2008b-linux.iso to desktop.

    $ cd Desktop
    $ mkdir tmp
    $ sudo mount -o loop matlab208b-linux.iso tmp
    $ cd tmp

  2. Install Matlab

    $ sudo ./install

    Choose installation folder to be '/usr/local/matlabR2008b'
    Input the serial number, and then follow the coming instructions......
    During installation, if you are lucky that being asked to create 'Symbolic Links', do it. If not, you bad luck, and need to do additional post-install step.

  3. Unmount ISO file and delete temporary folder 'tmp'.

    $ cd ~/Desktop
    $ sudo umount tmp
    $ rm -fr tmp

  4. Start Matlab
    • If you are lucky to be asked to create 'Symbolic Link' during installation, you can directly Matlab by

      $ matlab

    • If you are not lucky, start Matlab by

      $ /usr/local/matlabR2008b/bin/matlab

  5. User permission
    After Matlab is started, if you get warning message that 'The desktop configuration was not saved successfully', then do following

    $ sudo chmod a+w -R /home/yourname/.matlab/R2008b


0

Install TexLive 2008 and Texmaker under Ubuntu

Posted by Derek Jing on 6:43 AM in , ,
This article describes how to install latest TexLive from TexLive official website. However, it was found that even though you can taste the lastest version, there are some imcompatibility with Ubuntu. Unless you are a Ubuntu guru, you may not be able to fix these problems.

So, it is recommended for you to install TexLive from Ubuntu repository, which may be one-year lags behind the most recent release. However, this difference is trivial.
The easiest way is to use synaptic package manager.


If you are brave enough to taste the latest version, then following below steps:
  1. In order to use TexLive GUI installation, do following first
    $ sudo apt-get install perl-tk
  2. Download network installer (install-tl-unix.tar.gz) from TexLive official site, and extract it to desktop, getting a folder 'install-tl'. Do not use TexLive distribution form Ubuntu repository, since some components are missing.
  3. Start GUI installer
    $ cd ~/Desktop/install-tl
    $ sudo perl install-tl -gui (or just '$ sudo ./install-tl -gui')
  4. As the installing GUI comes out
    Customize installation components and options. Make sure to check 'create symlink in system directories', and also may check 'using letter instead of A4'. Keep the default installation location.
  5. The installation takes really really long time ........go for coffee.
  6. Install Latex editor (IDE)
    Personally I think TEXMAKER is the best one under GNOME. Again, do not download Texmaker from Ubuntu repository, since it will grab old Telive 2007 files from the repository and overwrite what you just installed. Download it from here. This is a .deb file and you can use Gdebi package installer to install it directly.

0

To-do-lists after fresh installation of Ubuntu

Posted by Derek Jing on 11:21 PM in ,
  1. Install Cisco VPN

  2. $ sudo apt-get install vpnc
    $ sudo su
    $ cd /etc/vpnc
    $ cp example.conf umcampus.conf
    $ gedit umcampus.conf

    ------------
    IPSec gateway: 141.211.255.196
    IPSec ID: UM-on-campus-wireless
    IPSec secret: W...........TB.....d!
    Xauth interactive
    ------------
    Connect: $ sudo vpnc umcampus
    Disconnect: $ sudo vpnc-disconnect

    Note: If the profile file 'default.conf' reside in /etc/vpnc, then it will be automatically called in using following command

    $ sudo vpnc-connect

  1. Setup PDF printer

  2. $ sudo apt-get install cups-pdf
    Create folder '/home/username/PDF'.

  3. Check GCC installation

  4. Find GCC location: $ which gcc
    Check GCC version: $ gcc -v
    Update GCC: $ sudo apt-get install build-essential

  5. Several nice GNOME C++ IDEs

  6. $ sudo apt-get install anjuta
    $ sudo apt-get install codeblocks
    $ sudo apt-get install eclipse eclipse-cdt
    $ sudo apt-get install geany

  7. 设置中文输入

  8. Step 1: System >> Administration >> Language Support >> Install/Remove Languages >> Check 'Chinese'
    check 'Use input method engines (IME) to enter complex characters'
    Step 2: System >> Preferences >> SCIM Input Method Setup >> Enable your preferred input method

  9. Install other cool softwares

  10. Flowchart:
    $ sudo apt-get install dia
    Support chm format document:
    $ sudo apt-get install gnochm (for GNOME)
    $ sudo apt-get install kchmviewer (for KDE)
    Support rar:
    $ sudo apt-get install unrar
    MSN messenger client:
    $ sudo apt-get install amsn
    $ sudo apt-get install emesene
    $ sudo apt-get install empathy
    File/folder synchronization:
    $ sudo apt-get install grsync
    $ sudo apt-get install unison-gtk
    A very nice referece manager:
    $ sudo apt-get install referencer
    A lightweight bandwidth monitor:
    $ sudo apt-get install bwm-ng (need to mannually create menu item)
    A nice rss feeder under Ubuntu:
    $ sudo apt-get install liferea
    A vector graph/image editor (similar as Photoshop):
    $ sudo apt-get install inkscape

0

Embed Windows XP Inside Ubuntu Using Virtual Box

Posted by Derek Jing on 6:15 PM in ,
Compared with Ubuntu+XP dual-boot system, this method makes it easy to switch to the other OS from current OS and share files freely.


  1. Prepare the system

  2. First you need to install the following package.Dynamic Kernel Module Support Framework.This package contains the framework for the Dynamic Kernel Module Support (DKMS) method for installing and updating kernel modules.
    $ sudo apt-get install dkms

  3. Install Compiz Fusion in Ubuntu

  4. This step is not necessary, just for beautifying desktop

    $ sudo apt-get install compizconfig-settings-manager

  5. Download and install Virtualbox

  6. Download it from the official website. Do not use Synaptic to install OSE package.
    $ sudo dpkg -i VirtualBox_3.0.0_Ubuntu_edgy.deb

  7. Add appropriate user profile to the vboxusrs group so that Virtualbox will work

  8. The group 'vboxusers' will be created during installation. Note that a user who is going to run VirtualBox must be member of that group.
    $ sudo usermod -a -G vboxusers username
    or
    $ sudo adduser username vboxusers

  9. Check building kernel module

  10. If no warning comes during installing procedure, ignore this step.

    The installer will also search for a VirtualBox kernel module suitable for your kernel. The package includes pre-compiled modules for the most common kernel configurations. If no suitable kernel module is found, the installation script tries to build a module itself. If the build process is not successful you will be shown a warning and the package will be left unconfigured. Please have a look at '/var/log/vbox-install.log' to find out why the compilation failed. You may have to install the appropriate Linux kernel headers.After correcting any problems, do
    $ sudo /etc/init.d/vboxdrv setup
    This will start a second attempt to build the module

  11. Enable USB support in Virtualbox

  12. In order to use VirtualBox's USB support, the user account under which you intend to run VirtualBox must have read and write access to the USB filesystem (usbfs).

    For 'Jaunty' you need to add a line to your /etc/fstab file:
    $ sudo gedit /etc/fstab
    Add following line to the end of the opened file:
    none /proc/bus/usb usbfs devgid=46,devmode=664 0 0
    then run
    $ sudo mount -a

  13. Start VirtualBox

  14. Applications – System Tools – Sun xVM VirtualBox
    Create a Windows virtual machine (follow the “New” Wizzard).

  15. Basic Virtualbox configurations

  16. To be able to get your virtual machine booting from an XP install cd, we need to mount the CD/DVD drive. Click the settings button and you will see this window – click the CD/DVD-ROM tab.


  17. Start virtual machine (VM) and install Windows XP using boot XP disk




  18. Install the guest additions

  19. Once XP is completely installed, install the guest additions ISO, which will enable a full screen resolution and a lot of compatibility between Ubuntu and XP (such as folder sharing).
    To mount the Additions ISO file: Virtual machine's menu bar >> Devices >> Install guest additions ==> This will automatically bring up the Additions in your VM window.
    Note: For 'Direct 3D support' in Windows to work, the Guest Additions must be installed in Windows "safe mode". Press F8 when the Windows guest is booting and select "Safe mode", then install the Guest Additions. Otherwise Windows' file protection mechanism will interfere with the replacement DLLs installed by VirtualBox and keep restoring the original Windows system DLLs.
    Running the installer: Open windows explorer in XP, you will see the mounted ISO. Double click it to begin installation.


  20. Setup folder sharing between host and guest systems

  21. Shared folders allow you to access files of your host system from within the guest system, much like ordinary shares on Windows networks would -- except that shared folders do not need require networking. Shared folders must physically reside on the host and are then shared with the guest; sharing is accomplished using a special service on the host and a file system driver for the guest, both of which are provided by VirtualBox.
    Assign folder for sharing: Virtualbox menu >> Devices >> Shared folders. Add a folder under 'Machine folder' (this shared folder can be the host ubuntu home folder)
    Mount the shared folder from inside XP: My Networking Places >> Map a network drive >> select the shared host folder, and assign a drive letter (such as 'B') for it. Done!

Copyright © 2009 Derek's Technical Notes All rights reserved.