Kannan's Weblog
Some Basic Desktop configurations
How to run Java in the same color bit depth as the console:
How to change the default color depth:
Change the default printer temporarily
Some useful commands on Solaris:
Resolution change
Useful commands related to printer on Linux
Create a snapshot of any image/window
Some
useful commands on Windows
Objective: This document aims at
- pointing out the different environment setups, flags needed to run 2D testsuites on various platforms
- getting familiarised with the different commands and setups on different os.
- troubleshooting the different problems that may arise during test execution.
The
information given here may not be common to all the Sparc Solaris (2.6,
2.7, 8, 9) machines, but a majority of them should work.
Some of the commonly
used framebuffers and the command for each on Sparc Solaris are as below:
| Framebuffers(Graphics card) | Command |
|---|---|
| ffb (Creator3D ) | ffbconfig |
| afb (Elite3D) | afbconfig |
| ifb (Expert3D) | ifbconfig |
| m64 (PGX8, PGX24) | m64config |
| GFX(PGX 32) | GFXconfig |
More details about graphics card:
To get an idea of
what framebuffers are available in your machine, type 'ls -l /dev/fbs'
and you can guess on the framebuffers by looking at the list available.
For e.g. on my machine, the above command gave the following output:
- afb0-> ../../devices/SUNW,afb~1e,0:afb0
- m640-> ../../devices/pci@1f,0/pci@1,1/SUNW,m64B@2:m640
Resolution:To get the current resolution and the set of supported resolutions, type <command name> -prconf.
For e.g. if the machine has a 'afb' framebuffer, type 'afbconfig -prconf'.
Resolution change: To change the resolution do the following:
e.g. m64config -res 1152*900*76 now -depth 24 (assuming PGX24 is the framebuffer, I have)
The syntax would be similar for most of the framebuffers.
Color
depth: To
get the current color depth, type 'xwininfo' at the command prompt. The
cursor waits for the user to click the mouse on the window whose color
depth he/she needs to know. Click on the window and the tool dumps out
a lot of information including the color depth.
FYI: /usr/openwin/bin/xdpyinfo could also be used for displaying the color depth of the current window.Color depth change: This is an interesting feature for Java applications running on Sparc Solaris.Note: On Solaris unlike windows, different windows could be running on different color bit depth.
Important: Java always tries to run applications in the best color depth(not resolution) possible on Solaris.
So if my machine supports 8, 16, 24 bit color depths and the console from where the Java app is launched is in 8 bit, the application would still be running on 24 bit color depth. You can verify this by using the xwininfo command (as mentioned above).
How to run Java in the same color bit depth as the console:
set the environment variable FORCEDEFVIS and launch the Java application.
How to change the default color depth:
modify /etc/dt/config/Xservers file by changing the value of 'defdepth' parameter and restart X server.
On the desktop, you would generally find the 'Personal Printers' menu which has normally 3 printer related options
- Default -> shows the default printer where all printjobs will be redirected to, if printed without selecting any printer from the print dialog.
- Printer Selector -> invokes a 'Printer Selector tool' dialog displaying a list of all the printers on the network. The user can select any printer from the 'All Printers' list, add it to the 'Selected Printers' and change the default one by clicking on the 'Change Default' button. Click on 'Save Changes' button and restart Xserver to get the changes into effect.
- Print Manager -> shows the status of each print job on all the connected printers. The user has the option to cancel a print job in the queue using 'Print Manager' tool.
- Default -> /usr/dt/bin/dtprintinfo
- Printer Selector -> /usr/dist/share/cue,v2.1.6/tools/std/printer_selector
- Print Manager -> /usr/dt/bin/dtprintinfo -all
- setenv LPDEST <printer name> (assuming cshell here)
- Launch your application
The
information given here may not be common to all the different flavors of
Linux (RedHat, Suse, Caldera, Mandrake, Turbo...) but a majority of them
should work. Commands specific to certain Linux flavors have been specified
wherever possible.
find the runlevel
of your machine (usually it's 5 on most Linux machines with X11 running)
ntsysv
displays all the services and the status of each (on/off).
Runlevel determines the mode on which the machine has been booted and is currently running. To determine the runlevel of your machine, foll the steps below:
- open /etc/inittab file.
- Look for the entry 'initdefault:'
- The format would be like 'id:<number>:initdefault:
- The value of <number> is the runlevel of your machine.
| Runlevel | Mode |
|---|---|
| 0 | Halt |
| 1 | Single user |
| 2 | Multi user (without NFS) |
| 3 | Multi user (with NFS) |
| 4 | unused |
| 5 | X11 |
| 6 | reboot |
To determine the graphics card on Linux (RedHat), follow the steps:
- cd /etc/X11
- open XF86Config (XF86Config-4 on RedHat 7.0 and higher) and search for 'Section Screen'
- The 'Device' subentry contains the video card name.
To determine the current resolution on Linux (RedHat), follow the steps:
- cd /etc/X11
- open XF86Config (XF86Config-4 on RedHat 7.0 and higher) and search for 'Section Screen'
- The 'Modes' subentry under 'Display' subsection represents the resolution.
To determine the current resolution on Linux (RedHat), follow the steps:
- cd /etc/X11
- open XF86Config (XF86Config-4 on RedHat 7.0 and higher) and search for 'Section Screen'
- The 'Depth' subentry under 'Display' subsection represents the color depth.
There are different tools for setting up printer on different linux versions.
Some
commands that I know of:
| Linux version | Command |
|---|---|
| RedHat Linux (any version) | printtool |
| Turbo Linux | turboprintcfg |
| Caldera Linux | kups(GUI) or cupsd(command line) |
| Mandrake Linux | /usr/bin/printtool or /usr/sbin/printerdrake |
| SuSE Linux |
/sbin/yast
(for configuring anything not only printer)
|
Trick: Generally (but not on all linux machines), you would find the printer command for adding/editing/deleting a printer from the /etc/printcap file.
e.g. for RH Linux (7.0 & higher)
- type 'printtool' at the console.
- Click on 'New' icon. It brings up a 'Edit Queue' dialog.
- Type any name under 'Name and Aliases'->'Queue Name'
- Enter printer server name under 'Queue Type'->'Server'
- Enter printer name under 'Queue Type'->'Queue'
- Select the appropriate driver under 'Printer Driver' category
- Click on 'ok'. This goes back to the first dialog.
- Save the changes by selecting 'File'->'Save Changes'.
- Restart the lpd with 'File'->'Restart lpd'
- Test the printer by selecting any of the option from 'Test' menu.
- If the printer works, you are all set to use the printer.
Restart lpd from command line:
To manually restart lpd from command line, do the foll:
lpq gives status of all the printjobs.
/net/sqesvr/deployment2/kannan/tools/linuxver
Some useful commands on Linux:
Note: The commands below may not be applicable on all the different flavors of Linux .
ifconfig -a -> displays the ip address
The best way to know all the hardware details about your PC is by using 'belarc' software.
Go to http://www.belarc.com and download the 'belarc advisor'. The installer after installation would show all the details about your PC.
On most of the Windows platform, the common way to find out the graphics card is as follows:
- Right click on the desktop.
- Click properties and the 'display properties' dialog pops up.
- Select the Settings tab.
- you should be able to find the graphics card name below the Display label.
- Open command prompt
- Type 'debug' and press <ENTER> key.
- At the '-' prompt, type 'd c000:0'
- You would possibly see the graphics card name on the right. If it still doesn't appear, type 'd' once or twice and the name should certainly appear.
To get the current resolution and all possible resolution follow the steps 1-3 in 'Method 1' of Graphics card section.
Find
the value of the current resolution in the 'Screen Area' label. Click/drag
the slider to change the resolution.
To get the current color depth and all possible color depths follow the steps 1-3 in 'Method 1' of Graphics card section.
Find the value of the current color depth in the 'Colors' drop down box. Select a different color depth to change its value.
To select a different driver (other than the existing for a connected printer):
- Right click on the printer(whose driver needs to be changed) icon.
- Select 'properties' option.
- Install a new printer driver from 'Advanced'->'New Driver' button.
- select the printer icon (which has to be made the default).
- Right click on the icon
- Click on 'Set as Default Printer'
- The selected printer becomes the default printer.
Create
a snapshot of any image/window:
- Select the window you want to take snapshot of.
- Press Alt-PrintScreen key combination on the keyboard. The image gets copied on to the clipboard.
- Open any image viewer (like paintbrush or PaintShopPro) and do a paste(Ctrl-v). The image could then be saved in any format supported the viewer.
Some
useful commands on Windows:
ipconfig /all -> displays the ip address on command line.
Kannan Balasubramanian
Posted at 11:25PM Aug 09, 2006 by Kannan Balasubramanian in Sun | Comments[2]
Posted by A. Sundararajan on August 11, 2006 at 09:42 AM IST #
Kannan
I like your site. Very impressive and useful. I am a mainframe professional. We are hosting LPAR master consoles using TN3270 port connectivity in SUSE desktop.
One of this pc is rebooted and restarted up to login. It supposed to connect to graphics and brought up KDE desktop, but not.
qn1. how i can init KDE from user promt or root.
qn2. how i can restore the network by restarting/ or resetting the network devices. thanks suresh
Posted by suresh ninan chacko on November 02, 2008 at 08:15 PM IST #