Wednesday, December 1, 2010

Windows 7 HotKey in Ubuntu

As a bi-OS user, I am always confused with the hot-key setting while I switch between Operating System. No offense, while I said bi-OS user, I refer to Windows 7 and Ubuntu Lucid. (Not Mac OS).

Some hotkeys introduced in Windows 7 are very userful for myself. For example, Windows + Left / Right / Up / Down

If you never try above hotkeys, try it on a Windows O/S, and you will know what would happen.
Long story short, I would like to resize my windows the the left/right window. What should I do?

(1) You have to install wmctrl package
 sudo apt-get install wmctrl


(2) Open "System"-->"Preference"-->"Keyboard Shortcuts".
Bound Windows + Left to ==> wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,20,1920,1150
Bound Windows + Right to ==> wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,960,20,960,1150

To Maximize a windows:
Bound Windows + Up to ==> wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz;wmctrl -r :ACTIVE: -e 0,0,20,1925,1150


Would you like to learn more?
Read here: wmctrl tutorial

Tuesday, November 23, 2010

Where is my "Ctrl + Alt + Backspace" ?

After installing ubuntu 10.04, I quickly realized that CRTL-ALT-F1 (for opening a terminal) and CRTL-ALT-BACKSPACE (for killing X-server) are gone. Luckily, here is the solution I found:

Enabling Ctrl-Alt-Backspace for Ubuntu 10.04

  1. Select “System”->”Preferences”->”Keyboard”
  2. Select the “Layouts” tab and click on the “Layout Options” button.
  3. Select “Key sequence to kill the X server” and enable “Control + Alt + Backspace”
Enjoy your hot keys :)

Thursday, October 14, 2010

Move window buttons (Min, Max, Close) back to right in ubuntu 10.04

One of the most controversial change in ubuntu 10.04 is to have window buttons on the left side. Although this change favors many mac(apple) users. As a user worked in dual O/S, windows 7 and ubuntu, the change is somehow inconvenient. Here I explain how to move them back. (The min, max, and close button)

1. Open the configuration editor of gnome.
gconf-editor


2. Click on the + button next to the “apps” folder, then click “metacity” in the list of folders expanded for apps, and then click on the “general” category. The button layout can be now changed by editing the “button_layout” key.

3. Change it to:
menu:minimize,maximize,close


Save, close, and you are done. (Restart X Window to take effect)

Tuesday, August 24, 2010

Weired ssh-agent error in Ubuntu

To protect your private key, one might add a long pass-phrase for avoiding the burglary. However, somehow I see the following error while trying to add my private key to ssh-agent.
chucheng@ubuntuVM:~$ ssh-add
Could not open a connection to your authentication agent.

Here is the solution:
exec ssh-agent bash

Don't know why, but it just works :)

Results:
chucheng@ubuntuVM:~$ ssh-add
Enter passphrase for /home/chucheng/.ssh/id_rsa:
Identity added: /home/chucheng/.ssh/id_rsa (/home/chucheng/.ssh/id_rsa)

Tuesday, July 6, 2010

Rename mutliple files at once in ubuntu / linux

I would like to rename multiple files at once in my Ubuntu 10.04.
I google around and I found people suggest the following command:
rename .bak .new *.bak

However, this magic does not work in my Ubuntu.
To rename a batch of files with their extension, the following syntax works:

rename 's/\.bak$/\.csv/' *.bak

The above command would rename all files with the extension ".bak" to the new extension ".csv".

Tuesday, June 22, 2010

Ubuntu 10.04 hang after login

For some unknown reason(s), my newly install Ubuntu 10.04 went panic last Friday. Simply put, the ubuntu 10.04 hang after entering login information. I spend lost of hours on finding the problem. However, I still cannot see why it happens. It turns out that some package contains bugs and cause the o/s crashed after login.

I have tried the following means and none of them works:
- sudo apt-get install --reinstall ubuntu-desktop
- Update every package installed in the system
- Use the default xorg.conf setting (Without Xinerma)
- ... rm -rf home directory ...

Anyway, after keep trial and errors, here explains how I solve the problem.

1. Reboot to Recovery Model
It's a little tricky in Ubuntu 10.04 because by default the grub2 won't show up a start menu for you. The "default" in Ubuntu 10.04 always try to select the default booting item after power on the system. In addition, there's no more /boot/grub/menu.lst in ubuntu 10.04.

Here are solutions:
(1) Comment out "#GRUB_HIDDEN_TIMEOUT=0" through editing /etc/default/grub
(2) Run update-grub (or update-grub2 ?)
(3) Reboot and you will see the grub menu. Select the recovery mode and you are done.

2. Installed the following two package
sudo aptitude install libpam-gnome-keyring=2.92.92.is.2.30.0-0ubuntu3
sudo aptitude install gnome-keyring=2.92.92.is.2.30.0-0ubuntu3


If it works for you as well, please simply leave a comment here :)