Friday, December 11, 2020

AWS EXAM Study

 AWS Well-Architected Framework

  • Resilient
  • Performant
  • Secure
  • Cost-Optimized
  • Operationally-Excellent
65 Questions

~72% -> 720/1000 points

Exam Guide- White Papers

TODO AWS Well-Architected Framework

    https://www.youtube.com/watch?v=Ia-UEYYR44s&ab_channel=freeCodeCamp.org

    S3: Object-based storage service as opposed to file or block storage. Server-less.

    S3 Object
        Key   - Name of the object
        Value - Data itself
        Version Id - 
         Metadata -
        o Bytes to 5 Terabytes in size
    S3 Bucket
        Buckets hold objects and can also have folders which in turn hold objects
        S3 is a universal namespace so bucket names must be unique
    S3 Storage Classes
        
        Standard(default)  99.99% Availability, 11 9's Durability, Replicated across at least three AZ's
        Standard Infrequently Accessed -> Cheaper 50% less than Standard with reduced availability
        One Zone IA -> 20 % cheaper with reduced durability
        Glacier -> Long term cold storage. Retrieval of data can take minutes to hours but very cheap
        Glacier Long term storage -> longer retrieval (12 hrs) -> more cheaper
        
    S3 Security
       
       All news buckets are PRIVATE when created by default
       Logging per request can be turned on a bucket and saved in a different bucket
       Access control is configured using Bucket Policies and Access Control Lists (Legacy feature)

    S3 Encryption

       Transit- Traffic between uploader and S3 is achieved via SSL
       At Rest - S3 Managed Keys, SSE-
       
        


    Tuesday, June 5, 2012

    SignalR

    SQL Server Indexes

    Clustered Index
    Non-Clustered Index
    Composite Index
    Unique Index  (Automatically gets created when you create primary key or unique constraint)
    Covering Index


    asp.net mobile

    some random notes about mobile development from asp.net videos of scott hansleman


    1. Add a view port meta tag       <meta name ="viewport" content = "width=device-width">
    2. Fix it on the client
      • custom css
      • media css
      • adapative rendering
    3. Changing unordered list to dropdown as width is reduced .. use opt group of html 
    4. Dynamically change based on screen size  mediaqueri.es
    5. Fix it on the Client
      1. Pros 
        1. optimized for the current size
        2. less duplication of efforts
      2. Cons
        1. doesn't consider the differences between mobile and desktop
        2. inefficient bandwidth usage
    6. Fix it on the server
      1. custom mobile views using display modes
      2. jquery mobile (comes with asp.net mvc 4)
      3. Make new page with new scripts and css for the mobile page
      4. Mobile Master Page
      5. Mobile Child page
      6. data-role = "content".. tell html5 elements and jquery mobile takes care of the look it has to appear
      7. data-theme .. can be downloaded from jquery mobile ..
      8. jquery.mobile.mvc .. nuget package .. 
      9. view switcher .. (mobile version to desktop version & vice versa)
      10. Ctrl + , to find code or navigate in visual studio ..
      11. jquery mobile can do data filtering .. 
      • Pros
        • maximum flexibility
        • less duplication of efforts
      • Cons
        • can be repetitive
        • device detection can be hard
    7. Jquery Metro Mobile Theme
    8. 51degrees.mobi (nuget packaage available)
    9. Web Sites vs Web Applications
      1. Offline Capability
      2. knockout.js for data binding
      3. static resources for caching .. as cache manifest 


    Monday, March 19, 2012

    TSQL to LDAP


    Script using Master table to create the Link – Step 1
    EXEC master.dbo.sp_addlinkedserver @server = N'ADSI', @srvproduct=N'Active Directory Service Interfaces', @provider=N'ADSDSOObject', @datasrc=N'adsdatasource'
    GO
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'collation compatible', @optvalue=N'false'
    GO
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'data access', @optvalue=N'true'
    GO
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'dist', @optvalue=N'false'
    GO
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'pub', @optvalue=N'false'
    GO
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'rpc', @optvalue=N'false'
    GO
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'rpc out', @optvalue=N'false'
    GO
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'sub', @optvalue=N'false'
    GO
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'connect timeout', @optvalue=N'0'
    GO
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'collation name', @optvalue=null
    GO
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'lazy schema validation', @optvalue=N'false'
    GO
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'query timeout', @optvalue=N'0'
    GO
    EXEC master.dbo.sp_serveroption @server=N'ADSI', @optname=N'use remote collation', @optvalue=N'true'
    GO

    Step 2 – Set to Domain Admin account

    Then Query

    SELECT *
    FROM OPENQUERY(ADSI,
    'SELECT mail
    FROM ''LDAP://DC=orgname,DC=org''
    WHERE objectCategory = ''Person''
    AND objectClass = ''user''
    AND sAMAccountName = ''***''')


    Tuesday, March 13, 2012

    SSRS URL parameters


    This article shows you some of the most common reporting parameters to use in Microsoft SQL Server Reporting Services.
    When you go to the [http://reportserver/reportserver/foldername/reportname]
    The last command in the url is &rs:Command=Render
    You can add some other commands as follows:
    &rc:Parameters=Collapsed 
  • This collapses the parameter bar but sends the parameters in the URL in the browser
  • &rc:Parameters=true 
  • This shows the parameter bar and is the default
  • &rc:Parameters=false 
  • This prevents the parameters from being passed in the browser and expanded
  • &rc:toolbar=false 
  • This hides the toolbar
  • &rc:format=PDF 
  • This will open up the report as a PDF
  • &rs:Format=EXCEL&rc:OmitFormulas=true 
  • This will open the report in Excel
  • rs:ClearSession=true 
  • This clears the session state for the user. Used where the caching of the report prevents the designer from seeing their updated report and/or data.

  • * This is a very important parameter to know as more often than not, the report data doesn't update immediately unless parameters are changed, and your report may show cached data if this is not set.&rc:StyleSheet=MyCustomStyle 
  • Note don’t add the .css extension. And this style sheet must be in the folder Program FilesMicrosoft SQL ServerMSSQLReporting ServicesReportServerStyles folder.

  • Use the HTMLViewer.css as your base template.
  • ReportServer Parameters:
    If you add ?/FolderName/ReportName after the [http://servername/reportserver] you can run the report.
    The same applies if you want to list the reports, then just type ?/FolderName after the [http://servername/reportserver].
    This is commonly used when the user only has permissions at the folder level, not the root level. 

    Sunday, February 12, 2012

    State Pattern

    I am learning about design patterns in depth these days. Amazed by the solutions they give .. Some patterns like abstract factory , factory made sense to me but could not find immediate application to my code .. so could not get that uahaa feeling ;) When i read about the state pattern http://blog.raffaeu.com/archive/2011/02/13/state-pattern-using-c-part-01.aspx .. i found an immediate use for this in all my code. I realized how my code is tightly coupled all these days .. Implemented this and now i have a happy feeling .. I learned something new and implemented it . .................. :) :)

    I have a class which as states such as new edit view .. I moved all the logic related to this states using this pattern :)

    Friday, February 3, 2012

    Hidden Field in a disabled panel or div

    I was working on a form for a project. The form needs to be edited or viewed. For view i disabled all the panels or divs.But it has some links which needs to work. The links used hidden fields inside the disable panel.
    Then i sudden found the links are not working as the hidden fields are not retaining the values as they normally do. Then a google search on this gave me this link .. which saved my time a lot.. It seems asp.net does not maintain view state for hidden fields in a disabled panel. So need to get around this by some way :)

    http://www.codewrecks.com/blog/index.php/2010/04/15/asp-net-and-an-hiddenfield-inside-a-disable-panel/

    Monday, January 30, 2012

    Getting Class Name and Method name using reflection

    To get the current method and class name in which the code is executing, we can use reflection.

    Method Details

    System.Reflection.MethodBase.GetCurrentMethod().Name, 
    
    
    Class Details
    System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.Name
    
    
    
    Handy to log the errors .. 

    Thursday, January 26, 2012

    Error :Attempted to access an unloaded appdomain

    Attempted to access an unloaded appdomain. (Exception from HRESULT: 0x80131014)

    This occurs when we try to open two different connections in the same  Transaction Scope . Use Transaction Scope.Suppress for one of the connection if you are not performing any transaction in one of the connection.


    But if you are making transactions in both of the connections as a single one ... i need to study further about this ... probably you have to open a new transaction under the main one .. will verify later 

    Dynamic Grouping in SSRS

    To achieve dynamic grouping in SSRS , i.e you group by a parameter chosen by the user.

    1) Send the group by parameter to the stored procedure/sql statement and let SQL handle the grouping by case statement
     Ex :
        SELECT   case(@groupby)
    when 'gender' then dummy.Gender
    when 'race' then dummy.Race
    when 'district' then dummy.District
    end "groupbyfield",
    count(*)"Count",
     FROM  dbo.dummy
    WHERE DummyDate BETWEEN @startdate and @enddate
         GROUP BYcase(@groupby)
    when 'gender' then dummy.Gender
    when 'race' then dummy.Race
    when 'district' then dummy.District
    end "groupbyfield"

    2) Sort by the "groupbyfield"  in SSRS.