Tuesday, December 06, 2011

Move Window Buttons Back to the Right in Ubuntu 10.04 / 10.10/11.10

gconf-editor

apps/metacity/general


The button layout can be changed by changing the “button_layout” key. Double-click button_layout to edit it.Change the text in the Value text field to:

menu:maximize,minimize,close

Labels:

Saturday, September 03, 2011

Customization on hp touchpad: Disk partition for Linux and CPU Overclocking

Step 1. Update webOS from hp touchpad;


Step 2. On the unattached TouchPad enable the Developer Mode to install your third-party software:
                                    webos20090606   
Next Click on the Developer Mode Enabler icon that appears. The very 1st time you do this Click the "OFF" button to "ON" (w/blue button showing) if it requests a password Leave it Blank and just Click "Submit" bar. After that 1st time it will just put your TouchPad in Developer Mode to "ON" - Do not Click on the Set/Change Password bar.


Step 3. Create an ext3fs partition on hp touchpad for Ubuntu in developer mode.


3.1:  on Linux: open terminal and install git and Java runtime. Type:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install git
sudo apt-get install sun-java6-jre


3.1' Windows users can  download a copy of Ubuntu 11.04 from www.ubuntu.com/download and run it in windows (like a usual application, no need to install). Then  follow the instructions in step 3.1 and the Linux section below.
 3.2:  Download the meta-doctor scripts using git. Type:
git clone git://git.webos-internals.org/tools/meta-doctor.git
Navigate to the meta-doctor directory.
cd meta-doctor
 3.3: Create a downloads directory. Type:
mkdir downloads 
3.4: Type:
 cd downloads
wget http://palm.cdnetworks.net/rom/touchpad/p302r0d08012011/wifip302rod/webosdoctorp302hstnhwifi.jar
3.5: open the Makefile with a text editor and uncomment (remove the leading # characters from) the options you would like to use. For example,  uncomment the line of EXT3FS_PARTITION_SIZE.
  EXT3FS_PARTITION_SIZE=8GB
Then type:  
cd meta-doctor
make DEVICE=touchpad CARRIER=wifi all
3.6:  type: 
cd downloads
sudo mv webosdoctorp302hstnhwifi.jar webosdoctorp302hstnhwifi-3.0.2.jar
3.7: Type:
cd meta-doctor/build/touchpad-p302hstnh-wifi-3.0.2 
java -jar *.jar
3.8 Connect hp touchpad (in develop mode)  to PC via USB and select "Next" when it becomes available.    Ignore the question box appears on the TouchPad "USB Drive" or "Cancel"  and leave it up on the screen. 







Now disconnect hp touchpad.
Step 4. Install "WebOS Quick Install" on a PC;
In windows, just double click to run;
In ubuntu, use command line:
java -jar WebOSQuickInstall v4.2.3.jar




Now connect hp touchpad.
Step 5:  From the screen of WebOS click the "globe" icon to install preware

Step 6.  Get the optional ext3fs partition mounted at device boot. Note Novaterm was installed along with WebOSInstaller automatically. On ubuntu, type 
cd /opt/Palm/novacom
novaterm
(On windows, download novaterm for windows and unzip it into the sdk/bin, run novaterm.exe or novaterm-1.exe from the palm/sdk/bin directory)
6.1:  Type:
mount -o remount,rw /
mkdir -p /media/ext3fs
echo "/dev/mapper/store-ext3fs /media/ext3fs ext3 noatime,data=writeback 0 0" >> /etc/fstab 
mount -a 


Step 7. Unattach touchpad and  open preware, touch left upper corner to find "Manage Feeds" and go to the bottom "NEW FEED "
7.1 Enter another new feed:
Name: webos-testing-armv7
URL: http://ipkg.preware.org/feeds/webos-internals/testing/armv7
IS COMPRESSED: YES
Click “Add Feed” and then press OK to confirm
7.2: Enter another new feed:
Name: webos-kernels-testing
URL: http://preware.is.awesome.com/


IS COMPRESSED: YES
Click “Add Feed” and then press OK to confirm and reboot
Step 8. Open preware from hp touchpad, install " Govnah" from preware on hp touchpad 

Step 9. (Optional) Overclocking CPU to 1.8/1.732GHZ.  Restart (must restart! and keep the developer mode) touchpad to update Feed and return to REWARE---->List of Everything,Install "F4 Phantom (Touchpad)" in the list.


Step 10. Install ubuntuchroot or Debian chroot from preware.


Step 11. To install Ubuntu graphical desktop, one needs to firstly install Xceutah/Xserver/Xterm first, it seems that we can install Xauth from preware and the remaing two are automatically installed. 

Then run Xceutah which gives a screen with options to run xserver/xterm and Ubuntuchroot. 

 Touch xserver and then Ubuntu11.04 chroot will lead to a terminal. Type:
apt-get install ubuntu-desktop 
If one prefers xfce4 graphical desktop environment, type:
 apt-get install xfce4
After installation, type 
startxfce4


Step 12.  The p key issue in xfce4: The p key does not work by default after installation. In the graphical environment, go to system-->keyboard settings-->application shortcuts, remove the super p key.

Labels: , ,

Monday, July 18, 2011

How to enable Nautilus address bar for Ubuntu

Enable this key in Applications / System Tools / Configuration Editor:

/apps/nautilus/preferences/always_use_location_entry

Labels:

Wednesday, June 29, 2011

Write permission to external USB drive

 If one has an external USB drive with Linux partitions, Ubuntu by default wouldn't give write permission to non-owners to these partitions. One needs to change the owner of the partition by issuing the following command line:

sudo chown -R username:group device location

where group is, in general, users, device location mounted is /media/

Labels:

Tuesday, March 15, 2011

Make ISO files

Turn a CD/DVD into an .iso
sudo umount /dev/cdrom
dd if=/dev/cdrom of=file.iso bs=1024


Turn a folder into an .iso
mkisofs -r -o file.iso /location_of_folder/


Generate an MD5 checksum file
md5sum file.iso > file.iso.md5

Labels:

Sunday, December 26, 2010

Asus Xonar DS sound card for ubuntu

One needs to update alsa by downloading AlsaUpgrade-1.0.23-2.tar at the website
http://ubuntuforums.org/showthread.php?p=6589810   (register to gain access to the file)




Short Alsa-Upgrade script install instructions:


1. download the script and save it somewhere
2. cd
3. tar xvf AlsaUpgrade-1.0.23-2.tar
4. sudo ./AlsaUpgrade-1.0.23-2.sh -d
5. sudo ./AlsaUpgrade-1.0.23-2.sh -c
6. sudo ./AlsaUpgrade-1.0.23-2.sh -i
7. sudo shutdown -r 0





When rebooting the computer,  disable the onboard audio in BIOS of the motherboard.

Labels:

Sunday, October 03, 2010

Install Adobe reader in Ubuntu and up on 64-bit PC

All the copies of Adobe Reader available at adobe.com do not work for 64-bit PC ubuntu machine.  Here is how I made it:


1. Follow the steps in the website http://www.psychocats.net/ubuntu/sources to enable extra repositories in ubuntu. Namely, go to Administration->Software Sources->Other Software->


Add "deb http://packages.medibuntu.org/ lucid free non-free",  if the Ubuntu is 10.04;


For Ubuntu 9.10, you should substitute karmic for lucid
For Ubuntu 9.04, you should substitute jaunty for lucid
For Ubuntu 8.04, you should substitute hardy for lucid




2. Reload Software sources when step 1 is finished.


3. Use synaptic package mahager to find acroread


or in terminal


# sudo apt-get install acroread


4. The system will automatically find a right copy your 64-bit system.

Labels:

Saturday, May 22, 2010

Configure Ubuntu 10.04 for Thinkpad X41 Tablet

Unlike previous versions of Ubuntu, Ubuntu 10.04 has xserver-xorg-input-wacom to support stylus out of box.


However, the stylus cannot rotate when we set screen rotation from system->preferences->monitor.  This causes much trouble for tablet PC users.  The problem can be solved by writing a small script to rotate both the screen and the stylus.


The biggest trouble is to find the correct name of the Wacom devices including  stylus, eraser, screen. To find the names one needs the following two commands which come with the package wacom-tools:


xsetwacom and xinput
However, the wacom-tools package available for previous ubuntu versions becomes conflicting with the built-in package xserver-xorg-input-wacom in 10.04 LTS. If we installed xserver-xorg-input-wacom first and then install wacom-tools. Then the stylus becomes un-recognizable. The following steps are what I made it:


1. Uninstall xserver-xorg-input-wacom   from synaptic package manger;


2. Install wacom-tools; Download linuxwacom-0.8.6-2.tar.bz2 and unzip it;
go to the prebuilt directory and


./install
3. check the output of


    xsetwacom list  and xinput -list
4. Install  xserver-xorg-input-wacom   from synaptic package manger;


5.  sudo gedit rotatetablet


#!/bin/sh


# Find the line in "xrandr -q --verbose" output that contains current screen orientation and "strip" out current orientation.


rotation="$(xrandr -q --verbose | grep 'connected' | egrep -o  '\) (normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)')"


# Using current screen orientation proceed to rotate screen and input tools.


case "$rotation" in
    normal)
#    -rotate to the right
    xrandr -o right
    xsetwacom set "Serial Wacom Tablet STYLUS"  Rotate  CW
    xsetwacom set "Serial Wacom Tablet" Rotate CW
    xsetwacom set "Serial Wacom Tablet eraser ERASER" Rotate CW 
    ;;
    right)
#    -rotate to normal
    xrandr -o normal
    xsetwacom set "Serial Wacom Tablet STYLUS" Rotate NONE
    xsetwacom set "Serial Wacom Tablet" Rotate NONE
    xsetwacom set "Serial Wacom Tablet eraser ERASER" Rotate NONE
    ;;
esac
7. Save the script rotatetablet in step 6 to /usr/bin.


chmod +x /usr/bin/rotatetablet




NOTE: the names in quotations "Serial Wacom Tablet STYLUS" are obtained from step 3.


8. Make a launcher at desktop for the executable rotatetablet and use it when rotation of the tablet is needed.


6. Reboot computer. It works.

Labels:

How to annotate PDF files in Linux using Xournal

One can use xournal.

Labels:

Tuesday, April 27, 2010

Change user/login name in linux

killall -u old
id old
usermod -l new old
groupmod -n new old
usermod -d /home/new -m new
usermod -c “New Real Name” new
id new

Labels:

Friday, January 15, 2010

Reorder partition numbering and recover the grub2

Before we reorder the partition numbering it is a good idea to have a USB startup disk ready which can be created in ubuntu or other windows softwares. Reordering partition number can cause the failure of the booting files of grub2.


* reorder partition numbering


If you move partitions, change their sizes and create new ones, the numbering might get mixed up (e.g. with gparted). The partitions might look like these:
/dev/sda1 ntfs /media/win
/dev/sda2 ext4 /
/dev/sda3 ext3 /boot
/dev/sda4 extended
/dev/sda8 linux-swap
/dev/sda6 fat32 /media/programs
/dev/sda7 fat32 /media/testdisk
/dev/sda5 fat32 /media/stuff

If you want to reorder the partition numbering for whatever reason, fdisk will help. Execute fdisk /dev/sda (as you can see, I want to reorder the numbering of my first SCSI disk) after becoming root.

# fdisk /dev/sda

The number of cylinders for this disk is set to 19457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help):

If m is entered at the prompt, the possible commands will be listed. Type x to activate the extra functionality (experts only). Press m again to see new expert options. Enter f (fix partition order) and w to write the changes to the disk and exit.


*Recovering of Grub 2*

As we mentioned before, the reordering of the partitions will cause failure of grub2 and the systems installed in other than the number reordered partitions can not boot anymore. In this end, we boot up the system by the USB memory key:

1.Find the partition of the target system, say, sda2

sudo fdisk -l

2. Mount the target partition.
sudo mount /dev/sda2 /mnt
sudo grub-install -–root-directory=/mnt/ /dev/sda

3. Install Grub2
sudo update-grub

Another way to do that is as follows:
$sudo fdisk -l

This will show your partition table. Here is my table to understand it better :

/dev/sda1 29 8369 66999082+ 83 Linux
/dev/sda2 * 8370 13995 45190845 7 HPFS/NTFS
/dev/sda3 13996 14593 4803435 5 Extended
/dev/sda5 13996 14593 4803403+ 82 Linux swap / Solaris

Now i will mount Linux (sda1 here)

$sudo mount /dev/sda1 /mnt
$sudo mount --bind /dev /mnt/dev
$sudo mount --bind /proc /mnt/proc

The following command is optional (it copies resolv.conf)
$sudo cp /etc/resolv.conf /mnt/etc/resolv.conf

Now chroot into the enviroment we made :
sudo chroot /mnt

Now, you will run commands as root.

You may want to edit /etc/default/grub file to fit your system (timeout options etc)

#nano -w /etc/default/grub

Play with the options if you want.(But do not forget to give grub-update command if you saved it )

Now install/recover Grub2 via :

#grub-install /dev/sda
command.However you may get errors with that code like me.If so please use this command :
#grub-install --recheck /dev/sda

Now you can exit the chroot, umount the system and reboot your box :
#exit
$sudo umount /mnt/dev
$sudo umount /mnt/proc
$sudo umount /mnt
$sudo reboot

Labels:

Monday, January 11, 2010

Remove The User List From Ubuntu 9.10 GDM Login Screen

Disable User List

In order to disable the user list you’ll need to open a terminal and run the following command:

sudo -u gdm gconftool-2 --set --type boolean /apps/gdm/simple-greeter/disable_user_list true

Enable User List

If you’d like to re-enable the user list you can revert the above command using:
sudo -u gdm gconftool-2 --set --type boolean /apps/gdm/simple-greeter/disable_user_list false

Labels:

Saturday, January 09, 2010

Problem solved: Ubuntu boots up with only terminal

It could happen to Ubuntu that it boots up with a command line terminal only and the gnome desktop can not load correctly, typically after some update of the system and the culprit might be the failure of the initialization of some hardwares.

To this end, we need a wired network connection since the wireless network can not load before the desktop boot-up. The following command solves the trouble.
# apt-get install gnome-core

Labels:

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.
Code:

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

https://wiki.ubuntu.com/Grub2
http://ubuntuforums.org/showthread.php?t=1195275

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.

Labels:

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#]."

Labels:

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.

Labels:

Friday, November 27, 2009

Virtualbox with XP host and Ubuntu guest

There are some worthy-noting techniques dealing with the system of Virtualbox with XP host and Ubuntu guest.

1. Install VboxGuestAdditions;

This addition facilitates the smooth operation of mouse, display between two system. To install it with Ubuntu running, go to

a. VirtualBox in XP, Devices-> Mount CD/DVD-Rom->CD-DVD-Rom Image then select the VboxGuestAdditions.iso

b. In ubuntu, install the appropriate *.run files accroding to your system. For example

#cd /media/cdrom0
/media/cdrom0 # ./VBoxLinuxAdditions-x86.run

c. After this installation, the mouse can navigate both systems actively and smoothly.

2. Setup USB key in Ubuntu guest;

a. First stop running ubuntu and go toVirtual box.
b. In Settings, the items like general, USB, Shared Folders, are clickable.
c. Click USB and add your USB which is already visible in the XP windows.
d. Start your guest Ubuntu. You will see it in the desktop.

Labels:

Automount a shared folder in virtualbox for ubuntu

once fstab is open (sudo nano -w /etc/fstab), add this command to the bottom:

Share /Shared vboxsf defaults 0 0

Share=what you named the shared host folder in Virtualbox.
Shared=the location of the folder you want the shared files to appear in.

I named my shared host folder "Music", and the folder I wanted the files to appear in was "/home/eric/Musicshare", so my example would be:

Music /home/eric/Musicshare vboxsf defaults 0 0

Labels:

Thursday, October 22, 2009

Chinese display problem in flash applications of Ubuntu

Edit the file at /etc/fonts/conf.d/49-sansserif.conf

change the last line " sans-serif "into

sans

Labels:

Thursday, September 24, 2009

Change Screen Resolution For Ubuntu 8.04 (or 9.04) Running Under VirtualBox

Having Ubuntu 8.04 running on VirtualBox I could not find an easy way to increase the screen resolution higher than 800X600. This great tip shows how to configure the screen resolution in Ubunto 8.04 running as a virtual machine under VirtualBox.

In VirtualBox, click Devices->Install Guest Additions and your virtual Ubuntu should recognize a new CD. Open a terminal and run this command:
sudo /media/cdrom/VBoxLinuxAdditions.run (check the file name to find a right one for your system, 32bit, AMD64)

The installer should prompt you that it’s time to restart the virtual machine once it’s done. Just logging out and back in should work.

This is where things get sticky. For Ubuntu 8.04 guests, the VirtualBox video driver will not be enabled because of the minimalistic xorg.conf file.

Open your guest machine’s xorg.conf file:
gksu gedit /etc/X11/xorg.conf

Find the device section, which should look like this:

Section "Device"
Identifier "Configured Video Device"
EndSection

And replace it with this to enable the VirtualBox driver:


Section "Device"
Identifier "Configured Video Device"
Driver "vboxvideo"
EndSection

Changing screen resolutions in Ubuntu 8.04 is done with RandR, which is not supported by VirtualBox. So you’ll also need to set a resolution manually. Find the screen section, which should look like this:


Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection

And replace it with this, but change 1024×768 to your preferred resolution:


Section "Screen"
Identifier "Default Screen"
Device "VirtualBox graphics card"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x768"
EndSubSection
EndSection

Save, exit the editor, and log out. You should now have a large virtual machine window, as well as mouse pointer integration.

Labels: