Sep 232017
aws route53 change-resource-record-sets --hosted-zone-id $(aws route53 list-hosted-zones | grep -B 1 '""' | grep '"Id"' | cut -f 4 -d \" | cut -f 3 -d /) --change-batch file://<(echo '{"Changes":[{"Action": "DELETE","ResourceRecordSet":' $(aws route53 list-resource-record-sets --hosted-zone-id $(aws route53 list-hosted-zones | grep -B 1 '""' | grep '"Id"' | cut -f 4 -d \" | cut -f 3 -d /) --query "ResourceRecordSets[?Name == '']" --max-items 1| egrep -v '^\[|^\]')'}]}')

Or as a script:

ZONE_ID=$(aws route53 list-hosted-zones | grep -B 1 '""' | grep '"Id"' | cut -f 4 -d \" | cut -f 3 -d /)
RECORD=$(aws route53 list-resource-record-sets --hosted-zone-id ${ZONE_ID} --query "ResourceRecordSets[?Name == '']" | egrep -v '^\[|^\]' --max-items 1)
JSON='{"Changes":[{"Action": "DELETE","ResourceRecordSet":'${RECORD}'}]}'
aws route53 change-resource-record-sets --hosted-zone-id ${ZONE_ID} --change-batch file://<(echo ${JSON})


Jul 062014

I’m working for the big chip company now, sound a little bit weird, though 😉 .

Anyway, I’m sitting in backend team focusing on DevOps, I guess I will be in this mixed role till we find a dedicated DevOps guy. I guess whenever that happens, I’ve already finished monitoring facility (plus logistical stuffs like on-call schedule, etc.), and should have finished the plan to migrate from Rackspace to AWS.

Everything works smoothly so far except git – I admit current company is using git in a modern way, but I don’t think previous company was doing something wrong. Anyway, I believe people do have different ideas of how to use git, I just have to fit into the company’s style.

I don’t quite like saltstack although I’m still trying to get familiar with it. However, before I raise this as a concern to the team, I’d like to make sure everything that saltstack is doing can be done by cfengine.

Ah yea, also need to evaluate Shinken as it’s a pure Python solution, and “we are a python house”.

Jul 062014

Trying to merge everything running on AWS to a single instance, and once the instance is good enough to run all my stuffs, will book a reserved instance to save cost.

It seems I’m having less and less sites up and running, I got impression that I used to have 10+ sites flying around for random purposes but now I have only 2 “serious” sites. Sure I still have 2 or 3 sites running test environments but they can be discarded anytime.

The company is moving to AWS as I was told, could be a good time to start look around things like VPC, etc.

 Posted by at 13:55  Tagged with:
Nov 072012

Just upgraded Xcode to 4.5.2 through App Store, which has iOS6 support, I don’t know what else this new version includes though …

And after the upgrade, I got some time playing with previous AWS project which list my stuffs on AWS, include S3 and EC2. Obviously, every time I access my old codes I could find something wrong, and there is no exception this time – at the time I was doing AWS project, I had only 2 instances staying in one region, and now I have multiple (5?) instances staying in two regions so previous logic does not work very well.

Not many details to talk about here, I simply list all regions for AWS, and query instances targeting each endpoint, that’s it.

Now my AWS app is working well again.

Feb 142012

The AWS App on iOS is pretty much done, at least I have made readonly part of S3 and EC2 works, and I don’t think write operations (create, update, delete, etc) are feasible to mobile phones.

I’m moving to Windows Phone now, trying to build up similar App in term of functionality – I’m not sure if I can build things with similar UI since different app store may have totally different tastes/rules on UI standard, better follow what they asked for.

I wish Windows Phone development will be easier thinking of I’ve done .Net/Visual Studio development before, let’s see – I give myself 2 weeks, and will spend no more than an hour per day.

Actually I tried both Android and Windows Phone the other day, trying to get basic idea of development. Obviously I don’t like Android, either because of I’m not a Java fan, or because of ugly interface of Eclipse – it may only be that ugly on OSX though, but I don’t have space (read: memory) to launch such a fat IDE in my Windows VM so leave it to the last.

Feb 012012

This may not be useful to others, but it bothered me quite some time, so I’d like to write it down in case some others stuck at the same place as I did.

getMetadataForKey calls from aws-ios-sdk, actually it:

  1. returns user defined meta data, nothing to do with s3’s meta data
  2. the key used here will be prepended a “x-aws-meta-“, that is, in aws console, we will see a meta data entry keyed with “x-aws-meta-hahaha”, but in ios app you need to use “hahaha” to get the value

some other interesting stuffs … don’t use S3GetObjectRequest/Response call to get object’s header information, as it will indeed download the object. Instead, you should use S3GetObjectMetadataRequest/Response.

To get “Expiry Date” and  “Lifecycle Rule” information as they are shown on aws console, you need to use response”s valueForHTTPHeaderField method with key “x-amz-expiration”, the parse it … I guess there should be something more easier but havenn’t figured out how. Both “expiry-date” and “rule-id” are there so you can use them, note that they can be empty so better prepare for that.