GNU_Linux

LaTeX and Eclipse on Ubuntu

You are a Ubuntu user who wants the use LaTeX2e and miss your Eclipse 3.6 (Helio), what should you do?

Install LaTeX2e

You must at least install the texlive package to have a working LaTeX in Ubuntu.

You may optionally consider installing these packages too:

  • texlive-full. This installs all the packages in the TeX Live distribution. You need extra nearly 1.5GB to hold all of them!
  • latex-beamer. Excellent for creating presentations.
  • texpower. Excellent for creating dynamic online presentations.
  • texlive-fonts-extra. A large collection of font packages.
  • texlive-latex-extra. A large collection of add-on packages for LaTeX.

Install Eclipse

As of this writing, the latest version of Eclipse package included in the official Ubuntu repositories is 3.5.x (Galileo). If you want to use the latest Eclipse 3.6.x (Helio), then

  1. Visit http://www.eclipse.org/ and grab the latest version of Eclipse, which would be in .tar.gz format. Grab a package variant that suits you most.
  2. Extract the package to a folder, say your home directory or your Desktop.
  3. Create a shortcut on your desktop or your gnome panel to the 'eclipse' executable, using the 'icon.xpm' icon. There you go!

To add LaTeX support to the Eclipse IDE, you can use the TeXlipse plugin.

  1. Open Eclipse.
  2. Select Help > Install New Software....
  3. Click Add..., and fill in the Name and Location fields with TeXlipse and http://texlipse.sourceforge.net respectively. Click OK. Eclipse should then visit the repository to fetch the software available.
  4. Select TeXlipse, click Next, read and accept the license agreement, click Finish, and wait for the installation to complete. Restart Eclipse for the plug-in to take effect.

A few more tips:

  • While in Eclipse, select Window > Preferences > Texlipse > Viewer Settings. Remove the entry 'none ()' (Why is it there?). You can create a new PDF viewer by filling the fields 'Viewer name', 'Viewer command', and 'Viewer arguments' with 'evince', '/usr/bin/evince', and '%file' respectively. Add or remove other viewers to suit your usage.
  • Official User Manual of TeXlipse. It is good to spend a few minutes to read through the 'Editor features' section.
  • Problem configuring out how to write some symbols in LaTeX? Consult Detexify2!

Schedule Jobs in Ubuntu (and Other Major GNU/Linux distros)

In Ubuntu, how do you schedule some jobs (shell commands) to be executed in the future? You can use at.

Add a Scheduled Job

Run a terminal emulator. Change to the directory where you want to run the command, and issue:

$ at time_specification

The time specification can be rather sophisticated. You can specify HH:MM (e.g., 15:30), midnight, noon, teatime (4pm), month-day day (e.g., Dec 15), time + days (e.g., 4pm + 3 days, to run a job at 4pm three days from now), time + date (e.g., 10am tomorrow), etc. Don't worry that it will misunderstand your schedule as you can (and should) verify it later.

How to Disable the Suspend Button in Ubuntu (10.10)?

I am using Ubuntu on a desktop and I don't want my box to go sleeping when I press the suspend button accidentally. Furthermore, I want to reassign the button to do something more useful. How should I do it?

If you open System -> Preferences -> Power Management and click the General tab, you can configure the action when the button is pressed. However, you can only choose the action to be either 'Suspend' or 'Hibernate', and can't make it to do nothing!

To force it to do nothing, press Alt+F2, enter gconf-editor to invoke the Configuration Editor. Navigate to /apps/gnome-power-manager/buttons, click the value field of suspend, and enter 'nothing' (Enter this 7-character string, not enter nothing!). Close it and you are done! Press your suspend button now to confirm that it really will not suspend your box.

If you mind to check it out further, open System -> Preferences -> Power Management and you will find that the related action is magically set to "Do nothing". If you want to assign a keyboard shortcut for the button now, do it by opening System -> Preferences -> Keyboard Shortcuts.

Time Taken to Move an Ext4 Partition

My harddisk was running out of storage space. Or to be more precise, my /home partition was short of space. I wanted to squeeze a bit more space but was lazy to examine what existing files I can delete. So I took an 'easy' way out: Used gparted to shrink other partitions to make way for the /home partition!

I had overestimated the bulkiness of GNU/Linux and had initially allocated 40GB for the root partition /. But in reality, I hardly use more than 10GB from this partition. So I decided to shrink this partition to become only 20GB. I headed to GParted [gparted.sourceforge.net] to download its latest stable image to make a live USB. (Warning: Backup your extremely important data before you use this!) It is very easy to use GParted. My concern was that what I was doing involve a very expensive operation: Move the beginning of my /home partition, where about 500GB had been occupied. There doesn't seem to have an implementation that can do this in a short amount of time. (Or is it that the structure of an ext4 filesystem that fundamentally prevents one from doing this?) (In contrast, it generally takes a few seconds to move the end of an ext4 partition.)

I wanted to expand my /home partition by hook or by crook, although I had no idea how long gparted would take. I had my answer soon after I booted from the live USB and started gparted: 10 hours! In particular, gparted used two hours plus to test reading all data from the partition, and used seven hours plus to move the data after that! No choice, so I left my computer to gparted overnight, and prayed hard that there would not be any power interruption! (Of course, I had made a backup of very important data to another harddisk.)

Anyway, I deserve what I want now after 10 hours of waiting and sleeping:

Rescuing A Hung GNU/Linux System

My GNU/Linux box just hanged. It is actually my own fault as I tried to empty the swap partition (with sudo swapoff -a; sudo swapon -a) without realizing that I don't have enough RAM space! Anyway, if you have a hung X session, what can you do?

Note: I assume that you are using QWERTY keyboard. If not, convert the key sequence as described here [wikipedia.org].

  • Kill the X session. Do this with Ctrl-Alt-Backspace. This should bring you back to the X login window. You can't do this in Ubuntu anymore. If so, kill the processes in the current virtual console as described below.
  • Kill all processes on the current virtual console. Do this with Alt-SysRq-K if you fail to kill the X session as described above. This should bring you back to the X login window.
  • Reboot the system safely. Do this if you fail to reboot the system in the normal ways. To reboot a GNU/Linux system safely, use the following key combinations in sequence:
    1. Alt-SysRq-R. Take the control of the keyboard.
    2. Alt-SysRq-E. Send SIGTERM to all processes.
    3. Alt-SysRq-I. Send SIGKILL to all processes.
    4. Alt-SysRq-S. Sync all mounted filesystems.
    5. Alt-SysRq-U. Remount all filesystems in read-only mode.
    6. Alt-SysRq-B. Reboot!
  • You can memorize this magic sequence with "Reboot Even If System Utterly Broken", or simply "BUSIER" backwards.

  • Press the 'magical' reset button! Frankly speaking, you almost never need to do this with Linux. (Although you may do this very often in some other operating systems.)

Ubuntu Netbook Edition on Asus Eee PC 4G (701)

I have just installed Ubuntu Netbook Edition [www.canonical.com] 10.04 Lucid Lynx on my Eee PC 4G (701) (Hardware specification [wiki.eeeuser.com]). In short, it works perfectly and flawlessly out-of-box!

This is a 2-year-old laptop with a 'slow' 900MHz Intel Celeron processor and a 'small' 4GB SSD. What else besides a good GNU/Linux distro can resurrect it?

Installation

  • Base System. Download the CD Image of Ubuntu Netbook Edition [www.ubuntu.com] and prepare it on a USB stick. Install it.
  • Better web experience.
    • Adobe Flash and Java Applets. From the Ubuntu Software Center, install 'Adobe Flash plugin' and 'Standard Java or Java compatible Runtime' (default-jre).
    • Compact Themes for Firefox. There are several compact themes for firefox [addons.mozilla.org] which are more suitable for devices with small screen. Install one.
  • Complete Chinese support -- More Fonts and Input Methods. Chinese characters can be displayed correctly with the default installation. If you need more fonts and input methods, use System -> Language Support to do it. Support for other languages can be installed similarly.
  • Anti-Virus, Anti-Spyware, Filesystem Defragmentation, System Crash Monitor/Analyzer/Recovery, ... Not required and not available!

I have tested several laptop-specific features and they simply work perfectly out-of-box. E.g., the Wi-Fi, the webcam (use 'Cheese' to test it), and the Fn hotkeys (for controlling Wi-Fi, LCD, volume, etc.).

The PC was pre-installed with Xandros when I just bought it, but I was not used to its interface. I thus replaced the OS with Xubuntu. That time, Xubuntu worked fine but required some customizations to make the Wi-Fi and the Fn hotkeys to work properly. So I'm so glad that the latest Ubuntu Netbook Edition (10.04 Lucid Lynx) just works perfectly on it.

Ubuntu 10.04 Lucid Lynx: My Installation Notes

Things I have done to install my boxes with Ubuntu 10.04.

1. Installation

The installation steps for Ubuntu have been greatly and nicely improved and simplified over the years. Furthermore, its AMD64 version is very reliable and user-friendly too, so use it whenever possible.

  • Base Ubuntu System. Download the Ubuntu CD image and prepare it on a CD or a USB stick. Install it. Check this [www.ubuntu.com] for details.
  • Xfce. Xfce promises very responsive desktop experience. From the Ubuntu Software Center, install 'default Settings for Xubuntu' (xubuntu-default-settings), 'Meta-package for the Xfce Lightweight Desktop Environment' (xfce4), 'enhancements for the Xfce4 Desktop Environment' (xfce4-goodies).
  • Better web experience with Adobe Flash and Java Applets. From the Ubuntu Software Center, install 'Adobe Flash plugin' and 'Standard Java or Java compatible Runtime' (default-jre).
  • Google Chrome Browser. From the Ubuntu Software Center, install 'Chromium Web Browser'. If you hunger for the latest version (probably unstable), you can check this [ubuntuupdates.org] or this [code.google.com].
  • Python. From the Ubuntu Software Center, install 'Python (v3.1)'.
  • Wine for running Windows applications. Follow the instructions here [www.winehq.org].
  • Complete Chinese support -- More Fonts and Input Methods. Chinese characters can be displayed correctly with the default installation. But you may need more fonts and input methods. Use System -> Language Support to do it. Supports for other languages can be installed similarly.
    • Support of Chinese PDF files. From the Ubuntu Software Center, install 'Encoding data for the poppler PDF rendering library' (poppler-data), 'Portable Document Format (PDF) suite -- simplified Chinese language support' (xpdf-chinese-simplified), and 'Portable Document Format (PDF) suite -- traditional Chinese language support' (xpdf-chinese-traditional).
  • VirtualBox. Follow the instructions here [www.virtualbox.org] to add the repository and to install the package.
  • Anti-Virus, Anti-Spyware, Filesystem Defragmentation, System Crash Monitor/Analyzer/Recovery. Don't have them as you don't need them!
    • If you want to protect other platforms from virus infection, use ClamAV.
  • Other useful applications: Medibuntu, VirtualBox, GNU Emacs, Gimp, build-essential, manpages-dev, conky, mc, k3b, geeqie, etc.

Syndicate content