Showing posts with label configuration. Show all posts
Showing posts with label configuration. Show all posts

Wednesday, January 06, 2010

Random Ubuntu console notes

 

Turn off beeps: http://www.cyberciti.biz/faq/how-to-linux-disable-or-turn-off-beep-sound-for-terminal/

Framebuffer

http://tldp.org/HOWTO/Framebuffer-HOWTO.html

http://www.mat.univie.ac.at/~gerald/laptop/vesafb.txt

 

Change resolution: http://ubuntuforums.org/showthread.php?t=215566
http://www.mepis.org/node/2992
http://en.wikipedia.org/wiki/VESA_BIOS_Extensions#Linux_video_mode_numbers
http://www.linuxquestions.org/questions/ubuntu-63/console-session-very-large-text-font-598857/
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/246269
http://ubuntuforums.org/showthread.php?p=5400183

vga=ask   to ask the user to choose mode


Solution: http://ubuntuforums.org/showthread.php?p=3826742

Setup console: http://ubuntuforums.org/showthread.php?t=329369&highlight=boot+console+font

console-setup

Install fonts, script and services

fonts are installed to /usr/share/consolefonts/
script: /bin/setupconm /usr/bin/ckbcomp
services: /etc/init.d/console-setup, /etc/init.d/keyboard-setup (they are installed to rcS.d)

Configuration:
1) $HOME/console-setup
2) /etc/default/console-setup
Note: if 1) exists, 2) will not be executed at all!!!

console-tools vs. kbd

console-tools provides consolechars. However consolechars cannot recognize some fontfaces provided by console-setup.
console-tools installs service console-screen.sh, makes dumpkeys process file /etc/console-tools/remap
update-rc.d console-screen remove
For example, I tried
consolechars –v –f /usr/share/consolefonts/Uni3-Terminus20x10.psf.gz --tty=/dev/tty5

It gives error

Cannot (yet) load a non-seekable RAW file
read_simple_font(): Invalid argument

I found this post http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg154310.html

I installed kbd (sudo apt-get install kbd). console-tools is automatically removed when you install kbd. Then I tried

setfont –v /usr/share/consolefonts/Uni3-Terminus20x10.psf.gz

It works!!.

kbd installs bunch of commands,

configuration: /etc/kbd/config, /etc/kbd/remap
kbd installs service console-screen.kbd.sh (installed to rcS.d)

Note: for both of console-tools and kbd, the installed services won’t be run if setupcon is present. In other words, if console-setup is installed, services installed by console-tools or kbd don’t run.

So, usually you should edit file /etc/default/console-setup to change configuration!!! Or copy it to your home directory.
Then use command
setupcon
to make it take effect immediately.

http://www.robodesign.ro/mihai/blog/customize-your-linux-terminal

apt-get install hwinfo 
sudo dpkg-reconfigure console-setup
consolechars
setupcon

 

apt-get remove pkgname

dpkg –purge pkgname

apt-get purge pkgname

Monday, June 30, 2008

Change font in PDT

The way to change font in PDT is not intuitive.  PDT does not support configuration of font itself. Instead, it inherits global configuration. By click "windows->preference->Apperance->Colors and Fonts", you will get:
image 

Although there are two entries related to PHP, they are useless in fact. You can not configure them. Instead, you may think configuration of entry "Basic" should work. But, you are wrong. You should configure entry "Structured Text Editors" to configure fonts which will be used by PDT PHP editor. I don't why PDT chooses to inherit font setting from "Structured Text Editors".

Sunday, March 16, 2008

Configuration Of Tomcat

(Part of this post is cited from Tomcat Offcial site)
    I have been using Tomcat as JSP/Servlet container in current project. However, I have not got full understanding about Tomcat configuration. Every time I need to modify configuration, I search on the web and learn those related elements. I don't have a big picture about it. To fully understand the configuration, I read through official document at this site http://tomcat.apache.org/tomcat-6.0-doc/config/. And as I expect, it helps me a lot.
The configuration file of Tomcat is $TOMCAT_HOME/conf/server.xml.
(1) Server

Root element is server.
(2) Service
    A Service element represents the combination of one or more Connector components that share a single Engine component for processing incoming requests. So it looks like a container to enclose related Connector and Engine.
(3) Connector
    Connector receives requests from clients. There are two kinds of connector:HTTP and AJP.
HTTP Connector enables Tomcat to function as a stand-alone web server. An instance of connector listens for connections on a specific port number. One service can contain more than one connector. Normally, every connector maintains its own thread pool. However, this can be altered by setting property executor. If so, the connector will use the executor and all thread related properties are ignored. One advantage of using executor is that it can shared between components.
    "Each incoming request requires a thread for the duration of that request. If more simultaneous requests are received than can be handled by the currently available request processing threads, additional threads will be created up to the configured maximum (the value of the maxThreads attribute). If still more simultaneous requests are received, they are stacked up inside the server socket created by the Connector, up to the configured maximum (the value of the acceptCount attribute. Any further simultaneous requests will receive "connection refused" errors, until resources are available to process them."
    If SSL on HTTP is needed, corresponding connector element should be modified. Property redirectPort can be used to redirect SSL request received by a plain connector to another connector which supports SSL.
(4) Engine
    Following all connector elements in a service component is engine element. Engine element represents processing machinery associated with a service. It gets and processes all requests from connectors and returns the response to Connector. Note: exactly one engine element should be defined inside a service element.
(5) Host
    Inside engine element, multiple host elements can be nested. Each host element represents a virtual host. At least one host is required, and one of the hosts MUST match value of property defaultHost of engine element. Element alias can be used to give alias. Property appBase is used to specify application base directory of the virtual host. Properties deployOnStartUp and autoDeploy can be configured to set functionality of auto-deployment.
(6) Context
Context element represents a web application which is run inside a certain virtual host. "Each web application is based on a Web Application Archive (WAR) file, or a corresponding directory containing the corresponding unpacked contents, as described in the Servlet Specification (version 2.2 or later)." However, in high version of Tomcat, Context elements do not need to written in server.xml. Detailed information is:
    "For Tomcat 6, unlike Tomcat 4.x, it is NOT recommended to place <Context> elements directly in the server.xml file. This is because it makes modifing the Context configuration more invasive since the main conf/server.xml file cannot be reloaded without restarting Tomcat.
Context elements may be explicitly defined:
  • in the $CATALINA_HOME/conf/context.xml file: the Context element information will be loaded by all webapps
  • in the $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default file: the Context element information will be loaded by all webapps of that host
  • in individual files (with a ".xml" extension) in the $CATALINA_HOME/conf/[enginename]/[hostname]/ directory. The name of the file (less the .xml extension) will be used as the context path. Multi-level context paths may be defined using #, e.g. context#path.xml. The default web application may be defined by using a file called ROOT.xml.
  • if the previous file was not found for this application, in an individual file at /META-INF/context.xml inside the application files
  • inside a Host element in the main conf/server.xml

How to map incoming request to specific web app?
    "The web application used to process each HTTP request is selected by Catalina based on matching the longest possible prefix of the Request URI against the context path of each defined Context. Once selected, that Context will select an appropriate servlet to process the incoming request, according to the servlet mappings defined in the web application deployment descriptor file (which MUST be located at /WEB-INF/web.xml within the web app's directory hierarchy)."

Deployment
    If you want to develop and deploy your JSP/Servlet applications, consult this page: http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html. It contains information about: Standard directory layout, where to put shared libraries, web.xml and deployment. This link also contains some useful information: http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#Automatic%20Application%20Deployment.

Configuration of virtual host:
http://hi.baidu.com/zouziting/blog/item/7e3ad7808f3491d79123d936.html