Basics of Lex and Yacc
December 12, 2008 at 12:24 PM | Posted in LexYacc | Leave a commentFollow the below link to get start on Lex and Yacc.
http://www.ecst.csuchico.edu/~bhsteel/250/examplesHandout/handout.html
http://ds9a.nl/lex-yacc/cvs/lex-yacc-howto.htm
Compilation error
December 12, 2008 at 12:10 PM | Posted in Compiler | 3 CommentsError:
error: invalid storage class for function ‘function name’
error: expected declaration or statement at end of input
Reason: missing brace.
Solution:- Verify that all the open brace is properly closed in ‘function name’.
HOW TO FORWARD EMAILS
December 4, 2008 at 4:11 AM | Posted in Useful stuff | Leave a commentHOW TO FORWARD E-MAIL APPROPRIATELY
A friend who is a computer expert received the following directly from a system administrator for a corporate system. It is an excellent message that ABSOLUTELY applies to ALL of us who send e-mails. Please read the short letter below, even if you’re sure you already follow proper procedures..
Do you really know how to forward e-mails? 50% of us do; 50% DO NOT.
Do you wonder why you get viruses or junk mail? Do you hate it?
Every time you forward an e-mail there is information left over from the people who got the message before you, namely their e-mail addresses & names. As the messages get forwarded along, the list of addresses builds, and builds, and builds, and all it takes is for some poor sap to get a virus, and his or her computer can send that virus to every e-mail address that has come across his computer. Or, someone can take all of those addresses and sell them or send junk mail to them in the hopes that you will go to the site and he will make five cents for each hit. That’s right, all of that inconvenience over a nickel!
How do you stop it? Well, there are several easy steps:
(1) When you forward an e-mail, DELETE all of the other addresses that appear in the body of the message (at the top ). That’s right, DELETE them. Highlight them and delete them, backspace them, cut them, whatever it is you know how to do. It only takes a second You MUST click the “Forward” button first and then you will have full editing capabilities against the body and headers of the message. If you don’t click on “Forward” first , you won’t be able to edit the message at all.
(2) Whenever you send an e-mail to more than one person, do NOT use the To: or Cc: fields for adding e-mail addresses. Always use the BCC : (blind carbon copy) field for listing the e-mail addresses. This is the way the people you send to will only see their own e-mail address. If you don’t see your BCC: option click on where it says To: and your address list will appear. Highlight the address and choose BCC: and that’s it, it’s that easy. When you send to BCC: your message will automatically say “Undisclosed Recipients” in the “TO:” field of the people who receive it.
(3) Remove any “FW :” in the subject line . You can re-name the subject if you wish or even fix spelling.
(4) ALWAYS hit your Forward button from the actual e-mail you are reading. Ever get those e-mails that you have to open 10 pages to read the one page with the information on it? By Forwarding from the actual page you wish someone to view, you stop them from having to open many e-mails just to see what you sent.
(5) Have you ever gotten an email that is a petition? It states a position and asks you to add your name and address and to forward it to 10 or 15 people or your entire address book. The email can be forwarded on and on and can collect thousands of names and email addresses. A FACT: The completed petition is actually worth a couple of bucks to a professional spammer because of the wealth of valid names and email addresses contained therein. If you want to support the petition, send it as your own personal letter to the intended recipient. Your position may carry more weight as a personal letter than a laundry list of names and email address on a petition. (Actually, if you think about it, who’s supposed to send the petition in to whatever cause it supports? And don ‘t believe the ones that say that the email is being traced, it just aint so!)
(6) One of the main ones I hate is the ones that say that something like, “Send this email to 10 people and you’ll see something great run across your screen.” Or, sometimes they’ll just tease you by saying something really cute will happen IT AINT GONNA HAPPEN!!!!! (Trust me, I’m still seeing some of the same ones that I waited on 10 years ago!) I don’t let the bad luck ones scare me either, they get trashed. (Could be why I haven’t won the lottery??)
(7) Before you forward an Amber Alert, or a Virus Alert, or some of the other ones floating around nowadays, check them out before you forward d them. Most of them are junk mail that’s been circling the net for YEARS! Just about everything you receive in an email that is in question can be checked out at Snopes. Just go to http://www.snopes.com/
Imp Linux Comamnd
December 2, 2008 at 7:06 AM | Posted in Linux | Leave a comment1) stat – display file or filesystem status
2 zip -r
ex. zip -r test.zip test
3) ntsysv – simple interface for configuring runlevels
4) chkconfig – updates and queries runlevel information for system services
5) last – last, lastb – show listing of last logged in users
6) init, telinit – process control initialization
7) alias – It will list your current aliases. You can use unalias to remove the alias.
Few keyboard shortcuts
Ctrl+L = Clears terminal output. similar to clear command
http://web2linux.blogspot.com/2007/09/top-25-linux-commands.html
Creating a central syslog server
December 2, 2008 at 7:01 AM | Posted in Linux | Leave a commentConfigure syslog server and client on Linux(FC4 and FC8) box
Changes needed on the syslog client (machine that will accept syslog messages)
1. vi /etc/sysconfig/syslog
2. Change:
SYSLOGD_OPTIONS=”-m 0″
To:
SYSLOGD_OPTIONS=”-m 0 -r -x”
This change to the syslog daemon enables logging from remote machines and disables DNS lookups on incoming syslog messages.
Changes needed on the syslog server (machine that send syslog messages)
1. vi /etc/syslog.conf
Add the following lines:
# Send a copy to remote loghost
*.info @loghost
auth.* @loghost
Note: make sure that you do not have extra whitespace in the Solaris syslog.conf file. Separate the facility and severity from the location with either a single space or with tabs.
2. vi /etc/hosts
Remove any reference to “loghost.” By default, Solaris will configure each host to be its own loghost.
3. Send the syslogd process a SIGHUP signal (kill -HUP pid_of_syslogd).
If you are using DNS, you will want to add a DNS A record for your “loghost” server. Since it may already have an entry in DNS, you may wish to use a DNS CNAME record.
If you are using NIS in your environment, you may want to add “loghost” to your NIS hosts map.
Few advance vim commands
December 2, 2008 at 5:39 AM | Posted in Vim editor | 1 CommentFew important line mode commands
1) :!<cmd_name> – run cmd_name command and return.
2) :1,4 w >> <file_name> – append line 1 to line 4 of current file to file_name
3) :sh – go to shell. To come back back to vi type exit.
.4) :sp - To create more than one view point of same file.
for another file
:sp <file_name>
5)To avoid lot of extra white spaces into code, run the following before pasting the data.
:set paste – Pasting from GUI.
6) :e! – read a current file, discarding changes
:!e <file_name> – Edit file file_name with in vi,
Compiling the code within vi and going to errors
1) !w first save the changes
2) : make to run the “make”
3) :cn go to next error
4) :cp go to previous error
Code folding (escape mode)
zf5j – To fold 5 lines
zfa} – To fold a code block marked by braces {}, put the cursor inside the block and type zfa}.
zo/zO open fold
zc/zC close fold
Multiple clipbords
In visual mode,
to copy type “ay or “by or “cy and for paste “ap “bp “cp etc.
Hyper-Linking to include files:
- Place cursor over the file name (i.e. #include "fileABC.h")
- Enter the letter combination: gf
(go to file)
This will load file fileABC.h into vim.
Select and execute
Run command on selected lines only
:<range>g/<pattern>/<cmd>
runs command <cmd> on all lines in <range> where <pattern>
matches
g! or v works on NOT of above. That is execute <cmd> where
<pattern> doesnt match.
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.