Posts

Showing posts from April, 2018

AWS Network Security Notes

Image
Intro security Layers: Routing NACL (Network Access Control Lists) security Groups Host based Firewall, IDS and IPS Routing security no support for " edge to edge routing "  NACL (Network Aecess control list) Applied to subnet as whole stateless (Don't remeber TCP sessions) As a result must specify ingress and egress rules When you create a vpc, Aws will create a default NALC allow all * Allow or Deny specify - Protocol (Tcp, UDP) - source destination IP Range - source destination PORT range (Eg: Ingress 80 and 22 VPN Egress 1024- 65535) Security Groups Applied to the instance. statefull therefore can specify ingress and egress rules: but not need to specify both. security Groups. all outbound ⇒ allowed, inbound ⇒ deny therefore only allow rules, no deny specify: - protocol (TCP, UD.P) . - Source IP and Port range for ingress - Destination EP and Port rang only for engress When VPC is created, default security group is cre

AWS VPC Notes

Image
I would like to recommend IP explained before reading this. How the internet is working This is an introduction only 1 . Take the name of the services and convert to physical locations on the internet. URL For example, http://ojitha.blogspot.com need to be read from right to the left. Is this case com in the domain and blog spot is the subdomain. There are 13 root services configured in these recursive servers such as .net .  The Anycast address is a simple IP address that represents a bunch of servers appear on same Ip address. you can find all the server addresses in the http://iana.org , but to find the locations of root servers visit http://root-servers.org , If the domain doesn't exist, then resolve to NxDOMAIN in the authoritative server which will be cashed: this is called negative cache. The edge providers, content providers, provide recursive servers, transit providers, and public institutions.  Internet Exchange point These are the most invisible

Blog Writing Workflows

Image
I have used the workflow of Markdown blog writer for blogger for around two years. The main problem with this approach was the image manipulation. I have to separately upload the images to google photos. However later found the iPic image upload app which work with typora . But following two work flows are efficient as I found. Blog workflow this is how I create my new blogs. The basic tools are as follows: iPad Apple pencil MWeb app here the benifs of this workflow: I can work on same document both iPad and the mac computer Mweb support images and Malh for my documents In addion to that , Mweb publishes the web blog post to my Blogger site. The best is images are automatically upload to the google photos. Same post can be publish number of time, but Mweb keep track of images without duplicating. I use third party app sueh as Good Note 4 to create the diagram. For example following diagram was drawn from the DrawExpress App.  As shown in the above diagram,

IP explained

Image
IP explained Review of IPV 4 32 bits this 32 bits are divided in to 8 sections such as 32 / 8 = 4. Review of IPV6 128 bits  undecillion Leading zeros can be dropped (2134::AD1:..) :: can be used to represent collection of zeros (o:O:o) classless inter demain Routing Notation (CIDR) half of the possibilities cut down when leading bit is increased by 1.  In this figure, upper part shows the \(2^{16}\) possible ip address and the bottom part shows the \(2^{8}\) which is the smallest. For example in the Aws VPC subnets largest is 16 and smallest range is 28. Private Network Ranges As a standard 8, 12 and 16 Leadiing bits are reserved for the internal used. 10.0.0.0 to 10.255.255.255 for 10.0.0.0/8 172.16.0.0 to 172.31. 255.25 for 172.16.0.0/12 192.168.0.0 to 192.168.255.255 for 192.168.0.0/16

Python Simple Tips

It is very much to forget the simple python programming tips. Here the blog to remember. Collection manipulation tips How to concatenate to to tuple as follows t = 'ABC', 24 t = t + ('Sydeny',) In the second line , is the important character in the above code. You can repeate the tuple: t * 3 #('ABC', 24, 'Sydeny', 'ABC', 24, 'Sydeny', 'ABC', 24, 'Sydeny') this is the simple and not need to mentions #simple list a = [1,2,3,4,5] print a[1:3] #[2, 3] unpacking the data structure letters = ('A', 'B'), 'a','b' (l1,l2),l3,l4 = letters print (l1,l2,l3,l4) unpack the dictionary d = {'a':1, 'b':2, 'c':3} (k1,v1), (k2, v2), (k3,v3) = d.items() # ('c', 3) Order is not guaranteed. Create own Iterator Two methods are mandatory: __iter__() function and __next__() in python 3 but in next() in pytho 2. For example: class MyIter