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.

Tuesday, October 29, 2013

Building iOS apps for Simulator with Xcode 5 with command line

Things a little changed since Xcode 4

If you want to build your project for simulator 
and want to do it with the latest and the greatest version of Xcode - version 5.x
and want to do it with command line utility xcodebuild, 
because you need this for Continuous Integration or someth, 
then: 

1. In your Build Scheme for Simulator in project's "Build Settings" in section "Code Signing" set:
  • "Don't Code Sign" for "Code Signing Identity"
  • "None" for "Provisioning Profile"
2. In command line use iphonesimulator7.0 as desired SDK
(even if you have downloaded SDK 6.1, it won't help. not without other voodoo dark magic)

/usr/bin/xcodebuild -verbose \
  -project MyCoolProject/MyCoolProject.xcodeproj \
  -scheme MyCoolProjectSimulator \
  -configuration Debug \
  -arch i386 \
  -sdk iphonesimulator7.0 \
  TARGETED_DEVICE_FAMILY=2 \
  clean build

where TARGETED_DEVICE_FAMILY is iPhone (1) or iPad (2)