Thursday, December 31, 2009

Write access and Grub 2 in Linux (Ubuntu 9.10)

1 . Use chown

Ubuntu 9.04 and up can mount some partitions (ext3/4 and ntfs file systems) at startup. But users can not have write access to mounted partitions. To gain write privilege, issue the following commands as root:

sudo chown -R username partition_path

for example, the command

# chown -R pebloy /media/lnx-str-1

gives write privilege to user pebloy on the directory /media/lnx-str-1.

2. Grub 2 to modify the boot menu of ubuntu

Grub 2 project is newer than the traditional grub 0.97. It is more complicated but more secure and robust.

a. Customize and edit the menu entries at boot.

Each boot entry corresponds to an entry menuentry { } in the boot file located at /boot/grub/grub.cfg.

To customize them, here is how you do it:

* Run sudo update-grub to get the current available kernels.
* Copy the desired "menuentry" listings from /boot/grub/grub.cfg to /etc/grub.d/40_custom The entry begins with the line starting with "menuentry" and ends with a line containing "}".
* Add any other "menuentry" items you wish to see on the boot menu.
* Edit the titles of the "menuentry" line if desired (between the quotation symbols). Do not change the lines following the "menuentry" line. Each entry should start with a "menuentry" line and end with a "}" on the last line.
* Remove the executable bit from /etc/grub.d/10_linux, /etc/grub.d/20_memtest86+ and /etc/grub.d/30_os-prober
Removing the executable bit from any file in /etc/grub.d will exclude the file from being included in grub updates.

sudo chmod -x /etc/grub.d/10_linux /etc/grub.d/20_memtest86+ /etc/grub.d/30_os-prober

* Run "sudo update-grub"
* The updated /boot/grub/grub.cfg file should now contain only sections for "00_header", "05_debian_theme" and "40_custom".
* The grub.cfg file will not be updated with the addition of a new kernel. To add a new kernel, make "10_linux" executable, run "sudo update-grub" to refresh the available kernels, and repeat these instructions.

then update grub.cfg by

# update-grub

Then grub.cfg is modified accordingly. Please note that the boot file grub.cfg is not supposed to be edited directly in Grub2.

For more details on Grub 2, see

3. Change computer name

It could happen that we want a more interesting hostname. We do the following in Ubuntu

# nano -w /etc/hostname

Change the current host name to the one you like.


Thursday, December 03, 2009

How to remove a printing job in linux

  1. Use the "lpq" command prior to using the "lprm" command to make it easier to see which print jobs are currently in the queue. The "lpq" command lists all of the files in the queue, as well as the user, the job number, the size and the root directories from which the print jobs originate.

  2. Step 2

    Type the name of a specific user to remove all of that user's print jobs from the queue. For example, to remove all of the print jobs in the queue posted by the user "exec_a" you would type "lprm exec_a."

  3. Step 3

    Use the "-p" command line parameter to remove print jobs from the queue of a particular printer. In this manner you also need to include the network name for the printer (by default, printers are labeled lp0, lp1, lp2 and so on). In order to remove all of the print jobs from printer lp2, for example, you would type "lprm -p lp2."

  4. Step 4

    Take off all of the print jobs for the current user by simply using a hyphen after the "lprm" command, like this: "lprm -."

  5. Step 5

    Remove specific print jobs that are in the queue by their job number. Each job is assigned a number, which you can display using the "lpq" command. Once you know the number all you need to type is "lprm [job#]."


Tuesday, December 01, 2009

Disable Browser in Mobile Phones

For mobile service subscribers who only use the voice service, it is quite unpleasant to find that the browser in the phone can be frequently triggered and some unnecessary data service surcharges are incurred. The worst is that the web browser is always in the central position of the menu of the mobile phones. In this end, we can restrict or block the data services from the settings of the mobile device. For this purpose I write down the settings on my cell phone Motorola VE 465.

1. Go to Menu->Settings->Phone->Security;

2. When the item Security is selected, a pop-up of Enter Lock Code is prompted. The lock code for VE 465 is either 1234 or the last four digits of the cell phone number.

3. Enter the lock code and select the item Restrictions;

4. In the menu for Restrictions we can block Data Modem, Browser, Messages or even even some incoming/outgoing calls.

5. Block whatever we want. It is all set and we will never be charged by some careless clicks on the keyboard.

P. S. For other not-too-old cell phones, we can block the data service similarly. It is highly suggested to find a copy of the user manual from the manufacturer's website.