Posts

Showing posts from September, 2009

[Level 1] Rar tool for Solaris.

Sometimes we will got a rar compressed file from our friends, but there is no default tool in OpenSolaris to decompress the rar filess. We can got a Solaris Intel version from rarlab . The steps as the following: 1. down load the rar tools from rarlab. http://www.rarlab.com/rar_add.htm 2. uncompressed the source. # gunzip ./unrar-sol-intel.gz 3. move it to the location you used to. # mv /unrar-sol-intel.gz /usr/bin/unrar 4. try to decomprss # unrar x ./test.rar Wish this helps. regards, Stanley Huang

[Level 1] How to install VirtualBox in OpenSolaris.

VirtualBox is a virtual machine which provides you to install multi-OS on it. LIke OpenSolaris, Solaris 10 x86, Linux (Ubuntu, Fedora...etc) and Windows. The installation steps as the following: 1. Browering the download page.   http://www.virtualbox.org/wiki/Downloads 2. Choose the right source for OpenSolaris.   * VirtualBox 3.0.6 for Solaris and OpenSolaris hosts x86/amd64 3. unzip and untar.    # gzip -cd ./VirtualBox-3.0.4-50684-SunOS.tar.gz | tar xvf - 4. install package.   # pkgadd -d ./VirtualBoxKern-3.0.4-SunOS-r50684.pkg all  # pkgadd -d ./VirtualBox-3.0.4-SunOS-r50684.pkg all 5. And now, you can start VirtualBox.  # /bin/VirtualBox Wish this helps. regards, Stanley Huang

[Level 1] How to solve the timeout problem, when install package?

When installing packages the operation may fail with the error code 28. You can set the environment variable PKG_CLIENT_TIMEOUT more, to prevent timeout. The command as the following: # PKG_CLIENT_TIMEOUT=1200 # export PKG_CLIENT_TIMEOUT # pkg install <name of packages> Wish this helps. regards, Stanley Huang

[Level 3] How to disable mouse pad?

The mouse pad always make me confuse~ Because whiling typing, I'll touch it, and sometime the mis-operation will just close my working screen. It will make me crazy. Therefore, I write a script to disable the mouse pad, at this moment, only the external mouse is active. But, when I try to enable it, I find out that I cannot enable it, it's that a bug??? Whatever, if you have the same problem, just remove your external mouse, and the touch pad will be active again. Just enjoy it~ #!/usr/bin/bash showUsage() {   cat <<EOF Usage:   $0 (d)isable/(e)nable Ex.   $0 (d)isable   $0 (e)nable Note.   for solaris only EOF } disableMousePad() {   [ ! -z "$modno" ] && pfexec modunload -i $modno } enableMousePad() {   [ ! -z "$modname" ] && pfexec modload /kernel/drv/amd64/$modname } showMousePad() {   echo "Show mod info:"   pfexec modinfo | grep mouse | grep PS/2 } ##################################...

[Level 2] Xrandr on OpenSolaris in EeePC.

I install OpenSolaris on my EeePC, but I got a problem  about VGA output (for projector). My OpenSolaris can only support 800x600 resolution, but I think it could be higher. Then my colleague told me that I modify the file "/etc/X11/xorg.conf". In normal case, the steps as the following: 1. check your device. # xrandr Screen 0: minimum 320 x 200, current 800 x 480, maximum 800 x 800 VGA disconnected (normal left inverted right x axis y axis) LVDS connected 800x480+0+0 (normal left inverted right x axis y axis) 0mm x 0mm    800x480        60.0*+    640x480        85.0     72.8     75.0     59.9     720x400        85.0     640x400        85.1     640x350        85.1  TV...

[Level 2] How to solve the problem if you forget user password in OpenSolaris?

If you have a user with root role, and forget the user password. How to solve this problem? Steps as the following: 1. Use CD-ROM to boot.   You can use CD-ROM to boot server first. If you don't have, please download the iso file and burn a new one for yourself. 2. Import pool and mount Boot Environment.   Then you can import the "root disk" pool with the command "zpool import". At the same time, you should import the pool ( use option "-R" ) with alternative root. Ex. # zpool import -R /tmp/rpool rpooliso   When you try to change directory to the sub folder "etc" of "/tmp/rpool", and you will find out that the folder doesnot exist ( int this case, /tmp/rpool/etc ). Why? because when you import the pool, the Boot Environment will not be mounted, and you have to mount it manually. So you can use command "beadm" with "mount" sub-command then assign the "boot environment" and the "mount poi...

[Level 2] Shell Interactive With Zenity Episode 9 -- text-info (Finished)

Image
If you want to show a multi-line text info, you can use the option "--text-info". Ths Synopsis as below: SYNOPSIS      zenity --text-info [--title=title] [--window-icon=path]  [--width=width]   [--height=height]   [--timeout=seconds]   [--filename=path] [--editable] Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you select one option and click "OK", zenity will response the option and return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell Interactive With Zenity Episode 1 -- calendar ", too. The command that you can try is "zenity --text-info". Ex. # zenity --text-info # In above case, the text column is not editable, and when you click the button "Close" the terminal won't ...

[Level 2] Shell Interactive With Zenity Episode 8 -- scale

Image
If you want to let user to set the scale, you can use the option ""--scale" to show a scale diagram. The synopsis as below: SYNOPSIS      zenity  --scale  [--title=title]  [--window-icon=path]   [--width=width]   [--height=height]   [--timeout=seconds]   [--text=text]  [--value=number]  [--min-value=number]   [--max-value=number]   [--step=number]  [--print-partial]  [--hide-value] Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you select one option and click "OK", zenity will response the option and return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell Interactive With Zenity Episode 1 -- calendar ", too. The fist command that you can try is "zenity --scale", When user poll the bar and ...

[Level 2] Shell Interactive With Zenity Episode 7 -- progress

Image
Sometime we want to show a progress bar to let user know the process is still running or how many percentage of task has done. For this purpose, you can use an option "--progress" to fullfill your need. Ths Synopsis as below: SYNOPSIS      zenity --progress [--title=title]  [--window-icon=path]  [--width=width]   [--height=height]   [--timeout=seconds]  [--text=text] [--percentage=number] [--pulsate]  [--auto-close] [--auto-kill] Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you select one option and click "OK", zenity will response the option and return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell Interactive With Zenity Episode 1 -- calendar ", too. The first command that you can try is "z...

[Level 2] Shell Interactive With Zenity Episode 6 -- notification

Image
What option can we use, if we want to let user get something show? You can use the option "--notification", the synoposis as the following: SYNOPSIS      zenity --notification [--window-icon=path] [--timeout=seconds] [--text=text] [--listen] Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you select one option and click "OK", zenity will response the option and return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell Interactive With Zenity Episode 1 -- calendar ", too. When you enter the command ¨zenity --notification¨, you will get a warning sign on the panel. Ex. # zenity --notification # zenity --notification --text="Here is the tip" The notification also support listening, that means t...

[Level 2] Shell Interactive With Zenity Episode 5 -- list

Image
If you want to give a list for user to choose, you can use the option "--list". The command synopsis as below: SYNOPSIS      zenity  --list [--title=title] [--window-icon=path] [--width=width]    [--height=height] [--timeout=seconds] [--column=text] [--checklist]       [--radiolist] [--separator=character] [--multiple] [--editable] [--print-column=number] [--hide-column=number] Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you select one option and click "OK", zenity will response the option and return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell Interactive With Zenity Episode 1 -- calendar ", too. About "--multiple" and "--separator", please refer to tht previous post " [Lev...

[Level 2] Shell Interactive With Zenity Episode 4 -- file-selection

Image
Does zenity provide the file/directory GUI? Yes, you can use the option "--file-selection". The command synopsis as following: SYNOPSIS      zenity --file-selection [--title=title] [--window-icon=path]  --width=width]  [--height=height] [--timeout=seconds]  [--filename=path]  [--multiple]  [--directory] [--save] [--separator=character] [--confirm-overwrite] When you use the option "--file-selection", you will see a pop out screen at the directory that you run this command, like below. # cd /etc # zenity --file-selection Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you select one file and click "OK", zenity will response the filename and return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell I...

[Level 2] Shell Interactive With Zenity Episode 3 -- error / info / question / warning

Image
If you want to pop out a alter, you can use the option "--error, --info, --question or --warning". The command synopsis as the following: SYNOPSIS      zenity  --entry  [--title=title]  [--window-icon=path]   [--width=width]   [--height=height]   [--timeout=seconds]   [--text=text] [--entry-text=text] [--hide-text] # zenity --error # zenity --info # zenity --question # zenity --warning Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you click "OK", zenity will return the code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous post " [Level 2] Shell Interactive With Zenity Episode 1 -- calendar ", too. One thing that confuse me is "--nowrap", every time I use it, the zenity will show the error return as "This option ...

[Level 2] Shell Interactive With Zenity Episode 2 -- entry

Image
When shell script needs to communicate with user, we usually use the command "read" to receive your's input. Does zenity has something like this? Yes, you can use the option "--entry". The command synopsis as the following: SYNOPSIS      zenity  --entry  [--title=title]  [--window-icon=path]   [--width=width]   [--height=height]   [--timeout=seconds]   [--text=text] [--entry-text=text] [--hide-text] The first command you can try is "zenity --entry", then you can see a pop out screen like below: # zenity --entry Just like " --calendar ", if you press "ESC" key or click button "Cancel", the return code will be "1". If you key some text in the column and click "OK", zenity will response the text that you key in and the return code will be "0". And also the same effect about the options "--title", "--timeout"...etc, for saving your time, please refer to the previous pos...