Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by geebers

  1. geebers

    iptables wlan traffic to LAN webserver

    Need help with iptables rules for my wireless router running dd-wrt. Have a bridge (br1) setup with eth0 and vlan2 assigned to it. No internet (WAN). br1 IP = 192.168.3.1, 255.255.255.0 eth1 = wireless interface (br1) vlan2 = wired LAN port #1 (br1) webserver = 192.168.3.120:80 (wired to vlan2)...
  2. geebers

    command to print an image file

    How to print a jpg file from the command line. Thats all. Thanks for any help.
  3. geebers

    which is more efficient....

    Hmmm.... then i wonder if something like the following would be better at waiting for an event.... nc -l -u localhost 2222 | while read line; do echo "Hey its $line" ./runMyScript.bash done Is there perhaps a better way to wait for text to come across port 2222 and and when it does, do...
  4. geebers

    which is more efficient....

    Which taxes my cpu more..... while :; do echo "hello world" done OR while :; do echo "hello world" sleep 1 done just curious. sorry if its painfully obvious and i'm just a dolt.
  5. geebers

    Clone drive

    From the dd wiki.... image a partition to another machine: On source machine: dd if=/dev/hda bs=16065b | netcat < targethost-IP > 1234 On target machine: netcat -l -p 1234 | dd of=/dev/hdc bs=16065b Should lead you in the right direction. Hope this helps.
  6. geebers

    netcat and re-stablishing network connection

    O.k. thanks. Yes, seems nc still runs. So, I've updated my listen3333.sh script to the following and it is behaving like I want it to..... #!/bin/sh while :; do nc -l -u -p 3333 | while read INPUT; do date >>/tmp/log.txt echo "$INPUT" >>/tmp/log.txt killall nc done done...
  7. geebers

    netcat and re-stablishing network connection

    ok, so I've created a new script called listen3333.sh and contains..... #!/bin/sh while :; do nc -l -u -p 3333 | ./myscript.sh done and then make it executible... chmod 755 listen3333.sh myscript.sh contains.... #!/bin/sh while read INPUT; do echo "Input is $INPUT" | tee >>/tmp/log.$$...
  8. geebers

    netcat and re-stablishing network connection

    Consider the following netcat command to listen on a port..... sudo nc -l -u -p 3333 | myscript.sh contents of myscript.sh is.... #!/bin/sh while read INPUT; do echo "Input is $INPUT | tee /tmp/log.$$ done This waits for a connection on port 3333 and when a connection is made, data sent by...
  9. geebers

    pipe text from port 2222 to script using xinetd

    I tried your suggestion, did not seem to work. if myscript.sh contains this.... #!/bin/sh echo "test" >newfile.txt and I run... sudo nc -u 192.168.1.100 2222 "type some text and hit enter" then it works. a new file called "newfile.txt" is created which contains the string "text". However...
  10. geebers

    pipe text from port 2222 to script using xinetd

    i have xinetd setup to run myscript.sh whenever some text is sent to port 2222. but i'm needing to pipe the text into myscript.sh example: - client sends string "11111" to server port 2222 - myscript.sh is executed with "11111" as the first argument. can this be done? thanks for any help.
  11. geebers

    runshell script for each netcat output

    i have a digital signage device that uses upd to communicate. I got it working. To use udp for a service, there are two required lines in /etc/xinetd.d/myscript .... socket_type = dgram wait = yes default settings are: socket_type = stream wait = no So here's my...
  12. geebers

    runshell script for each netcat output

    hmmm, I think xinetd is what i'm after. I just want to run myscript.sh when some text is sent to port 3333, using UDP. so i installed xinetd from my repos and added the following line to /etc/services myscript 3333/udp created the file /etc/xinetd.d/myscript and it contains... service...
  13. geebers

    runshell script for each netcat output

    is there an efficient way to fire off a shell script each time netcat receives new text string from a network port? i need root to run myscript.sh each time a new string of text is received from port 3333. also, capture the string as a variable in myscript.sh. thanks for any help. m
  14. geebers

    Directory Action

    FWIW, a hack that made it work..... in my.php... <?php $result = shell_exec("getImageURL.bash"); ?> <img src="<php echo $result ?>" /> basically, my .bash script decides the next image to display, in this example /images/image1.jpg and THEN copies it to /temp/image1.jpg the string...
  15. geebers

    Directory Action

    my.php file runs whenever a jpeg file is requested. The directive looks like.... <Directory "/opt/lampp/htdocs/images/"> AddHandler image/jpeg .jpg Action image/jpeg /opt/lampp/cgi-bin/my.php </Directory> again, this works, however, the jpeg image does not display in the browser. I need my.php...

Part and Inventory Search

Back
Top