This code is like using grep. However, grep only returns the lines that contain the actual text you are searching for. This code allows you to return x number of lines before and after the text you are searching for along with the line itself. This command came in handy searching for information in the uds log files.
nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}b{r[NR%b]=$0}' b=2 a=4 s="fetchHotel" file
b is the number of lines to print before the line encountered and a is the number of lines to print after the line is encountered.
s=”string” string you are looking for (in this case fetchHotel)
and file is the file you are looking in.
By Kris Chappell
Friday, January 25, 2008
Thursday, December 06, 2007
I found this new service,...
I found this new service, I was pointed to what it called jott. It is at http://www.jott.com. It is a new service. A friend at work pointed me to it. I thought you would like to know. Here is a link. listen
Powered by Jott
Powered by Jott
Friday, September 14, 2007
Google Hacks
Security Cameras
---------------------------------------------
inurl:"viewerframe?mode=motion"
intitle:"Live View / - AXIS"
inurl:IndexFrame.shtml "Axis Video Server"
inurl:LvAppl Intitle:liveapplet
intitle:"WJ-NT104 Main"
intitle:"enc-rz30 home"
Unspidered Sites
----------------------------------------------
"robots.txt" "disallow:" filetype:txt
Frontpage User Info
----------------------------------------------
inurl:_vti_pvt "service.pwd"
PHP Photo Albums
----------------------------------------------
inurl:"phphotoalbum/upload"
VNC User Info
----------------------------------------------
"vnc desktop" inurl:5800
Networked Printers
----------------------------------------------
inurl:"port_255" -htm
phpAdmin Accounts
----------------------------------------------
intitle:phpMyAdmin "Welcome to phpMyAdmin ***" "running on * as root@*"
---------------------------------------------
inurl:"viewerframe?mode=motion"
intitle:"Live View / - AXIS"
inurl:IndexFrame.shtml "Axis Video Server"
inurl:LvAppl Intitle:liveapplet
intitle:"WJ-NT104 Main"
intitle:"enc-rz30 home"
Unspidered Sites
----------------------------------------------
"robots.txt" "disallow:" filetype:txt
Frontpage User Info
----------------------------------------------
inurl:_vti_pvt "service.pwd"
PHP Photo Albums
----------------------------------------------
inurl:"phphotoalbum/upload"
VNC User Info
----------------------------------------------
"vnc desktop" inurl:5800
Networked Printers
----------------------------------------------
inurl:"port_255" -htm
phpAdmin Accounts
----------------------------------------------
intitle:phpMyAdmin "Welcome to phpMyAdmin ***" "running on * as root@*"
Thursday, July 19, 2007
Tuesday, June 26, 2007
Eclipse can detect null pointer reference
Eclipse has the ability to detect null pointer reference but it's not enable by default. To do so, go to the preferences. In the Java>Compiler>Errors/Warning page, click on "Potential programming problems". There's a "Null reference:" drop list.
You can set it to "Error", "Warning", or "Ignore".
In Eclipse 3.3 there's also a setting for "Potential null pointer access" in the same section.
You can set it to "Error", "Warning", or "Ignore".
In Eclipse 3.3 there's also a setting for "Potential null pointer access" in the same section.
Subscribe to:
Posts (Atom)