Hey all (long time), have a file with the following on each line (file is 10,000,000 lines per day):
"7605551212","17045551212","8665551212","context","17045551212","SIP/5060-f5dd3250","","Context","17045551212","2008-10-08 07:46:41","2008-10-08 07:46:41","2008-10-08...
Hey all, need some assistance on this one. Greets to all and thanks in advance (long time no post)...
So I have the following in a file
term permit_database_access {
from {
source-address {
aaa.aaa.aaa.aaa/32;
bbb.bbb.bbb.bbb/32...
Hey all, I've run into the following issue and was wondering if someone had set something like this up. If so would you be willing to provide the details... In order to avoid writing a paragraph, please see this diagram:
http://www.infiltrated.net/isaquestion.jpg
Any tips or pointers are...
Hey all, I'm currently configuring the following for a HOME CC* lab:
2 2612 Routers W/WIC-1T, (16F/64D (both)), Catalyst 5505 WS-X5530-E3A, ATM Dual MMF, 1 Pix 1 3640, 2 2501's... Any hints on what I might be missing? I figure I could snag a 29xx catalyst if necessary... Anyhow I'm planning on...
Alright all. (greets for the week). I have a question on sanitizing...
I have the following script looking at /var/log/secure (sometimes /var/log/authlog)
awk '!/invalid user/&&!/#/&& /\./&& !a[$0]++
{print "iptables -A INPUT -s "$13" -i eth0 -d eth0 -p TCP --dport 22 -j REJECT"}'...
bash function inside of an awk statement...
So I created a function called IPT ...
function IPT {
cat /etc/hosts.deny|\
awk '!/#/ &&
/./ &&
! a[$0]++
{print "iptables -A INPUT -s "$1" -i eth0 -d xxx.xxx.xxx.xxx -p TCP --dport 22 -j REJECT"}'|\
awk '/iptables/ && !/#/ && !/-s -i/'|sh
}...
$ awk '{print "'"}'
>
-bash2-2.05b$ awk '{print "\'"}'
>
-bash2-2.05b$ awk '{print ".'"}'
>
-bash2-2.05b$ awk '{print ".\'"}'
>
How am I escaping the ' character? I need to print a statement that contains the following:
awk '/403/ && /Request/{print "perl -pi -e 's/logged/"$3" logged/g'"}'...
no piping allowed
Alright, so a quick question about piping in awk...
awk 'a !~ $0; {a=$0}' (equivalent to uniq)
awk '! a[$0]++' (equivalent to uniq)
awk '/something/' (equivalent to grep something)
awk '!/something/' (equivalent to grep -v something)
So now I have a cdr file... Its normal...
Paste... Awk... Perl... Bash... Stumped on this
I have two files (Asterisk)
File one:
[1234]
type=friend
username=1234
secret=1234
host=dynamic
context=admin
mailbox=1234@anywhere
callerid="Anywhere" <1234>
nat=no
File two:
1234 Somewhere
I need to ensure that entries in file_one match...
I have a line sometimes it has 10 columns sometimes it can go to 30 columns... I need everything except fields 3, 4 and 5. Couldn't find an exisiting solution in these archives nor googling... Thanks
perl -e 'print $i=pack(c5,(40*2),sqrt(7600),(unpack(c,Q)-3+1+3+3-7),oct(104),10,oct(101));'
Hey all, I have a file something like this...
1:2:3:4:5:6:7:8
I want to be able to either replace 1 using awk or sed
awk -F ":" '{print "new_value",$2,$3,$4,$5,$6,$7,$8}' where the colons are retained.
new_value:2:3:4:5:6:7:8
Shortcut?
perl -e 'print...
Hey all (reposting this). I have 4500+ files all close to being the same they're all 27 lines long. I'm trying to do an inplace edit for one variable but I can't seem to finesse it...
I have the following line inside every file
238 INVITE sip:$user@$server SIP/2.0\r
The number 238 is always...
Hey all. I have 4500+ files all close to being the same. I'm trying to do an inplace edit for one variable but I can't seem to finesse it...
I have the following line inside every file
238 SOMETHING email:somewhere@someplace.com MAIL/4.2\r
The number 238 is always changing and I need to...
I have 2 2000 Windows servers spitting DNS (1 primary, 1 secondary), created a Windows 2003 server (DMZ) that I'm trying to connect to the 2000 servers. I get an error to the tune of "Cannot generate trust" or so. Any ideas on where to look? I can ping from the 2003 to the 2000's and vice...
Hey all something got me stumped...
I have a list of about 200 mac addresses in 0004F2061276 format. I need to enter the colon between:
00:04:F2:06:12:76 tried looking for everything but came up empty
perl -e 'print $i=pack(c5,(40*2),sqrt(7600),(unpack(c,Q)-3+1+3+3-7),oct(104),10,oct(101));'
Hey all, need advice on something...
Have machine A and machine B. Both have to monitor a specific term and react. Its being run from cron (*/1 * * * * /run/this/command)...
Machine B needs to tail -f /var/log/messages for the field "is dead" then react:
tail -f /var/log/messages|grep "is...
Hey all, I'm looking to make a quick (good looks not necessary) form which will take my argument and parse it out of a logfile, then print it back to the page I entered the command on...
Think of grep 20060925 /var/log/messages where in a little form I can enter the date. However, boolean grep...
Form justification...
Ive got the following table created and am trying to get it all to align properly... I though colspan and rowspan would do it but its not..
It prints as:
Field 1: ________
Field 2: ________
Field 3: _____
Field 4: ___
Field 5: __
Field 6: _____
Field 7: _____
Trying to...
I created a db query which works fine:
$db = new mysqldb("sample","root","","localhost");
$res2 = $db->query("SELECT b.id, c.fname, c.lname, c.creditcard, c.creditname,
c.creditexprmonth, c.creditexpyear, c.creditccv, bint.description...
I have a file with 106 entries on it most look like this:
1 25 34 36 42
I want to be able to number each line (this is easy awk 'NF{$0=++a " :" $0};{print}') but I'd like to add the sum of all numbers at the end so eg the entry would look like (normally awk '{s=0; for (i=1; i<=NF; i++)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.