Tuesday, November 10, 2009

Create a Terminal Command in Solaris

Create a text file in your desktop.

Edit the text file with the commands that you would want it to run, as if typing on terminal.

For example you want to set the keyboard layout to dvorak, type in "xmodmap /usr/share/xmodmap/xmodmap.dvorak".

Close the file, right-click, Properties>Permissions, then check the Make file runnable option.

Go to /usr/bin/ in File Browser. (Places>System>Filesystem>usr>bin)

After that, click File>Open in Terminal.

In terminal, type in "mv /export/home/*your-user-name*/Desktop/*file-name-of-command* *command-name-you-like*"

===========END==========

Note: If you get "Permission Denied" errors in terminal, you need to use terminal as a super user. To do this, enter "su" in terminal. Then, type in your password (even if you don't see anything being typed) and hit enter. Now try the command again. =)


EXAMPLE:
I want to create a command that I could type in terminal to easily set the keyboard layout to dvorak.

I create a file in desktop, name it whatever I want like "dvoraker".

In the file, I write the xmodmap command mentioned above.

I go to /usr/bin/ and open it in Terminal.

Then in terminal, assuming my username is grapeseed, I write "mv /export/home/grapeseed/Desktop/dvoraker asdf".

Done. Now when I reboot and need to reload my dvorak layout, I just launch terminal and tap the four keys under my left hand (that's why I named the command asdf).


TIP: It's also wise to create a notification to tell you that the command successfully completed. In this example, I may write "echo 'dvorak success'" in addition to the xmodmap command.

Saturday, November 7, 2009

How To Get the GCC Package for Solaris

Go to System>Administration>Package Manager
Type in "gcc" in the search bar.
Click "gcc-dev" in the results. [EDIT] Tick the checkbox to the left of "gcc-dev". The square is actually a checkbox. GUI fail.
Click Install/Update on the taskbar.
Confirm and finish your installation.
(Installing may take a while, as it downloads from the server but that's basically it.) =)

How To Install Apache Http Server on a Unix System

Unix system: Solaris, Linux, etc.

Steps:
download the Unix Source at http://httpd.apache.org/download.cgi
extract the tar file
follow instructions on INSTALL file.
[EDIT]Sometimes when running commands on the terminal, you might get "Permission Denied" errors. This can be solved by typing in "su" which is like sudo, the equivalent of "Run as administrator" on Windows. After typing that in, you will have to enter your administrator password. When you have done this, type in the command that was unsuccessful earlier on.

Note: installing requires a gcc package (it's a C compiler). Click here for more details on getting the gcc.
Lacking the GCC generates a different error "No compatible C compiler found".

How To Change Your Keyboard Layout to Dvorak in Solaris

Got this from sinewalker .

Launch terminal by going to Applications>System Tools>Terminal.
Type in "xmodmap /usr/share/xmodmap/xmodmap.dvorak".
 You're done. =)

I'll update this later with a how-to on creating a script or batch file to automate this by autorun or at least make it easy. I'm running Solaris as a VM on a Windows host and I'm not sure if the xmodmap setting is permanent or otherwise.