Programming :: Script That Takes A Part Of A Log File And Emails It?

Mar 22, 2011

I work for a company that does remote computer support, we use VNC protocol to help our clients. I installed a VNC repeater that allows my clients to connect to me going through all firewalls and port forwarding. The linux VNC repeater outputs all connection information to /var/log/vnc.log and looks something like

Code:

UltraVnc Linux Repeater version 0.14
UltraVnc Tue Mar 22 03:37:02 2011 > routeConnections(): starting select() loop, terminate with ctrl+c
UltraVnc Tue Mar 22 03:37:12 2011 > acceptConnection(): connection accepted ok from ip: 55.555.555.55

[code].....

I need a script that reads this log file every so often (30 seconds to 5 minutes) and sends an email when an connection has been accepted. I looked into reading log files and got this so far

Code:

LOG=/var/adm/sqllog
while true
do
tail -100 $LOG | grep "ORA" > /dev/null

[code]....

View 10 Replies


ADVERTISEMENT

Programming :: Script To Copy Paste Text From One File To Another (overwriting Part Of The File)?

Apr 19, 2011

I have a .txt-file with ~50.000 lines of numbers, generated by a mathematics program. From this file, I need line ~ 1.100 to line ~16.000 (these lines are always the same btw, this may make the solution easier, dunno) to be copy/pasted to another file, where the lines ~500 to ~15.000 (also, every time the same) should be overwritten by the aforementioned lines...I haven't found or come up with anything that works yet, mostly I find solutions to copy everything from one file to another but I can't find something to specifically overwrite a part of a file with part of another.

View 4 Replies View Related

Programming :: Extract Part Of File Name?

Mar 26, 2010

I have this string ./DAT000728-652523058.job.I want to extract the no between DAT and - sign. I want 728. I dont want 000728.echo ./DAT000725-560162365.job | cut -d'T' -f2 | cut -d'-' -f1 I am getting 000728.string can be ./DAT326822-652523058.job also. then i need 326822

View 6 Replies View Related

Programming :: Replace Part Of A File With Another?

Jan 8, 2010

There are a few things I was wondering about (using tools available in bash):How to insert a file at at the specified location of another.How to copy a portion of a file between two lines matching a regex to another file (and/or making sed only work between two lines matching a regex)How would you do this?

View 2 Replies View Related

Programming :: What Is The Terminology Called Of A Binary Using A File That Is Not Part Of It's Self

Feb 14, 2011

What is the Terminology called of a Binary using a file that is not part of it's self? An example would be when a browser uses a HTML file for it's interface. The binaries code has to know how to find it and so on. I imagine that the applications binary uses a system call and that another application takes over.

View 1 Replies View Related

Programming :: Extract A Part Of Flat File In Shell Script?

Feb 12, 2010

My rquirement is I have a flat file with lot of lines on it.example:

line1
line2
line3

[code]....

View 8 Replies View Related

Ubuntu :: Rename A File Then The Entire File Is Selected And Not Only The First Part?

Feb 13, 2011

I'm using Ubuntu for about a half year. Currently version 10.10. The next problem I have with Nautilus: He have it in ListView. If I want to rename a file then the entire file is selected and not only the first part. So the file extension is also selected. I think this is a bug, whoich can be found on the Internet, but I do not find a solution. Does anyone here have a solution?

View 4 Replies View Related

Programming :: Cutting Last Part Of URL?

Dec 1, 2010

website.com/john/doe/index.htmlI need to cut that to say:website.com/john/doe/I am getting really close using sed, but I just can't get the syntax quite right.

View 2 Replies View Related

Ubuntu Installation :: After Dd From Full 15GB Part To 1.3TB Part, Shows Same Free Space?

Dec 8, 2010

I just used dd to clone a linux partition to a new hard drive, it had 800mb left on the old hard drive, after dd, new hard drive lists 1.29/1.3 terabytes full. Is this what happens by default in dd? How can I fix this?

View 1 Replies View Related

Programming :: Counter As Part Of Variablename In C?

Oct 24, 2010

is it possible in C to use a counter as part of a variable name?

View 2 Replies View Related

Programming :: Transposing Only Part Of Row Into Column?

Jul 8, 2011

I am trying to transpose the following row:

x1 x2 x3 x4

into

x1 X2
x3 x4

With tr '''' < file I can select all columns to become separate rows,but as you see x3 and x4 have to be grouped when transposing.Or should I use awk for this one?

View 1 Replies View Related

Server :: How To Access Local Part / Domain Part Of Email Address In Postfix's Main.cf?

May 24, 2010

I'm trying to figure out how to access the local part and the domain part of an email address in postfix's main.cf. For example, myname@mydomain.net has myname as the local part and mydomain.net as the domain part.I get the whole email address with %s. I want to speed up the lookups by writing better database queries.I've had no luck finding this in the otherwise well documented postfix.

View 2 Replies View Related

Programming :: Backupscript Takes Too Long?

Apr 19, 2011

Got some speed problems with my backup script, need to save 250GB data (28 network-shares (20 user homefolders included) - each one gets an own zip; approx. 100'000 files)Backupdata are stored on our nas that is embedded with mount -t cifs -o user,pw //networkadress /yet/another/backup/folderPacking process takes about 60! hours (on an intel xeon 3.0 GHz RHEL4 system) - connected via 100mbit networkzip -r /yet/another/backup/folder/asdf.zip /home/asdf/Is there a way to speed up this whole process? Saving via tar.gz instead of ziping?

View 2 Replies View Related

Software :: Server Hosting Different Part Of Web Site Must Appear As Part Of Domain

Jul 13, 2009

we have access to one domain name , 1 internet ip address and may servers hosting different part of site. I want them all to be accessed via same web site . some of the server in our network are embedded devices.they have their specific utility being hosted on that machine. So the severs are bound to be distributed . I just wanted to know how can I access them via single ip, domain name.

View 6 Replies View Related

Programming :: Check If A Part Of String Exist

Sep 27, 2010

I have a macro which I use with ROOT. In this macro I want to check if a part of string exist so I can ignore it inside a loop. So, inside a loop I want to have something like:

Code:
if (string == "pre_ti_data_bdt*" || string == "pre_ti_data_nn*")
continue;

but of course I cannot use * in this piece of code! How to do this trick in C++?

View 5 Replies View Related

Programming :: Calculate How Many Nanosecond The Process Takes

Apr 10, 2011

ı need to calculate how many nanosecond the process takes . must give the same value every time (c++) ubuntu 10.10 my system information:

*-cpu
description: CPU
product: Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz
vendor: Intel Corp.
physical id: 400

[code]...

View 6 Replies View Related

Hardware :: Is CMOSRAM Is Part On Mother Board Or Part Of RAM?

Jan 14, 2010

In bootseqence of linux, the first step is check the CMOSRAM(size 64bytes) setup for custmor setting. So i am just confused wether CMOSRAM is a part of motherboard or is a part of RAM itself.

View 4 Replies View Related

Programming :: Implement Some Part Of Codes To Use The GPU Of Graphic Card?

Sep 25, 2010

I wish to implement some part of my codes to use the GPU of my graphic card but I have no idea whether GNU as already implemented it (as for OpenMP). I mean, there are PGI Fortran compiler which embedded CUDA but I figure it's not free. I also wonder if that works only with ATI graphic cards or if for instance I can use my Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller.

View 4 Replies View Related

Programming :: Run A Part Of Code On Exit In A Shell Script?

May 14, 2010

How do i run a part of code on exit in a shell script?Suppose i have four echo statements like the following:

echo "Stmt 1"
echo "Stmt 2"
....some code goes here...

[code]...

View 2 Replies View Related

Programming :: Mistake With Sed Espression Is Saving Part Of Pattern?

Jan 20, 2010

got a textfile with : as delimiters in between fields. e.g.1:2:3:4:5:6Thomas Cruise:Johnavid:Peter:Betty:JaneThe names may or may not contain white spaces.I am required to substitute any one of these names in the file with a new one inputted by user.e.g. to change John to Johnny, David to Beckham, etc. without touching any of the other names in the same line. Just one at a time.So here's the sed expression I was trying out with:

sed -i "s/<(.:.:)David>/$1Beckham/" names.txt
I also tried:
sed -i "s/<(.*)David>/<1Beckham>/" names.txt

[code]....

View 24 Replies View Related

Programming :: Store Executable Code In The Value Part Of A Hash?

May 28, 2010

I was reading about Ruby code blocks, but it's all a bit hazy.My questions:1. Can you store executable code in the value part of a hash (err...associative array)2. If you did, how would you call the code?3. If you executed this stored code, would it be possible when doing soto pass in an object to the code that it could use?

View 1 Replies View Related

Ubuntu :: MUTT - Which Key To Refresh The Emails - Emails Are Got By IMAP ?

May 29, 2010

How to refresh and reload the list of email into MUTT ? Which key?

Additional: how to go to folder SENT of gmail ? and configureation eventually?

View 1 Replies View Related

General :: Dowload One Part Of A File From Web?

Aug 19, 2010

lets say there is one very big file on some server and i just want to download first 1MB. How can I do it on Linux ?

View 2 Replies View Related

Ubuntu :: Downloading A Part Of A File?

Nov 2, 2010

I know that the question could sound weird but...I was wondering if is possible to download one or more parts of a file.

For example, the first 10 mb, or the latter ones.

I know that there are some apps that let you do segmented downloads, but, is there anyone that let you choose the segment to be downloaded? If not, can this be accomplished with any linux command-line application?

View 4 Replies View Related

Programming :: Searching Thunderbird Emails & Extracting Information

Jun 8, 2010

I have a load of emails in my Thunderbird trash folder and some of them (all with a similar subject) I want to extract the email address for them and put in a text file. I have located the trash file but it seems that it is just a big flat file with a concatenation of all my emails in it, varying number of header lines etc etc - ie, something which really doesn't seem to suit awk, sed, grep etc.Does anyone know of any way this might be accomplished, or any third party tools which may help?

View 1 Replies View Related

Programming :: Moving Files To Directories Based On Part Of Filename?

Jul 6, 2010

I have a single directory of pairs of files, with the pairs sharing a string as the beginning of the filename:

SF1-27F1492R-clone01_T3_A18_001.ab1
SF1-27F1492R-clone01_T7_A20_002.ab1
SF1-27F1492R-clone02_T3_A19_003.ab1
SF1-27F1492R-clone02_T7_A21_004.ab1
...etc

I need to create a subdirectory for each pair then move the pair into the subdirectory.

I accomplished the first step using:

$find /foo -name '*T3*' -exec mkdir '{}.wrk' ;

I can use a regex to designate the pair and associate the directory, but how do I use regex in a path as the output of a move command?

View 7 Replies View Related

Programming :: Shell Scripts For Cutting And Pasting Part Of Data?

Mar 17, 2011

I have a tab-delimited txt file as below. It is part of the original file.Quote:

##Hello
##Welcome
#C1 C2 C3

[code]....

View 13 Replies View Related

Programming :: Perl - Remove A Part Of String Unit1/U800/o

Apr 13, 2011

In a file,

I need to remove a part of string: /o

string:

or

the string can be

here I need to remove /d2

So, I need to remove everything after when I get last /

View 4 Replies View Related

Ubuntu :: Download Only The Missing Part Of The File?

Aug 14, 2011

I downloaded a .gz file. The network was disconnected a few times during downloading. I resumed the download each time with wget -c option. However after all the downloading is over, an error occurs when I try to extract the .gz file. Is there any way I can download only the missing part of the file?

View 1 Replies View Related

Fedora :: Mounting Other File Systems Takes A While?

Jan 31, 2011

during the boot process mounting other file systems takes a while. Although it ends up resulting [OK] it was not like this before and it used to be was very fast. I took a look at /etc/fstab file which is posted below, and suspected that devpts is the problem. So I commented it out and reboot, but it wasn't helpful.

[Code]...

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved