Tag Archives: INPUT

New Well Installation

By number19

Name:  pumppipelayout.jpg
Views: 0
Size:  21.3 KB
Everything I read everywhere says to slope the INPUT piping from the WELL UP to the PUMP so you do not create pockets to trap air.
Recently, my neighbor had a new well and sprinklers put in.
The new well had to be further away from the house.
The installers put piping in which seems a little unconventional to me.
The check valve is above the ground level about two feet.
Then the piping goes back underground for about 18 feet or so.
The system seems to work just fine.
I am wondering if others have seen this, and/or is this the NEW way of doing it?
It seems like that the piping underground would create sort of a container to hold significant water, which might actually HELP the pump to keep it’s prime better.
Any thoughts on this?
Name:  pumppipelayout.jpg
Views: 0
Size:  21.3 KB
Attached Images

…read more

Source: DoItYourself.com

iptables ACCEPT & REJECT

By Lost in Cyberia

File Type: png
Hey everyone, something curious I found. I was studying up on iptables, and saw that my filter table, has it’s INPUT chain to accept all incoming packets..and then to reject all incoming packets. Am I reading this right? take a look.

I couldn’t format it properly, so I stuck it on a pastebin and attached the image

Obviously this doesn’t make sense, and I don’t see how it could possibly work.

Attached Images
Screenshot from 2013-07-18 17:15:42.png (210.5 KB)

…read more

Source: FULL ARTICLE at The UNIX and Linux Forums

Script to create unique look-up for headers for a Dictionary

By gimley

I have a text file in UTF-8 format which has the following data structure

Code:

HEADWORD=gloss1,gloss2,gloss3 etc


I want to convert it so that all the glosses of the HeadWord appear on separate lines

Code:

HEADWORD=gloss1
HEADWORD=gloss2
HEADWORD=gloss3


An example will illustrate the requirement
INPUT

Code:

હોશમાં આવવું=regain consciousness.
હોશિયાર=clever, intelligent; skilful; alert, vigilant; cautious; understanding, sensible.
હોશિયારી કરવી=boast,(try to) be clever.
હોશિયારી દાખવવી=boast,(try to) be clever.
હોશિયારી બતાવવી=boast,(try to) be clever.
હોશિયારી મારવી=boast,(try to) be clever.
હોશિયારી રાખવી=be cautious,be vigilant,be alert.
હોશિયારી=cleverness, vigilance
હોહા=noise, uproar, tumult, public talk or discussion, excitement, agitation, alarm, consternation.
હોહાકાર=uproar, tumult, excitement, alarm.
હોહો=noise, uproar, tumult, public talk or discussion, excitement, agitation, alarm, consternation.


The Output would be

Code:

હોશિયાર=clever
હોશિયાર=intelligent
હોશિયાર=skilful
હોશિયાર=alert
હોશિયાર=vigilant
હોશિયાર=cautious
હોશિયાર=understanding
હોશિયાર=sensible.
હોશિયારી કરવી=boast
હોશિયારી કરવી=(try to) be clever.
હોશિયારી દાખવવી=boast
હોશિયારી દાખવવી=(try to) be clever.
હોશિયારી બતાવવી=boast
હોશિયારી બતાવવી=(try to) be clever.
હોશિયારી મારવી=boast
હોશિયારી મારવી=(try to) be clever.
હોશિયારી રાખવી=be cautious
હોશિયારી રાખવી=vigilant or alert.
હોશિયારી=cleverness
હોશિયારી=vigilance
હોશિયારી=etc.
હોહા=noise
હોહા=uproar
હોહા=tumult
હોહા=public talk or discussion
હોહા=excitement
હોહા=agitation
હોહા=alarm
હોહા=consternation.
હોહાકાર=uproar
હોહાકાર=tumult
હોહાકાર=excitement
હોહાકાર=alarm
હોહો=noise
હોહો=uproar
હોહો=tumult
હોહો=public talk or discussion
હોહો=excitement
હોહો=agitation
હોહો=alarm
હોહો=consternation


At present I use macros which identify the delimiter, copy the text between two delimiters, paste it on next line, preface it with the headword and continue the operation till end of line and repeat the same for the next line. Since the file is huge a PERL or AWK script would help.
I work under Windows and UNIX type solutions do not work for me unfortunately.
Many thanks in advance.

From: http://www.unix.com/shell-programming-scripting/221547-script-create-unique-look-up-headers-dictionary.html

Parsing line with name:value pairs in shell script

By tasmac

HI ,
I have the following type of lines in a file and need to create a csv file that can be bcp’ed into a db

The problem that I have is the delimited of the is a space but some of the values in the pairs have space . eg msg_src_time:03/05/13 10:40:17.919

Need sugesstions on parsing the file

sample input

INPUT
msg_status:FILL comments: usr_id:73 system_time:03/05/13 10:40:17.920 msg_src_time:03/05/13 10:40:17.919 flags: 0 flags2: 0 comment_index: 0
msg_status:FILL comments:dollar usr_id:73 system_time:03/05/13 10:40:51.352 msg_src_time:03/05/13 10:40:51.352 flags: 0 flags2: 0 comment_index: 0

Output
FILL , , 73 , 03/05/13 10:40:17.920 , :03/05/13 10:40:17.919 , 0 , 0 , 0
FILL , dollar , 73 , 03/05/13 10:40:51.352 , :03/05/13 10:40:51.352 , 0 , 0 , 0

My intial search in this forum found these but this will fail as my delimited is a space and 2 name value pairs have space in them

echo “Type:G,Instance:instance1,FunctionalID:funcid,Env:dev,AppName:appname” | sed ‘s/:/=/g’ | awk ‘BEGIN{FS=”,”} { print $2 print $3 print $4 print $5 }

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Read variable inputs

By newkid.7955

I am trying to make an interactive script. Only problem my inputs are not read and correctly channeled.

Please help:

Here is my code

Code:

#!/bin/sh
PATHSCRIPT=/home/pp/tmp

#if [ -z "$1" ]; then
# echo "Syntax : $0 input off lat sample"
# exit 1
# fi
echo "Choice of Graph"

echo "1 -- Type one graph 2 -- Type two graph 3 -- type three graph"

read num

if [[$num -eq 2]]; then

#echo " Enter arguments seperated with space: input off lat sample"
echo "Syntax : $0 input off lat sample"
#read $input $off $lat $sample
if [ $# -lt 2 ];
then
echo -e $HELP
exit 1
else
INPUT=$1
shift
OFF=$1
shift
LAT=$1
shift
SAMPLE=$1
shift
fi

else

if [[num==1]]; then
echo " Enter arguments seperated with space: input off lat sample"
#read $input $off $lat $sample

else

echo " Enter arguments seperated with space: input off lat sample"
#read $input $off $lat $sample
fi

fi


I keep receiving this error:


Choice of Graph
“1 — Type one graph 2 — Type two graph 3 — type three graph”
+ read num
2
+ [[2 -eq 2]]
./mastergraph_options.sh: 1: [[2: not found
+ [[num==1]]
./mastergraph_options.sh: 1: [[num==1]]: not found
+ echo Enter input off lat sample
Enter arguments seperated with space: input off lat sample

I cannot get past this place.
Please help me read the
–Choice 1,2 or 3
— channel it to the right format of files to be entered
:wall:

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

How to Remove duplicate value from file?

By mohan sharma

if different branch code is available for same BIC code and one of the branch code is XXX.only one row will be stored and with branch code as XXX .rest of the rows for the BIC code will not be stored.

for example if $7 is BIC code and $8 is branch code
INPUT file are following
BI M IT056868 UNICREDI VIA LIBHIA UNCRIT2B XXX UNCR
BI M US001165 NEUBERGE LLC NEWYRK NEUBUS33 253 NEUB
HH M IND90909 SBILIFES HNI NANANN GGGGGGGG 142 UICC
HH M MNOOOO 98989089 IIC UMNKSS MOHAN844 XXX KLKL
HH M MNKKKKKK 90909090 JMV MNJKMN MOHAN844 256 LOPD
HH M MKLJHJKK KIKIKIKI JKJ NMHMNM MOHAN844 456 LOPS

here $7 is having 3 bic code with same value”MOHAN844″ with diff branch code in $8 and i want only BIC code with XXX value …and if XXX is not present in $8 then i need all record..

please Help me..

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

iptables not logging

By christr

I need to log iptables to see what ports are being dropped. I followed this article and several others I looked at via Google, but it’s still not working.

Red Hat Magazine | How do I add logging for iptables using the /etc/sysconfig/iptables file for Red Hat Enterprise Linux4?

I added the following entry to my /etc/sysconfig/iptables file just before the last COMMIT line:

Code:

-A RH-Firewall-1-INPUT -p tcp --dport 443 -j ACCEPT #example#
-A RH-Firewall-1-INPUT -j LOG
COMMIT


I’ve also tried it as shown:

Code:

-A RH-Firewall-1-INPUT -p tcp --dport 443 -j ACCEPT #example#
#log
-A RH-Firewall-1-INPUT -j LOG
#drop all other packets
-A RH-Firewall-1-INPUT -j DROP
COMMIT


My problem is when I got to /var/log/messages I don’t see it logging anything whatsoever from iptables.

I also added the following to /etc/syslog.conf:

Code:

kern.* /var/log/debug


Still no matter what I do no information shows up in any log files, and I’ve tried numerous ports on this host that I know aren’t opened in iptables from another test host in hopes that I would see it logging the dropped connection attempts, but nothing I’ve done will log anything whatsoever.

I’ve also tried using this article for advise, but still nothing I do works:
Example iptables firewall

Any advise would be greatly appreciated. This is on Red Hat Enterprise 5.7. Every time I make these changes I of course restart the iptables and syslog services.

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Script to group XML entries?

By dlundwall

Hello all, If I wanted to take an xml file as INPUT to a script to pull information from it how do you group things together? Here is what I am trying to do:

In the xml file you have:

85330

85847
85211
21051

Citrix NetScaler Devices

This is a small sample of just one … out of 100’s. I am looking to look at every group and get output like this:

Group ID: 85330
DeviceID List
85847
85211
21051
Group Name: Citrix NetScaler Devices

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Sorting a CSV file by DOB

By redshine6

I have absolutaly no idea how to get this script to sort the info in Birthdays.csv by date of birth. I know the sort -n command, however i wish to sort the file birthdays.csv by DOB. How would i go about doing this?

The below script gets user info and date of birth and then puts these info a file called “birthday.csv”.
I then need to Sort “birthdays.csv” by date of birth and then display this newly sorted information. I also calculate how old each person is by today’s date. The problem i have is sorting the info in birthdays.csv by date of birth. Can someone let me know how i would do this sort?

The script is below:


#!/bin/bash

a=0
while [ $a -lt 2 ];
do
echo Please enter a first name
read firstName
echo Please enter last name
read lastName
echo Please enter phone number
read phoneNumber
echo Please enter date of birth - format dd/mm/yyyy
read dob
echo "$firstName,$lastName,$phoneNumber,$dob" >> birthday.csv
echo If you would like to add another person press 1 or enter 2 to proceed
read a
done

INPUT=./birthday.csv
OLDIFS=$IFS
IFS=","
[ -f ${INPUT} ] && while read Name Surname Telephone DOB
do
birthMonth=${DOB:0:2}
birthDay=${DOB:3:2}
birthYear=${DOB:6:4}

currentDate=`date +%d/%m/%Y`

currentMonth=${currentDate:0:2}
currentDay=${currentDate:3:2}
currentYear=${currentDate:6:4}

if [[ "$currentMonth" -lt "$birthMonth" ]] || [[ "$currentMonth" -eq "$birthMonth" && "$currentDay" -lt "$$birthDay" ]]
then
let Age=currentYear-birthYear-1
else
let Age=currentYear-birthYear
fi

echo "---------------------------"
echo "Name : $Name"
echo "Surname : $Surname"
echo "Telephone : $Telephone"
echo "DOB : $DOB"
echo "Age : $Age"
echo "---------------------------"
done < $INPUT
IFS=$OLDIFS
echo $DATE

exit 0;


Thank you in advance, all help is most appreciated.

Source: FULL ARTICLE at The UNIX and Linux Forums

Help with iptables

By samnyc

Hi, I just build a Linux server, I said yes to enable the firewall. I only choose SSH conneciton. When I check the iptables. I see all of this (see below). I want to reject every thing only allow SSH from subnet 192.168.1.xx. Can you advise, how to do.

Code:

Chain RH-Firewall-1-INPUT (2 references)
pkts bytes target prot opt in out source destination
1043 3332K ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmp type 255
0 0 ACCEPT esp -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT ah -- * * 0.0.0.0/0 0.0.0.0/0
15 2978 ACCEPT udp -- * * 0.0.0.0/0 224.0.0.251 udp dpt:5353
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:631
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:631
540 44542 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
3 156 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
1532 142K REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited


Source: FULL ARTICLE at The UNIX and Linux Forums