Friday, December 13, 2013

Sending UDP from cmdline

Useful if you are testing something

echo "HELLO" | socat - UDP4-DATAGRAM:192.168.1.0:19838,sp=19835,broadcast,range=192.168.1.5/32



watch echo "HELLOA `date`" | socat - UDP4-DATAGRAM:192.168.1.0:19838,sp=19835,broadcast,range=192.168.1.5/32

Thursday, December 12, 2013

Automating tasks over telnet.

Ok. So it is a Stone Age and no one knows what SSH is. Everybody is using telnet.

Let's automate a service restarting task.

Cool and easy as 1,2,3.

{ \
 sleep 2; \
 echo "root"; \
 sleep 2; \
 echo "password"; \
 sleep 2; \
 echo "ps ax | grep my_cool_service"; \
 sleep 2; \
 echo "OLD_SERVICE_PID=\`ps ax | grep my_cool_service | awk '{print \$1}'\` && kill \$OLD_SERVICE_PID"; \
 sleep 2; \
 echo "service my_cool_service start && ps ax |grep my_cool_service"; \
 sleep 4; \
 } | telnet 10.10.10.10

  

Sunday, December 8, 2013

Gradle over proxy

Ok. Everyone knows that. This time it's a note for me-self.

vi ~/.gradle/gradle.properties
systemProp.http.proxyHost=www.proxyhost.org  systemProp.http.proxyPort=8080  systemProp.http.proxyUser=userid  systemProp.http.proxyPassword=password  systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
Have fun.