Skip to content

Instantly share code, notes, and snippets.

View titogeorge's full-sized avatar
🎯
Focusing

Tito George titogeorge

🎯
Focusing
  • Bangalore, India
  • 04:44 (UTC +05:30)
View GitHub Profile
@titogeorge
titogeorge / cf_snippet_api_gw_custom_domain.yaml
Created April 24, 2018 15:02
AWS Cloudformation: Custom API Gateway Domain Name
APIRecordSet:
Type: AWS::Route53::RecordSet
Properties:
HostedZoneId: !Ref hosted-zone-id
Comment: CNAME Redirect to the API Gateway
Name: !Join
- ""
- [ my-api. , !Ref hosted-zone-name, '.']
Type: CNAME
TTL: '300'
@titogeorge
titogeorge / FlattenJavascriptObject.js
Created November 24, 2017 13:03
Flatten and given java script object.
function flatten(originalObject, newObj, keyNamePrefix) {
if (newObj == undefined) {
newObj = {};
}
if (typeof originalObject == 'object') {
for (key in originalObject) {
if (typeof originalObject[key] == 'object') {
let item = originalObject[key];
if (keyNamePrefix == undefined) {
flatten(item, newObj, key);

Keybase proof

I hereby claim:

  • I am titogeorge on github.
  • I am titogeo (https://keybase.io/titogeo) on keybase.
  • I have a public key ASD8VbKNqu4xAbtDxBZqys5X92wa4VfL3Y9q2RQH1XfCmgo

To claim this, I am signing this object:

@titogeorge
titogeorge / LogStash config for ELB logs
Created March 10, 2015 12:33
Logstash AWS Elasticbeanstalk access logs pattern
if [type] == 'elb-access-log' {
grok {
patterns_dir => "./patterns"
# Different elastic-access-log patterns. look for _grokfailure tag in kibana and keep adding patterns here.
match => [ "message" , [
"%{IPORHOST:elbIp} \(%{IPORHOST:clientIp}, %{IPORHOST:elbip1}\) - - \[%{HTTPDATE:timestamp}\] \"%{WORD:verb} %{NOTSPACE:request} HTTP/%{NUMBER:httpversion}\" %{NUMBER:response} %{NUMBER:bytes} %{QS:referrer} %{QS:agent}",
"%{IPORHOST:elbIp} \(%{IPORHOST:clientIp}, %{IPORHOST:elbip1}\) - - \[%{HTTPDATE:timestamp}\] \"%{WORD:verb} %{NOTSPACE:request} HTTP/%{NUMBER:httpversion}\" %{NUMBER:response} - \"-\" %{QS:agent}",
"%{IPORHOST:elbIp} \(%{IPORHOST:clientIp}, %{IPORHOST:elbip1}\) - - \[%{HTTPDATE:timestamp}\] \"%{WORD:verb} %{NOTSPACE:request} HTTP/%{NUMBER:httpversion}\" %{NUMBER:response} %{NUMBER:bytes} \"-\" %{QS:agent}",
"%{IPORHOST:elbIp} \(%{IPORHOST:clientIp}, %{IPORHOST:clientIp1}, %{IPORHOST:elbip1}\) - - \[%{HTTPDATE:timestamp}\] \"%{WORD:verb} %{NOTSPACE:request} HTTP/%{NUM