Sharing

2011年10月27日 星期四

Ubuntu 上增加新使用者


pjack@ubuntu64-33-7:~$ sudo adduser wistor
[sudo] password for pjack:
Adding user `wistor' ...
Adding new group `wistor' (1001) ...
Adding new user `wistor' (1001) with group `wistor' ...
Creating home directory `/home/wistor' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for wistor
Enter the new value, or press ENTER for the default
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] y
pjack@ubuntu64-33-7:~$ sudo adduser wistor admin
Adding user `wistor' to group `admin' ...
Adding user wistor to group admin
Done.



如果在執行 sudo 時不想需要密碼,要在 /etc/sudoers.d 內新增檔案, 內容加上 NOPASSWD

root@ubuntu1104-64-5:/etc/sudoers.d$ ls
pjack  README  www-data
root@ubuntu1104-64-5:/etc/sudoers.d$ cat pjack
pjack   ALL=(ALL:ALL) NOPASSWD: ALL

Install GUI on Ubuntu Server 11.10 and Remote Control from Windows



Solution 1: Install GNOME desktop

                 sudo apt-get install ubuntu-desktop

Solution 2: install GNOME desktop without recommend software

                 sudo apt-get install --no-install-recommends ubuntu-desktop

                 [這個怪怪的.. 會開不了機, 卡在 PulseAudio configured for per-user sessions]

Solution 3: install light weight desktop xfce

                 sudo apt-get install xubuntu-desktop

Solution 4: install KDE desktop

                 sudo apt-get install kubuntu-desktop

最後再安裝 xrdp, 就大功告成啦~

install xrdp

補: 透過 xrdp , 按 d 的時候, 會把所有的視窗小

Now in order to get the proper keyboard map and theme in GNOME, you need to make a modification:
Open gconf-editor either by typing that in a console, or in the Alt+F2 window.
Inside gconf-editor, navigate to /apps/gnome_settings_daemon/plugins/keyboard and set “active” to false.
or do the following steps
gconf-editor ->app->metacity->global_keybindings
Change the assigned keystroke for show_desktop from "d" to "d" or "d" or "disabled"
But this changes are only for the active user.
To set this option for all Users do the following:
Right click on "show_desktop" and choose  set Mandatory or set it as default. You can check this option if you choose File --> New Mandatory Window. See also this page for more informations.
補: 透過 xrdp, 有些 icon 會不見, 也無法 logout 我後來改用 gnome-shell 就沒問題

sudo apt-get install gnome-shell
sudo nano /etc/lightdm/lightdm.conf             # 把 user-session=ubuntu-2d

2011年10月26日 星期三

Ubuntu 11.10 安裝 Sun Java 6 JDK/JRE


手動安裝JDK

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk

手動安裝JRE

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

2012-03-18 補:
後來發現這個 ppa 沒有再更新,就一直停在 1.6.26 版本,只好再找別的方式,網路上有人寫好更新的 script

http://blog.flexion.org/2012/01/16/install-sun-java-6-jre-jdk-from-deb-packages/

wget https://raw.github.com/flexiondotorg/oab-java6/master/oab-java6.sh -O oab-java6.sh
chmod +x oab-java6.sh
sudo ./oab-java6.sh