Posts

Claude Code : VS code

Image
 Use CMD + SHIFT +P to open VS Code Settings Change the meta Goto Terminal > Settings , "check the meta key" as well different commands to do different things , choose model etc = Use Option + T to choose thinking mode there is /config Output Style (note learning ) Init Large Language Model are non deterministic , for same prompt output is slightly different every time you can refer files in your claude code drag and drop file name use @ to refer can also give line number in a file. What does claude code 'vs code' extension do ? it helps make context  any files you open + select it builds context  Modes in Claude Code There are two modes Edit : to make changes Plan : to ask if something is possible Default (third mode) : for back and forth asking ques you can use "shift + tab" to switch below is default mode in default mode ask below ques then implement changes, by shifting to "edit" mode Context Window https://www.youtube.com/watch?v=-uW5-Ta...

Claude Code

Image
Install curl -fsSL https://claude.ai/install.sh | bash https://claude.com/product/claude-code to setup then run command from command line " claude " Ollama & Claude Code below shows how to use local ollama with claude code https://www.youtube.com/watch?v=FPUsn0ZK000 Can i use Claude Code with Other LLMs ? The short answer is yes , but it requires a bit of a "workaround" because Claude Code is built specifically to talk to Anthropic's API. While Anthropic doesn't officially support other models, you can use API proxies or local gateways to "trick" Claude Code into using GPT-4, Gemini, or even local models like Qwen or Llama. How it Works: The "Base URL" Trick Claude Code uses an environment variable called ANTHROPIC_BASE_URL to know where to send its requests. By default, this points to Anthropic. By changing this, you can route the traffic through a translator that converts Claude's requests into a format other models understand. ...

What is GenAI

Image
download code and slides https://courses.datacumulus.com/downloads/certified-ai-practitioner-9u8/ slides  https://media.datacumulus.com/aws-aif/AWS%20Certified%20AI%20Practitioner%20Slides%20v16.pdf?_gl=1*1019ecc*_ga*MTIzMDI0MzEyMC4xNzY5MDQ5NTg5*_ga_6GZZTGGX7H*czE3NjkwNDk1ODgkbzEkZzAkdDE3NjkwNDk1ODgkajYwJGwwJGgw   https://www.freecodecamp.org/news/machine-learning-vs-deep-learning-vs-generative-ai/

SpringBoot Security 15 : Securing WebApp

Image
 ok Whenever an ORG is trying to build an Auth servere there are 2 options custom product : keycloak (open src) , okta  , there are many on cloud as well (aws cognito) https://www.keycloak.org/  can be used for SSO Identity Broker & Social Login User Federation + more  What is a Keycloak : Realm ? A Keycloak realm is an isolated management space, akin to a tenant, that manages a logical collection of users, credentials, roles, and groups Convert Sprint Boot Application to a Resource Server https://github.com/eazybytes/spring-security/blob/4.x.x/section_15/springsecsection_15/pom.xml first : add dependency like below ( line number 43 )  < dependency >             < groupId > org.springframework.boot < / groupId >             < artifactId > spring-boot-starter-security-oauth2-resource-server < / artifactId > < / dependency > second : delete all authentication clas...

Spring Security 13 : oAuth2 and OpenID Connect

Image
  some website alow browser to store and refresh the token so that even if you open website after days , no re-auth needed Two Probs that oAuth2 allows you to solve is it stands for O pen Auth orization , created for "delegated authorization".  single auth mechanism encapsulated separately (may be in authn server) than the business logic you authorize one app to access your data without giving password delegated authn / authz (like PhotoApp wants to access google photos) There are different types of tokens access token : enables reading data of end user ID token refresh token  Grant Types : 5 types 1) Authorization Code if end user involved, non javascript framework front end  example SLACK and google integration , sign into github using stackoverflow and xxx integration 2) PKCE : if end user involved with javascript framework front end (like react , angular) 3) Client Credentials  no end user involved , API to API  4) Device Code no end user involved ...

Spring Security 6 : Define Authentication Provider

Image
 Till now we have used DAOAuthenticationProvider only Till now we learnt DAOAuthProvider (default) => UserDetailsService there maybe requirement for custom provider 1) age above 18 2) certain country only there maybe different types : all 3 are diff authentication provider username & passwd oAuth2 JAAS (legacy , java in built )  The AuthenticationProvider in Spring Security takes care of the authentication logic.  The default implementation of the AuthenticationProvider is to delegate the responsibility of finding the user in the system to a UserDetailsService implementation & PasswordEncoder for password validation. But if we have a custom authentication requirement that is not fulfilled by Spring Security framework, then we can build our own authentication logic by implementing the AuthenticationProvider interface. It is the responsibility of the ProviderManager which is an implementation of AuthenticationManager, to check with all the implementations of A...

SpringSecurity Section 4 : Defining in DB User

Setup mySQL DB using docker JdbcUserDetailsManager setup "docker desktop" in local https://www.warp.dev/ : AI console  docker run -p 3306 : 3306 - - name springsecurity -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE = appname -d mysql you should see downloaded image and running container in docker desktop https://sqlectron.github.io/  : Lightweight SQL Client https://medium.com/@CodeWithTech/spring-security-with-jdbcuserdetailsmanager-and-custom-userdetailsservice-a-complete-guide-248ddce0196c https://stackoverflow.com/questions/57288983/how-can-i-set-up-jdbcuserdetailsmanager-to-use-my-table https://www.youtube.com/watch?v=3Q2unvE-3Hg LEFT ok