Monday, December 26, 2016

AWS Athena - ELB Log Analaysis



Thoughts


Able to get working Athena on our production logs.

No more ELK Stack, Hadoop , Map reduce, Big Query.


Create database apilogs2

CREATE EXTERNAL TABLE IF NOT EXISTS apilogs2.elb_logs_raw_native (
  request_timestamp string,
  elb_name string,
  request_ip string,
  request_port int,
  backend_ip string,
  backend_port int,
  request_processing_time double,
  backend_processing_time double,
  client_response_time double,
  elb_response_code string,
  backend_response_code string,
  received_bytes bigint,
  sent_bytes bigint,
  request_verb string,
  url string,
  protocol string,
  user_agent string,
  ssl_cipher string,
  ssl_protocol string )
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'

WITH SERDEPROPERTIES (
         'serialization.format' = '1','input.regex' = '([^ ]*) ([^ ]*) ([^ ]*):([0-9]*) ([^ ]*):([0-9]*) ([.0-9]*) ([.0-9]*) ([.0-9]*) (-|[0-9]*) (-|[0-9]*) ([-0-9]*) ([-0-9]*) \\\"([^ ]*) ([^ ]*) (- |[^ ]*)\\\" (\"[^\"]*\") ([A-Z0-9-]+) ([A-Za-z0-9.-]*)$' )

LOCATION 's3://....';


SELECT * FROM apilogs2.elb_logs_raw_native WHERE elb_response_code = '200' LIMIT 100;


SELECT * FROM apilogs2.elb_logs_raw_native WHERE elb_response_code = '200' and url like '%serialNumber%' LIMIT 100;


SELECT * FROM apilogs2.elb_logs_raw_native WHERE elb_response_code = '200'
and url like '%serialNumber%'
and user_agent like '%ok%' LIMIT 100; --18

Big Data - Part 4



http://www.slideshare.net/AmazonWebServices/bdt310-big-data-architectural-patterns-and-best-practices-on-aws








Server less Architecture 


https://docs.aws.amazon.com/athena/latest/ug/json.html

https://medium.com/@pahud/kinesis-firehose-put-record-with-cli-e835a6e6ffe2#.j5t0okqux

http://aws.mannem.me/?p=1152



SnowPlow


http://snowplowanalytics.com/blog/2014/05/13/introducing-schemaver-for-semantic-versioning-of-schemas/

https://github.com/snowplow/snowplow

https://github.com/snowplow/snowplow/wiki/Setting-up-the-Cloudfront-collector

https://github.com/snowplow/snowplow/wiki/snowplow-tracker-protocol

http://www.slideshare.net/robkingston/a-taste-of-snowplow-analytics-data


Aws Lamda & Gateway


https://abhishek-tiwari.com/post/aws-lambda-and-endless-serverless-possibilities

https://gist.github.com/markusklems/1e7218d76d7583f1f7b3
https://claudiajs.com/tutorials/index.html


https://www.youtube.com/channel/UClLLJjpSWRRa1BosQrNVDjA



Sunday, December 25, 2016

Thursday, December 8, 2016

fonts



https://creativemarket.com/blog/whats-the-difference-between-leading-kerning-and-tracking

http://www.1001fonts.com/web-fonts.html
https://superdevresources.com/create-font-from-handwriting/

https://bond.co/

https://github.com/dok/awesome-text-editing


https://helpx.adobe.com/animate/using/text-layout-framework-tlf-text.html



Text Layout Framework Technology Center


https://helpx.adobe.com/animate/using/text-layout-framework-tlf-text.html
http://www.adobe.com/devnet-apps/tlf/demo/
http://www.adobe.com/devnet/tlf.html
https://www.cocoanetics.com/2012/02/dtrichtexteditor-dtcoretext-news/
https://www.objc.io/issues/5-ios7/getting-to-know-textkit/
https://www.raywenderlich.com/4147/core-text-tutorial-for-ios-making-a-magazine-app













Saturday, October 22, 2016

Saturday, October 8, 2016

Big Data - Part3



https://www.quora.com/What-can-you-do-with-Amazon-Kinesis















http://searchengineland.com/google-data-studio-258871

http://www.iacquire.com/blog/15-google-analytics-alternatives



Event Tracking:


https://mixpanel.com/help/reference/tracking-an-event
https://firebase.google.com/docs/analytics/ios/events
https://www.quora.com/Were-considering-using-Mixpanel-as-an-analytics-platform-for-our-new-app-Someone-has-recommended-we-use-Firebase-instead-Are-they-comparable

https://blog.treasuredata.com/blog/2016/03/09/evaluating-analytics-saas-raw-data-access-capabilities/


BigQuery

https://www.youtube.com/watch?v=D-YrpJkuGqE

https://www.thinkful.com/learn/google-bigquery-tutorial/#Exploring-GitHub-Data



https://www.safaribooksonline.com/library/view/the-deep-learning/9781491965115/video246708.html


9 Data Platform

http://www.confluent.io/
http://www.h2o.ai/
http://www.atscale.com/
https://algorithmia.com/
https://www.bedrockdata.com/product/overview
https://rjmetrics.com/product



http://my-netdata.io/


---


https://obviate.io/2015/08/05/tutorial-aws-api-gateway-to-lambda-to-dynamodb/
http://www.davekonopka.com/2016/serverless-aws-lambda-api-gateway.html


https://www.datawire.io/3-reasons-aws-lambda-not-ready-prime-time/



Tutorials:

https://www.quora.com/Can-we-become-data-scientist-by-going-through-online-tutorials



Friday, September 2, 2016

Image Resize CDN



https://news.ycombinator.com/item?id=10145502

https://docs.imgix.com/



Sunday, August 21, 2016

NewRelic








  1. Integrated Newrelic on tech stack 










Tuesday, August 9, 2016

Wednesday, August 3, 2016

Magento Cloud





Reference


  1. install 2 vm ubuntu 14 LTS (https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-magento-on-ubuntu-14-04)
    1. web open port 80 & 22
    2. db : open port 22 & 3306
  2. web :  (reference https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04)
    1. sudo apt-get update
    2. sudo apt-get install apache2 (apache/2.4.7)
    3. sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
    4. sudo nano /etc/apache2/mods-enabled/dir.conf
    5. sudo service apache2 restart
    6. sudo apt-get install php5-cli
    7. sudo nano /etc/apache2/sites-available/magento.conf
    8. sudo a2ensite magento.conf
    9. sudo a2dissite 000-default.conf
    10. sudo apt-get install libcurl3 php5-curl php5-gd php5-mcrypt
    11. sudo a2enmod rewrite
    12. sudo php5enmod mcrypt
    13. cd ~ && wget http://www.magentocommerce.com/downloads/assets/1.9.0.1/magento-1.9.0.1.tar.gz
    14. tar xzvf magento-1.9.0.1.tar.gz
    15. sudo rsync -avP ~/magento/. /var/www/html/
    16. sudo chown -R www-data:www-data /var/www/html/
    17. sudo apt-get install mysql-client
    18. apt-get install php5-mysql


  1. db :
    1. sudo apt-get update
    2. sudo apt-get install mysql-server
    3. sudo mysql_install_db
    4. mysql -u root -p
      1. CREATE DATABASE magento;
      2. CREATE USER 'mangento2'@'localhost' IDENTIFIED BY 'password';
      3. GRANT ALL PRIVILEGES ON *.* TO 'mangento2'@'localhost' WITH GRANT OPTION;
      4. CREATE USER 'mangento2'@'%' IDENTIFIED BY 'password';
      5. GRANT ALL PRIVILEGES ON *.* TO 'mangento2'@'%' WITH GRANT OPTION;
      6. FLUSH PRIVILEGES;
      7. exit;
    5. sudo nano /etc/mysql/my.cnf (Bind address 0.0.0.0)
    6. mysqld --help --verbose




  1. Install ubuntu 14.04 LTS
  2. Install apache2
  3. install php
  4. seed the mysql DB :
  5. unzip the shopping in web root
  6. Change the config file





Chef :


CloudFormation Template:





  1. install aws command line tools
    1. $ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
      $ unzip awscli-bundle.zip
      $ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
    2. aws cloudformation create-stack --stack-name myteststack2 --template-body file://///Projects/cc/cf/shop.json
    3. aws cloudformation delete-stack --stack-name myteststack2





Chef + cloudformation






Setting up chef




Vagrant:





Mac Setup

$ brew tap caskroom/cask
$ brew install brew-cask
$ brew cask install google-chrome
$ brew update && brew upgrade brew-cask && brew cleanup

  1. brew cask install virtualbox
  2. brew cask install vagrant
  3. brew cask install vagrant-manager
  4. vagrant box add precise64 http://files.vagrantup.com/precise64.box
  5. vagrant init precise64
  6. vagrant up
  7. vagrant ssh
    1. vagrant halt

  1. mkdir -p ~/chef/cookbooks/helloworld/recipes
    $ echo '
    file "/tmp/helloworld.txt" do
     owner "ubuntu"
     group "ubuntu"
     mode 00544
     action :create
     content "Hello, Implementor!"
    end' > ~/chef/cookbooks/helloworld/recipes/default.rb
  2. echo '
    {
     "run_list": [ "recipe[helloworld]" ]
    }' > ~/chef/node.json
  3. echo '
     file_cache_path "/home/vagrant/chef"
     cookbook_path "/home/vagrant/chef/cookbooks"
     json_attribs "/home/vagrant/chef/node.json"
    ' > ~/chef/solo.rb






RUBY




//setting up chefdk for Ruby



  1. brew install chruby
  2. brew install ruby-install
  3. ruby-install ruby 2.2


Chef DK

install chef & Ruby


  • brew cask install virtualbox
  • brew cask install vagrant
  • brew cask install vagrant-manager
  • brew cask install chefdk
  • vagrant plugin install vagrant-berkshelf
  • vagrant plugin install vagrant-omnibus
  • vagrant plugin install vagrant-chef-zero
  • vagrant plugin install vagrant-vbguest



Good one

VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnet0

brew cask install sublime-text







Test app:














good one

















Performance & Scalability:








Tools





  1. FastCGI



Screen Shot 2015-05-11 at 12.25.31 PM.png



 Screen Shot 2015-05-09 at 7.47.54 AM.png


Screen Shot 2015-05-17 at 6.24.20 PM.png



VPC:
AWS re:Invent 2014 | (SDD422) Amazon VPC Deep Dive



Screen Shot 2015-06-20 at 3.18.21 AM.png






Screen Shot 2015-06-21 at 5.10.27 AM.png




VPC Security


Network ACL : Stateless lives on network level, outbound and inbound rules need to be specified
Security Group : Stateful default outbound rules are allowed

3 Security Groups

DB security groups,
VPC security groups, and
EC2 security groups



cd /etc/apache2/site-enabled



NAT Instance


DB Subnet Groups

RDS Essentials












Magento Install


sudo apt-get install -y ssh
sudo apt-get install -y apache2
sudo apt-get install -y php5 libapache2-mod-php5
sudo apt-get install -y php5-mysqlnd php5-curl php5-gd php5-intl php-pear php5-imap php5-mcrypt php5-ming
sudo apt-get install -y php5-ps php5-pspell php5-snmp php5-recode php5-sqlite php5-tidy php5-xmlrpc php5-xsl php-soap






VPC:


Building A Non-Default VPC






Database:


Load test on DB



Screen Shot 2015-05-21 at 6.07.54 AM.png


Screen Shot 2015-05-21 at 6.08.46 AM.png




Best Practice

  1. Have a subnet block that does not overlap with local network
  2. VPC for Dev,Stage,Prod (VPC peering)
  3. Security
    1. Firewall Virtual appliance
    2. VM encryption






DNS





Deployment


BOTO



Reference: