Wednesday, June 29, 2005
Printing Solaris Diagnostic Information
NAME
prtdiag - display system diagnostic information
SYNOPSIS
/usr/platform/platform-name/sbin/prtdiag [-v] [-l]
DESCRIPTION
prtdiag displays system configuration and diagnostic infor-
mation on sun4u systems.
The diagnostic information lists any failed field replace-
able units (FRUs) in the system.
The interface, output, and location in the directory hierar-
chy for prtdiag are uncommitted and subject to change in
future releases.
platform-name is the name of the platform implementation and
can be found using the -i option of uname(1).
Note:
prtdiag does not display diagnostic information and
environmental status when executed on the Sun Enter-
prise 10000 server. See the
/var/opt/SUNWssp/adm/${SUNW_HOSTNAME}/messages file on
the system service processor (SSP) to obtain such
information for this server.
OPTIONS
The following options are supported:
-l Log output. If failures or errors exist in the system,
output this information to syslogd(1M) only.
-v Verbose mode. Displays the time of the most recent AC
Power failure, and the most recent hardware fatal
error information, and (if applicable) environmental
status. The hardware fatal error information is useful
to repair and manufacturing for detailed diagnostics
of FRUs.
EXIT STATUS
The following exit values are returned:
0 No failures or errors are detected in the system.
1 Failures or errors are detected in the system.
2 An internal prtdiag error occurred, for example, out
of memory.
SunOS 5.9 Last change: 19 Dec 2001 1
System Administration Commands prtdiag(1M)
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | SUNWkvm |
|_____________________________|_____________________________|
SEE ALSO
uname(1), modinfo(1M), prtconf(1M), psrinfo(1M), sysdef(1M),
syslogd(1M), attributes(5), openprom(7D)
Installing mod_perl with apache
command to fire
perl Makefile.PL APACHE_SRC=../apache_1.3.33/src APACHE_PREFIX=/local/apache-1.3 DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
-Kalyan
Sunday, June 26, 2005
StringTokenizer in C#
what to use then?
string line = "practice of programming";
string values[] = line.Split(' ');
values will have the results .. delimited by space
-Kalyan
Saturday, June 25, 2005
A bit of preliminary C#
1. Read a text file.
2. Insert only the first entry for the user in a Database table.
3. Run analysis services for clustering results
Text files are read and written through the StreamReader and StreamWriter classes. There are various ways to create instances of these classes—for example,
string file_name = @"C:\fictions\gnome.txt";
StreamReader freader = File.OpenText( file_name );
StreamWriter fwriter =
File.CreateText( @"C:\fictions\gnome.diag" );
string text_line;
while (( text_line = freader.ReadLine() ) != null )
{
// Instead of this I want to insert it in a database table
// write to output file
fwriter.WriteLine( text_line );
}
// must explicitly close the readers
freader.Close();
fwriter.Close();
How do i do SQL Server programming usin C# ( did it before but forgot .. :) )
From c-sharpcorner.com
using System;
using System.Data;
using System.Data.SqlClient;
namespace SimpleSql1
{
class Insert
{
[STAThread]
static void Main(string[] args)
{
SqlConnection conn = new SqlConnection("Data Source=Computername;"+ // TODO: change comp name
"Initial Catalog=simplesql;"+
"User ID=sa;"+
"Password=pass;");
string strText = Console.ReadLine();
try
{
SqlCommand cmd = new SqlCommand();
cmd.CommandTimeout = 60;
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT Count(*) FROM simplesql";// Couldn't do it without sorry
conn.Open();
if (conn.State == ConnectionState.Open)
{
object objCount = cmd.ExecuteScalar();
int iCount = (int) objCount;
Console.WriteLine("Count was succesfull");
cmd.CommandText = "INSERT INTO simplesql (simple_id, simple_text) VALUES ("+
iCount +",'"+ strText +"')";
cmd.ExecuteScalar();
Console.WriteLine("Succesfully inserted the string");
}
}
catch (Exception exp)
{
Console.Write(exp.Message);
}
finally
{
conn.Close();
}
Console.WriteLine("\n\n Press any key to quite");
Console.Read();
}
}
}
Friday, June 24, 2005
Installing plugins for firefox and Acrobat Reader 7
Well ofcourse you can get your hands dirty by building it from source.
2. How do I install plugins:
A smart trick to do that : about:plugins (shows which all plugins are installed for firefox)
And the firefox install has a plugins directory,
1. For installing macromedia, copy the flashplayer.xpt and libflashplayer.so into the plugins directory of firefox.
2. For java we can make a symbolic link.
ln -s libjavaplugin_oji.so
Installing Acrobat Reader 7 on solaris, it conflicts with the LD_LIBRARY_PATH .
A GOOD PHILOPSHY of running a program is provide a script and let the user modify the script , in acroread , is a script and in the script i unset the LD_LIBRARY_PATH ( so that is pretty fascinating)
-Kalyan
Thursday, June 23, 2005
Unix File Compression Utilities
File Utilities
Archiving and Compressing Files
On UNIX and Linux systems, gzip is probably the most common compression program. The newer but less common bzip2 gives significantly better compression. To compress a single file,
[any UNIX machine]$ bzip2 filename |
[machine with GNU tar]$ tar cfj dirname.tar.bz2 dirname |
[any UNIX machine]$ tar cf - dirname | bzip2 -c >dirname.tar.bz2 |
You can give several file and directory names to the tar command. It is a good practice, though, to keep everything in one toplevel subdirectory, to avoid “polluting” the current directory when later extracting the archieve. (Imagine that you extract an archieve with hundreds of files into your home directory. There is a real chance of overwriting existing files, and it may take some time to move files to a more proper place.)
To uncompress the “.tar.gz” and “.tar.bz2” files,
[any UNIX machine]$ bunzip2 -c dirname.tar.bz2 | tar xf - |
Wednesday, June 22, 2005
Finding Open Oracle Connection
select * from v$session where username= ?,
v$session is the table to watch out for?
-Kalyan
How to enter passwords in shell?
stty -echo
read password
stty echo
echo
Need to find as to which oracle seesions are active, need to kill session which are of particular user.
SQLPLUS + SHELL scritps
Tuesday, June 21, 2005
What is the shell?
http://www.softlab.ntua.gr/facilities/documentation/unix/shelldiff.html#6
Friday, June 17, 2005
Things to do list for the SysAdmin thing and misc
2. RT issues ( Move apache to /local and my sql in future too).
3. Installing a weblog.
4. Oracle user creation scripts with sharing tablespace feature which makes the life of admin simple.
5. Sed and Awk and their uses.
Other Things to be taken care of:
1. Estimate for text clustering using MS SQL Server 2000 Analysis Services.
2. Proposal with co-training and hypergraph clustering, the algorithm, timeline and conclusion.
3, N-order markov chains
4. Sensor net paper
5. Adding the dm3dcube thing to CVS
6. Ading preproposal to CVS
More Misc:
1. PIE
2. WMMF
3. PP
4. MPP
5. NIS and NFS
Installing a WebLog
I am comparing various webloggers and evaulating them :
1. Roller Weblogger ( This is written in java and should be platform independent because of the java portability) Installation is supposed to have tomcat in it which kinda i think is supposed to take more time.
2. So i need a more simple life and looking at other options of installing the software. Currently i am interested in looking into the weblogger which only involves using the apache configuration.
-kalyan
Thursday, June 16, 2005
UNIX Revisited
2. Scripts are placed in /etc/init.d and they are linked to /etc/rcX.d
3. Soft links are created from init.d to rcX.d
Wednesday, June 15, 2005
Concept Hierarchy
Eclipse plugin install:
Plugin install for eclipse is get the zip and install it in the directory of plugins and directory of features
Eclipse
1. plugins
2. features
Extract the files into these directories.
-Kalyan
Request Tracker Biggest Issue
Things which i have tried and which does not work
1. User and group setting in web apache server ( www and other , kosh and other does not solve the purpose)
2. Putting the rt-mailgate entried in /etc/mail/aliases that too does not serve the purpose
3.
Monday, May 23, 2005
Concept HiearArchy
Concept hierarchy is also important
Discovered knowledge might be more understandable when represented at high level of abstraction
Interactive drill up/down, pivoting, slicing and dicing provide different perspective to data
Different kinds of knowledge require different representation: association, classification, clustering, etc.
Monday, May 16, 2005
Writing a Good Technical Paper
From stanfords site
The Actual Paper: Writing
- start from the outline.
- Make the outline reflect the level of subsections: for each subsection, write no more than two lines describing the purpose/goal of that subsection. This text will NOT be part of the paper - it is only there to remind you what you are trying to accomplish. It is ESSENTIAL that you be able to capture the purpose of a subsection in one or two lines. If you cannot do this, then you probably don't understand what the subsection is really about, and when you try to write the text, it will be jumbled.
- Then, for each subsection, map out specific paragraphs: for each paragraph, write one sentence that explains the topic or main goal of just that paragraph. Again, this sentence probably will NOT make it into the actual text. It's important to keep it to one sentence. (As every style manual will tell you, including Strunk & White, virtually every well-formed paragraph does indeed have one sentence that explains the point of the paragraph, with the other sentences supporting or expanding on the point of the topic sentence.) If you cannot fit the point of the pargraph into 1 sentence, the paragraph is probably making >1 point, so should be split into multiple paragraphs.
- Read through everything you have written and see if it has a logical flow, ie if you believe it represents your work adequately.
- Give what you have written to a technical colleague completely unfamiliar with your work (but able to understand the computer science part), have them read it, then have them tell you (without looking at it) what s/he thinks the main point and contributions are.
- If all goes well, now replace the topic sentences with complete paragraphs.
This way of writing will not yield a shakespearean work of literature, but it is consistent and will result in readable, logically organized prose by construction.
The Actual Paper: Revising/Editing
- Your section organization will change. Sometimes it will be shuffled dramatically. This is fine; it means you're understanding what presentation order works best. If you don't go through at least three or four major revisions (where you move around or chop entire sections), it's probably lousy.
- After doing some edits on each draft, give it a full top-to-bottom reading to evaluate its coherence and flow of ideas. Then, take a couple of hours and do something else; once you get close enough to your paper, you start missing the forest for the trees.
- Even early drafts are valuable for getting your colleagues' comments. Get comments from people who you think may be skeptical of your approach. Get comments from people who will really rip your writing style apart. Remember, at least they are your friends; the conference referees probably are not.
- Cite, cite, cite! Ask your colleagues for suggestions and pointers. You never want to be asked: "What about the work done by xxx, which obviously has something in common with your own?" (or worse: "...which refutes your own?") Give due credit to those whose efforts you build on, as well as pointing out how your approach is different from (and better than) previous ones.
About Writing
It's often said, correctly I think, that most technical people don't write well. This doesn't mean that they lack knowledge of grammar or spelling (though this is sometimes the case), but that they don't know how to organize their writing at the level of paragraphs.
- Don't artificially formalize your writing style. Technical writing must be clear and concise. Overblown writing rarely fools anyone and it makes the paper boring to read.
Bad: "Problem X is clearly a critical area that impacts our research agenda and hypothesis. Our ideas about problem X are embryonic and still evolving, and doubtless our ongoing work in this area will quickly yield fruitful results."
Better: "We recognize that problem X is central to our agenda, but we have only begun to investigate it." - If you haven't read Strunk and White's The Elements of Style, read it now. If you have, read it again. If you can't organize a paragraph, you won't have much luck organizing a chapter.
- Omit needless words. Don't be surprised if this turns out to be 30-40% of the words you originally wrote. Your first effort rarely captures the most vigorous or concise way to say something. Spend time tersifying.
- Run your paper by someone who is anal retentive about grammar to catch common errors: misuse of which and that, non-words and non-phrases such as for all intensive purposes or irregardless, lack of parallel sentence structure...
Final Checks
Remember that this will be read by people who (a) have never heard of you and the review is anonymous anyway, (b) have never heard of your project, (c) are reading about 15-20 papers apiece, all in different subject areas. They will spend the first 5 minutes deciding if your paper is actually good enough to be worth a fully detailed read; they will then spedn an hour or so reading it in detail, trying to figure out (a) what your contribution is, (b) if the contribution is substantial enough to be worth publishing, (c) if the contribution is "feasible" (ie it is implementable and therefore would be useful to someone).
- Does the paper make clear precisely what your new contributions are, and how they are different/better than existing approaches to this or similar problems?
- Does the outline of the paper (sections, subsections, etc.) cohere regardless of the granularity at which you view it? (The Outline mode of MS Word is a valuable feature for this check. I also wrote a simple Perl script that does this for LaTeX files.)
- Have you observed the following invariant: Before telling me what you did, tell me why I should care.
- Have you made every important point three times--once in the introduction/abstract, once in the body of the paper, and once in the conclusions? (Bulleted conclusions are usually a good idea)
- Have you had it read by at least one person familiar with each of the areas the paper impinges on? (Think of them as consultants in that area. There is a risk that you will get some of the details wrong in talking about an area that is tangential to the paper but that you're not very familiar with, and if a reviewer happens to be versed in that area, it decreases your credibility. Such references are easy to get right, so there is no excuse.)
- Have you searched carefully for any related work, and properly acknowledged it? The availability of papers and search indices on the Web makes it worse than ever to overlook significant related work.
- Are you able to capture the non-experts in the audience with the opening of your paper, and impress the experts in the body of the paper?
- Can you read only the abstract and conclusions and be able to give someone else a 30-second digest of what the paper claims it says?
The Mac OS X Kernel
/college/silberschatz/0471694665/appendices
/appb.pdf
Sunday, May 15, 2005
XML Exam Fever Contd.... (XPATH)
XPATH could be thougt of as like traversing the unix file tree structure and commands to traverse the tree
XPATH identifies the following 7 types of nodes
i) The root
ii) Elements nodes
iii) Attribute nodes
iv) text nodes
v) Comment nodes
vi) Processing instruction nodes
vii) Namespace nodes
XPATH is used to traverse the XML document or parts of the XML document.
XML declaration and the DTD are not addressable via XPATH.
The grammar of XPATH could be shown in this fashion
location-path: "/"? location-step ( "/" location-step )*;
location-step: axis "::" node-test ( "[" predicate "]" )*;
XML Exam Fever Contd....
Today I shall talk about XSL
1. XSL as we know contains of the
i) XSLT
ii) XPATH
iii) XSL-FO
Now XSLT has the following builtin templates
1. < xsl:template match='/|*' >
< xsl:apply-templates >
< /xsl:template match >
Arranges for visit on all elements
2. < xsl:template match='text()|@*' >
< xsl:value-of select='.' >
< /xsl:template match >
Arranges to output the text nodes however attributed are not visited by default
3. < xsl:template match='processing-instruction()|comment()' />
Skips the processing instructions and comments in the document.
-Kalyan
Saturday, May 14, 2005
XML Exam Fever Contd...
Some of the characteristics:
1. A document mus have one root element.
2. Elements must not overlap.
3. Attributes must be quoted.
4. Cannot have two attributes with the same name
5. The data of < and and signal need to be escaped.
6. Every start tag must have a matching end tag/
7. Comments and processing instructin may not appear inside tags
I like to end the chapter in punch line so here is the punch line for the chapter
XML names can have numbers of alphabets, the following special characters are the only special characters allowed
i) underscore (_)
ii) Hyphen (-)
iii) fullstop .
Element names cannot start with the following
Hyphen, . , number and they cannot have any other special characters other than those mentioned.