<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vishakkv on Medium]]></title>
        <description><![CDATA[Stories by Vishakkv on Medium]]></description>
        <link>https://medium.com/@vishakkv954?source=rss-4afe31b95e8d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uUi8fk0SIw4JxmtmFqQo-A.png</url>
            <title>Stories by Vishakkv on Medium</title>
            <link>https://medium.com/@vishakkv954?source=rss-4afe31b95e8d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 22:32:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vishakkv954/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Kubernetes cheat book]]></title>
            <link>https://medium.com/@vishakkv954/kubernetes-cheat-book-c5f942fa5523?source=rss-4afe31b95e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5f942fa5523</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Vishakkv]]></dc:creator>
            <pubDate>Thu, 26 Dec 2024 18:51:12 GMT</pubDate>
            <atom:updated>2024-12-26T18:51:12.531Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t7QY2kPxb4EHz0IGw2TZFQ.jpeg" /></figure><h4>Kubectl Commands</h4><ol><li>Kubernetes Pod Commands</li></ol><pre><strong>1) List all pods in the cluster</strong><br>   $ kubectl get pods -A<br><br><strong>2)List all the pods in a specific namespace</strong><br>  $ kubectl get pods -n sample<br><strong><br>3) Discover more details of a pod </strong><br>  $ kubectl describe pod {pod_name} -n {namespace}<br>  $ kubectl get pods {pod_name} -o wide -n {namespace}<br><br><strong>4) List a pod that matches the name</strong><br>  $ kubectl get pods -A | grep {pod_starting_name}<br><strong><br>5) Get pod logs</strong><br>  $ kubectl logs {pod_name} -n {namespace}  // shows all the logs<br>  $ kubectl logs {pod_name} -n {namespace} --follow  // live log<br>  $ kubectl logs {pod_name} -n {namespace} --tail 20 // last 20 line log<br>  $ kubectl logs {pod_name}-c {container_name}   // log of specific container<br><strong>  <br>6) log in to the container</strong><br>  $ kubectl exec -it {pod_name} -n {namespace} bash<br><br><strong>7) List pods Sorted by Restart Count</strong><br>  $ kubectl get pods --sort-by=&#39;.status.containerStatuses[0].restartCount&#39;<br><br><strong>8) Get the version label of all pods with label app=app1</strong><br>  $ kubectl get pods --selector=app=app1 -o \<br>  jsonpath=&#39;{.items[*].metadata.labels.version}&#39;<br><br><strong>9) Show labels for all pods (or any other Kubernetes object that supports <br>labelling)</strong><br>  $ kubectl get pods --show-labels<br><strong><br>10) check pod cpu/mem utilization</strong><br>  $ kubectl top pod {pod_name}<br><br><strong>11) Show metrics for a given pod and its containers</strong><br>  $ kubectl top pod POD_NAME --containers<br><br><strong>12) Show metrics for a given pod and sort it by &#39;cpu&#39; or &#39;memory&#39;</strong><br>  $ kubectl top pod POD_NAME --sort-by=cpu<br><strong><br>13) Show pods running on a specific node</strong><br>  $ kubectl get pods -A -o wide | grep {node_name}<br><br><strong>14) Delete a pod</strong><br>  $ kubectl delete pod {pod_name} -n {namespace}<br><strong><br>15) Add annotation to the pod</strong><br>  $ kubectl annotate pod {pod_name} {annotation}<br><br><strong>16) Label a pod</strong><br>  $ kubectl label pod {pod_name} app=prod<br><br><strong>17) Overwrite the existnig label</strong> <br>  $ kubectl label pods {pod_name} -n deepak app=UAT --overwrite<br><br><strong>18) Get the yaml of a pod</strong><br>  $ Kubectl get pod &lt;pod_name&gt; -n &lt;namespace&gt; -o yaml<br><br><strong>19) Run a nginx pod</strong><br>  $ kubectl run nginx --image=nginx<br><br><strong>20) To list all pods in json format</strong><br>  $ kubectl get pods -o=json</pre><p>3. Kubernetes job commands</p><pre><strong>To create a job</strong><br>kubectl run &lt;job-name&gt; --image=&lt;image-name&gt; --restart=OnFailure -- &lt;command&gt;<br><strong><br>To create a job from the manifest file</strong><br>kubectl apply -f job.yml<br><br><strong>To list all the jobs</strong><br>kubectl get jobs -A<br><br><strong>To describe a job</strong><br>kubectl describe job {job_name} -n {namespace}<br><br><strong>To list completed jobs</strong><br>kubectl get jobs --field-selector=status.successful=1<br><br><strong>To edit a job</strong><br>kubectl edit job {jobname} -n {namespace}<br><br><strong>To delete all jobs</strong><br>kubectl delete jobs --all<br><br><strong>To delete a specifc job </strong><br>kubectl delete job {job_name} -n {namespace}</pre><p>4. Kubernetes Node commands</p><pre><strong>To list all nodes</strong><br>$ Kubectl get nodes<br><br><strong>Get more details of a node</strong><br>$ kubectl describe node {node_name}<br><br><strong>To display CPU and memory usage for a specific node.</strong><br>$kubectl top node &lt;name-of-node&gt;<br><br><strong>To add a label to a node</strong><br>$ kubectl label node &lt;node-name&gt; &lt;label-key&gt;=&lt;label-value&gt;<br><br><strong>Live node listing</strong><br>$ kubectl get nodes -w<br><br><strong>Get node details based on label selector</strong><br>$ kubectl get nodes –selector=&lt;label-key&gt;=&lt;label-value&gt;<br><br><strong>Delete a node</strong><br>$ kubectl delete node &lt;node_name&gt;<br><br></pre><p>5. Kubernetes Namespace commands</p><pre><strong>Show all namespace</strong><br>$ kubectl get ns<br><br><strong>Create a namespace</strong><br>$ kubectl create ns &lt;namespace name&gt;<br><br><strong>Delete a namespace</strong><br>$ kubectl delete ns &lt;namespace_name&gt;<br><br><strong>Edit the namespace</strong><br>$ kubectl edit ns &lt;namespace_name&gt;<br><br><strong>Get namespace details in yaml format</strong><br>$ kubectl get ns &lt;namespace_name&gt; -o yaml<br></pre><p>7. Kubernetes Service commands</p><pre><strong>To list services in a specific namespace</strong><br>$ kubectl get service -n &lt;namespace&gt;<br><br><strong>To list all services in the cluster</strong><br>$ kubectl get service -A<br><br><strong>To edit the service</strong><br>$ kubectl edit service &lt;service_name&gt;<br><strong><br>To view endpoint of a service</strong><br>$ kubectl get endpoints &lt;service-name&gt;<br><br><strong>To delete a specific service</strong><br>$ kubectl delete service &lt;service_name&gt; -n &lt;namespace&gt;<br><br><strong>To get more information about a service</strong><br>$ kubectl describe svc &lt;service_name&gt; -n &lt;namespace&gt;<br></pre><p>8. Kubernetes Configmap commands</p><pre><strong>To list all the configmaps </strong><br>$ Kubectl get configmap <br><br><strong>To list al the configmaps in specific namespace</strong><br>$ Kubectl get configmap -n &lt;namespace&gt;<br><br><strong>To get more details of a configmap</strong><br>$ kubectl describe configmap -n &lt;namespace&gt;<br><br><strong>To create a configmap</strong><br>$ kubectl create configmap -n &lt;namespace&gt;<br><br><strong>To edit a configmap</strong><br>kubectl edit configmap {cm_name} -n {namespace}<br><br><strong>To delete a configmap</strong><br>$ kubectl delete configmap -n &lt;namespace&gt;</pre><p>9. Kubernetes secrets commands</p><pre><strong>To list all the secrets</strong><br>$ Kubectl get secret -n &lt;namespace&gt;<br><strong><br>To list all the secrets in specific namespace</strong><br>$ kubectl describe secret -n &lt;namespace&gt;<br><strong><br>To create a secret</strong><br>$ kubectl create secret -n &lt;namespace&gt;<br><br><strong>To create a secret using imperative method</strong><br>$ kubectl create secret generic &lt;secret-name&gt; --from-literal=&lt;key&gt;=&lt;value&gt;<br><br><strong>To edit a secret</strong><br>$ kubectl edit secret -n &lt;namespace&gt;<br><strong><br>To delete a secret</strong><br>$ kubectl delete secret -n &lt;namespace&gt;</pre><p>10. Kubernetes Deployment commands</p><pre><strong>To list all the deployments</strong><br>$ kubectl get deployments -A<br><br><strong>To list deployment in specific namespace</strong><br>$ kubectl get deployments -n &lt;namespace&gt;<br><br><strong>To edit a deployment </strong><br>$ kubectl edit deployment &lt;deployment_name&gt; -n &lt;namespace&gt;<br><br><strong>To get details of a deployment</strong><br>$ kubectl describe deployment &lt;deployment_name&gt; -n &lt;namespace&gt;<br><br><strong>To update a deployment</strong><br>$ kubectl apply -f &lt;deployment.yml&gt;<br><strong><br>To check status of deployment rollout</strong><br>$ kubectl rollout status deployment &lt;deployment_name&gt;<br><strong><br>To check rollout history of deployment</strong><br>$ kubectl rollout history deployment &lt;deployment_name&gt;<br><strong><br>To delete deployment</strong><br>$ kubectl delete deployment &lt;deployment_name&gt; -n &lt;namespace&gt;<br><strong><br>To delete all deployments</strong><br>$ kubectl delete deployments -A</pre><p>11. Kubernetes Events commands</p><pre><strong>To list all events</strong><br>$ kubectl get events<br><strong><br>To describe the events(to get more details)</strong><br>$ kubectl describe events<br><br><strong>To get live update of event lists</strong><br>$ kubectl get evenets --watch<br></pre><p>12. Kubernetes Serviceaccount commands</p><pre><strong><br>To list all the serviceaccount(SA).</strong><br>$ kubectl create serviceaccount &lt;name&gt; -n &lt;namespace&gt;<br><br><strong>To list all the serviceaccount in specific namespace.</strong><br>$ kubectl get serviceaccount -n &lt;namespace&gt;<br><br><strong>To describe a serviceaccount(to get more details)</strong><br>$ kubectl describe serviceaccount -n &lt;namespace&gt;<br><strong><br>To create a service account</strong><br>$ kubectl create serviceaccount &lt;service-account-name&gt; -n &lt;namespace-name&gt;<br><br><strong>To delete a serviceaccount</strong><br>$ kubectl delete serviceaccount &lt;name&gt; -n &lt;namespace&gt;</pre><p>13. Kubernetes Daemonset commands</p><pre><strong>To list all the daemonset in a namespace</strong><br>$ kubectl get daemonsets -n &lt;namespace&gt;<br><br><strong>To describe a daemonset</strong><br>$ kubectl describe daemonset &lt;name&gt; -n &lt;namespace&gt; -n &lt;namespace&gt;<br><br><strong>To delete a daemonset</strong><br>$ kubectl delete daemonset &lt;daemonset_name&gt; -n &lt;namespace&gt; <br><br><strong>To roll update the daemonset </strong><br> $ kubectl rollout restart daemonset &lt;name&gt; -n &lt;namespace&gt;<br><br><strong>To create a daemonset</strong><br>$ kubectl apply -f &lt;daemonset.yml&gt;<br><br><strong>To edit a daemonset</strong><br>$ kubectl edit daemonset &lt;daemonset_name&gt; -n &lt;namespace&gt;</pre><p>14. Kubernetes Replicaset commands</p><pre><strong>To list all the replicasets</strong><br>$ kubectl get replicaset<br><br><strong>To list all the replicaset in a specific namespace</strong><br>$ kubectl get replicaset -n &lt;namespace&gt;<br><br><strong>To describe the replicaset</strong><br>$ kubectl describe replicaset -n &lt;namespace&gt;<br><br><strong>To create/update a replicaset</strong><br>$ kubectl apply -f &lt;replicaset.yml&gt;<br><strong><br>To edit a replicaset</strong><br>$ kubectl edit replicaset {rs_name} -n {namespace}<br><strong><br>To delete a replicaset</strong><br>$ kubectl delete replicaset -n &lt;namespace&gt;</pre><p>15. Kubernetes Persistent volume(PV) commands</p><pre><strong>To list all the persistent volume(PV)</strong><br>$ kubectl get pv<br><br><strong>To edit a persistent volume(PV)</strong><br>$ kubectl edit pv &lt;pv name&gt;<br><br><strong>To delete a persistent volume(PV)</strong><br>$ kubectl delete pv <br><br><strong>To create/update persistent volume(PV)</strong><br>$ kubectl apply -f &lt;pv.yml&gt;</pre><p>16. Kubernetes Persistent volume claim(PVC) commands</p><pre><strong>To list all the PVC in a namespace</strong><br>$ kubectl get pvc -n &lt;namespace&gt;<br><br><strong>To delete a PVC</strong><br>$ kubectl delete pvc &lt;name&gt; -n &lt;namespace&gt;<br><br><strong>To edit a PVC</strong><br>$ kubectl edit pvc {pvc_name} -n {namespace}<br><br><strong>To create a PVC</strong><br>$ kubectl apply -f &lt;pvc.yml&gt;</pre><p>17. Kubernetes Storage class(SC) commands</p><pre><strong>To show all the storage class</strong><br>$ Kubect get sc <br><br><strong>To delete specific storage class</strong><br>$ kubectl delete sc &lt;name&gt;<br><strong><br>To create a storage class from manifest file</strong><br>$ kubectl apply -f &lt;sc.yml&gt;</pre><p>19. Kubernetes cluster info commands</p><pre><strong>To get information abour the kubernetes version</strong><br>$ kubectl version<br><br><strong>To get info about config view</strong><br>$ kubectl config-view<br><br><strong>To get information abouapi versions<br></strong>$ kubectl api-versions<br><strong><br>To get cluster information</strong><br>$ kubectl cluster-info<br><strong><br>To get information about api resources</strong><br>$ kubectl api-resources</pre><p>20. Kubernetes ingress commands</p><pre><strong>To show all the ingress</strong><br>$ kubectl get ingress -A<br><br><strong>To edit the ingress</strong><br>$ kubectl edit ingress &lt;ingress name&gt; -n namespace<br><br><strong>To apply the ingress manifest file</strong><br>$ kubectl apply -f ingress.yml<br><strong><br>To delete a ingress</strong><br>$ kubectl delete ingress &lt;ingress name&gt; -n namespace<br><strong><br>Delete ingress from manifest file</strong><br>$ kubectl delete -g ingress.yml</pre><p>21. Kubernetes role commands</p><pre><strong>To create a role</strong><br>$ kubectl create role &lt;role-name&gt; --verb=&lt;verbs&gt; --resource=&lt;resources&gt; -n &lt;namespace-name&gt;<br><br><strong>To list the role</strong><br>$ kubectl get roles -n &lt;namespace-name&gt;<br><br><strong>To describe a role</strong><br>$ kubectl describe role &lt;role-name&gt; -n &lt;namespace-name&gt;<br><strong><br>To delete a role</strong><br>$ kubectl delete role &lt;role-name&gt; -n &lt;namespace-name&gt;</pre><p>22. Kubernetes role binding commands</p><pre><strong>To create rolebinding</strong><br>$ kubectl create rolebinding &lt;rolebinding-name&gt; --role=&lt;role-name&gt; --serviceaccount=&lt;namespace-name&gt;:&lt;service-account-name&gt; -n &lt;namespace-name&gt;<br><br><strong>To list all rolebinding in specific namespace</strong><br>$ kubectl get rolebindings -n &lt;namespace-name&gt;<br><br><strong>To describe a rolebinding</strong><br>$ kubectl describe rolebinding &lt;rolebinding-name&gt; -n &lt;namespace-name&gt;<br><br><strong>To delete a rolebinding</strong><br>$ kubectl delete rolebinding &lt;rolebinding-name&gt; -n &lt;namespace-name&gt;</pre><p>23. Kubernetes clusterrole commands</p><pre><strong>To create clusterrole</strong><br>$ kubectl create clusterrole &lt;clusterrole-name&gt; --verb=&lt;verbs&gt; --resource=&lt;resources&gt; <br><br><strong>To list all the clusterroles</strong><br>$ kubectl get clusterroles<br><br><strong>To get more details of clusterrole</strong><br>$ kubectl describe clusterrole &lt;clusterrole-name&gt;<br><strong><br>To delete a clusterrole</strong><br>$ kubectl delete clusterrole &lt;clusterrole-name&gt;</pre><p>24. Kubernetes clusterrolebinding commands</p><pre><strong>To create clusterrolebinding</strong><br>$ kubectl create clusterrolebinding &lt;clusterrolebinding-name&gt; --clusterrole=&lt;clusterrole-name&gt; --serviceaccount=&lt;namespace-name&gt;:&lt;service-account-name&gt;<br><br><strong>To list all the clusterrolebinding</strong><br>$ kubectl get clusterrolebindings<br><br><strong>To get more details of clusterrolebinding</strong><br>$ kubectl describe clusterrolebinding &lt;clusterrolebinding-name&gt;<br><br><strong>To delete a clusterrolebinding</strong><br>$ kubectl delete clusterrolebinding &lt;clusterrolebinding-name&gt;</pre><p>25. Kubernetes HPA commands</p><pre><strong>To create the HPA</strong><br>$ kubernets apply -f hpa.yml<br><strong><br>To get the list of HPA<br></strong>$ kubectl get hpa -A<br><br><strong>To describe the HPA</strong><br>$ kubectl describe hpa &lt;hpa-name&gt; -n &lt;namespace&gt;<br><br><strong>To edit the HPA</strong><br>$ kubectl edit hpa &lt;hpa-name&gt; -n &lt;namespace&gt;<br><br></pre><p>cheers🥂<br>Keep Learning 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5f942fa5523" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create and update nginx home page using kubernetes configmap.]]></title>
            <link>https://medium.com/@vishakkv954/how-to-create-and-update-nginx-home-page-using-kubernetes-configmap-619402c65b1c?source=rss-4afe31b95e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/619402c65b1c</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[site-reliability-engineer]]></category>
            <dc:creator><![CDATA[Vishakkv]]></dc:creator>
            <pubDate>Mon, 16 Dec 2024 18:39:50 GMT</pubDate>
            <atom:updated>2024-12-16T18:39:50.386Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mGOrkOcA-6FBoPC3uzTfZQ.jpeg" /><figcaption>Nginx in kubernetes</figcaption></figure><p>To create and update the Nginx deployment, we need to create a ConfigMap where we’ll add the contents to be displayed on the Nginx default page. This way, we don’t have to log in to the Nginx container and manually update the default page, which is not the recommended approach. Instead, we only need to update the ConfigMap, and it will automatically update the default Nginx page.</p><p><strong>Let’s start!</strong></p><ol><li>First we can create the nginx configmap(nginx-configmap.yml), where we can add the html contents of the nginx home page.</li></ol><pre>apiVersion: v1<br>kind: ConfigMap<br>metadata:<br>  name: nginx-configmap<br>  namespace: test<br>data:<br>  index.html: |<br>    &lt;html&gt;<br>    &lt;h1&gt;Welcome To NGINX&lt;/h1&gt;<br>    &lt;/br&gt;<br>    &lt;h1&gt;Nginx&lt;/h1&gt;<br>    &lt;h2&gt;Nginx home page&lt;/h2&gt;<br>    &lt;/html</pre><p>Create the configmap,</p><pre>kubectl apply -f nginx-configmap.yml</pre><p>2. Second we can create the nginx deployment file(deployment.yml),</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: Nginx<br>  namespace: test<br>spec:<br>  selector:<br>    matchLabels:<br>      app: nginx<br>  replicas: 1<br>  template:<br>    metadata:<br>      labels:<br>        app: nginx<br>    spec:<br>      containers:<br>      - name: nginx<br>        image: nginx<br>        ports:<br>        - containerPort: 80<br>        volumeMounts:<br>            - name: nginx-vol<br>              mountPath: /usr/share/nginx/html/<br>      volumes:<br>      - name: nginx-vol<br>        configMap:<br>          name: nginx-configmap</pre><p>In the above deployment file , we are creating an Nginx pod with port 80. Additionally, we create a volume named “nginx-vol” &amp; attach the configmap . We will mention this volume in the volumeMounts along with the mountpath(default nginx path).</p><p>3. Create a service manifest file called “nginx-service.yml”. Kubernetes service is required to expose the application outside the cluster.</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: nginx-service<br>  namespace: test<br>spec:<br>  selector:<br>    app: nginx<br>  ports:<br>    - port: 80<br>      targetPort: 80</pre><p>4. Create a ingress manifest file to expose the nginx application outside the cluster(in the browser).</p><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: test-app<br>  namespace: test<br>  annotations:<br>    kubernetes.io/ingress.class: ingress-nginx<br>spec:<br>  ingressClassName: nginx<br>  rules:<br>  - host: &quot;testapp.com&quot;<br>    http:<br>      paths:<br>        - pathType: Prefix<br>          path: &quot;/&quot;<br>          backend:<br>            service:<br>              name: nginx-service<br>              port:<br>                number: 80</pre><p>5 . Finally, to update the content on the index page, simply modify the data section within the ConfigMap and then restart the pod. After restarting the pods, check the browser to see the latest updated content reflected on the Nginx homepage.</p><p>Happy Learning🚀🥂</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=619402c65b1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[All-in-One Tool for Application Testing⚡]]></title>
            <link>https://medium.com/@vishakkv954/all-in-one-tool-for-application-testing-b6ff85958b5c?source=rss-4afe31b95e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6ff85958b5c</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[ｐｙｔｈｏｎ]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Vishakkv]]></dc:creator>
            <pubDate>Sun, 15 Dec 2024 16:02:57 GMT</pubDate>
            <atom:updated>2024-12-15T16:02:57.911Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ExfTgNnkjgVWCSUjJqpZcQ.png" /></figure><p>Yes, you heard it right!</p><h4>What is K6 ?</h4><p>k6 is a modern open source load-testing tool, built on <a href="https://k6.io/about">our years of experience</a> in the performance and testing industries. It’s built to be powerful, extensible, and full-featured. The key design goal is to provide the best developer experience.</p><h4>Core features of K6</h4><ul><li>Configurable load generation. Even lower-end machines can simulate lots of traffic.</li><li>Tests as code. Reuse scripts, modularize logic, version control, and integrate tests with your CI.</li><li>A full-featured API. The scripting API is packed with features that help you simulate real application traffic.</li><li>An embedded JavaScript engine. The performance of Go, the scripting familiarity of JavaScript.</li><li>Multiple Protocol support. HTTP, WebSockets, gRPC, and more.</li><li>Large extension ecosystem. You can extend k6 to support your needs. And many people have already shared their extensions with the community!</li><li>Flexible metrics storage and visualization. Summary statistics or granular metrics, exported to the service of your choice.</li></ul><p>K6 is not just a testing tool, its a complete testing package where we can initiate different types of tests.</p><h4>Installation (fedora/centos)</h4><p>Using dnf (or yum on older versions):</p><pre>$ https://k6.io/docs/get-started/installation/<br>$ sudo dnf install k6</pre><p>For more detailed installation methods, follow the below link. <a href="https://k6.io/docs/get-started/installation/">Installation (k6.io)</a></p><h4>Types of tests supported🚀</h4><p><strong>Load and performance testing</strong></p><ul><li>k6 is optimized for minimal resource consumption and designed for running high-load performance tests such as<strong> spike, stress, or soak tests.</strong></li></ul><p><strong>Browser performance testing</strong></p><ul><li>Through the k6 browser api you can run browser-based performance tests and collect browser metrics to identify performance issues related to browsers. Additionally, you can mix browser tests with other performance tests to get a comprehensive view of your website’s performance.</li></ul><p><strong>Performance and synthetic monitoring</strong></p><ul><li>You can schedule tests to run with minimal load very frequently, continuously validating the performance and availability of your production environment. For this, you can also use grafana cloud synthetic monitoring which supports running k6 scripts.</li></ul><p><strong>Automation of performance tests</strong></p><ul><li>k6 integrates seamlessly with CI/CD and automation tools, enabling engineering teams to automate performance testing as part of their development and release cycle.</li></ul><p><strong>Chaos and resilience testing</strong></p><ul><li>You can use k6 to simulate traffic as part of your chaos experiments, trigger them from your k6 tests or inject different types of faults in Kubernetes with xk6-disruptor.</li></ul><p><strong>Infrastructure testing</strong></p><ul><li>With k6 extensions, you can add support to k6 for new protocols or use a particular client to directly test individual systems within your infrastructure.</li></ul><p><strong>Below is the sample k6 script to execute the load test on a API endpoint</strong></p><pre>import http from &#39;k6/http&#39;;<br>import { check, sleep } from &#39;k6&#39;;<br><br>export let options = {<br>  stages: [<br>    { duration: &#39;1m&#39;, target: 10 }, // Ramp up to 10 virtual users in 1 minute<br>    { duration: &#39;3m&#39;, target: 10 }, // Maintain 10 users for 3 minutes<br>    { duration: &#39;1m&#39;, target: 0 },  // Ramp down to 0 users in 1 minute<br>  ],<br>};<br><br>export default function () {<br>  // Define the API endpoint you want to test<br>  const url = &#39;https://your-api-endpoint.com/api/v1/resource&#39;;<br>  <br>  // Make a GET request to the API<br>  let response = http.get(url);<br><br>  // Check that the response status is 200 OK<br>  check(response, {<br>    &#39;is status 200&#39;: (r) =&gt; r.status === 200,<br>  });<br><br>  // Optionally, test other metrics like response time<br>  check(response, {<br>    &#39;response time is less than 500ms&#39;: (r) =&gt; r.timings.duration &lt; 500,<br>  });<br><br>  // Simulate user think time before the next request<br>  sleep(1); // Sleep for 1 second<br>}</pre><p>Its written in JS, you can make the required changes based on the type of test you want to execute.</p><p>k6 Cloud test output;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tNhYwJW82zTomquJw_beeQ.png" /></figure><p><strong>Conclusion</strong></p><p>k6 is a powerful, developer-friendly, and scalable load testing tool that is perfect for modern application testing workflows. Its open-source nature, coupled with its easy integration into CI/CD pipelines, makes it a top choice for teams looking to optimize the performance of their applications. By using k6, you can identify performance issues early in the development cycle and ensure that your application delivers a seamless experience for users, even under high load.</p><p>Keep Learning🧑‍💻🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6ff85958b5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tomcat delpoyment using Python.]]></title>
            <link>https://medium.com/@vishakkv954/tomcat-delpoyment-using-python-89a3b693c284?source=rss-4afe31b95e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/89a3b693c284</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Vishakkv]]></dc:creator>
            <pubDate>Mon, 09 Dec 2024 16:23:45 GMT</pubDate>
            <atom:updated>2024-12-09T16:24:34.554Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/285/1*OeBogh8wUzJ9gBsx4IT38w.png" /></figure><p>Tomcat is an open-source web server and servlet container developed by the Apache Software Foundation. It allows Java-based web applications to be deployed, providing a platform to run Java Server Pages (JSP) and servlets. Tomcat is widely used due to its lightweight and efficient design in handling web application requests.</p><p>This is a simple deployment script that does the job of a manual deployment process.</p><p>This deployment script can be used for monolithic architecture.</p><pre>//import modules<br><br>import os<br>import sys<br>import shutil<br>import os.path<br>import glob<br>import datetime<br>//Add text color<br>class b:<br>    W = &#39;\033[95m&#39;<br>    BLUE = &#39;\033[94m&#39;<br>    OK = &#39;\033[92m&#39;<br>    END = &#39;\033[0m&#39;<br>    FAIL = &#39;\033[91m&#39;<br>    white = &#39;\033[1m&#39;<br>    y = &#39;\033[93m&#39;<br>os.system(&quot;sudo /bin/su - tomcat8&quot;) //switch to tomcat user<br>os.system(&quot;systemctl stop tomcat&quot;)  // stop the tomcat service<br>os.chdir(&quot;/root/folder1&quot;)<br>for file in glob.glob(&quot;*.war&quot;):     // take backup of old war file<br>    s=os.path.splitext(file)[0]<br>    os.chdir(&quot;/opt/tomcat/webapps&quot;)<br>    os.system(&quot;rm -rf &quot; + s )<br>//create a folder with current date<br>s = datetime.datetime.now().strftime(&#39;%d-%m-%Y:%H:%M:%S&#39;)<br>os.mkdir(&quot;/root/python/backup-&quot; + s )<br>//Copy all the older backup file to the new backup folder<br>for file in os.listdir(&quot;/root/folder1/&quot;):<br>    os.chdir(&quot;/opt/tomcat/webapps/&quot;)<br>    if os.path.exists(file):<br>        dn=&quot;/home/ec2-user/backup/&quot; + s<br>        shutil.move(file, dn)<br>        print(b.BLUE+&quot;Backup of &quot; + file+&quot; taken&quot;+b.END)<br>    else:<br>        print(&quot;No &quot; + file + &quot; for taking  backup&quot;)<br><br>    os.chdir(&quot;/root/folder1&quot;)<br>    os.system(&quot;cp -rf &quot; + file + &quot; /opt/tomcat/webapps&quot;)<br>    os.chdir(&quot;/opt/tomcat/webapps&quot;)<br>    os.system(&quot;chown -R redhat.redhat &quot; + file )<br>    print(b.OK+ file +&quot; Deployed&quot;+b.END)<br>    print(&quot;--------------------------------------------------------------------------------------------&quot;)<br>os.system(&quot;systemctl restart tomcat&quot;)<br>print(b.OK+&quot;Deployment successfully Completed....&quot;)<br>c=input(b.W+&quot;To view live logs press &#39;1&#39; or press &#39;2&#39; to end the process : &quot;+b.END)<br>if c==1:<br>    os.system(&quot;tail -fn 100 /opt/tomcat/logs/catalina.out&quot;)<br>else:<br>    pass</pre><p>It will create a backup of the current War files before deployment (for rollback purposes) and deploy the updated files with the necessary permissions and restarts, we can view the live logs after the deployment.</p><p>Keep learning 👩🏻‍💻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89a3b693c284" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python youtube video downloader]]></title>
            <link>https://medium.com/@vishakkv954/python-youtube-video-downloader-e7e260fe8b45?source=rss-4afe31b95e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7e260fe8b45</guid>
            <category><![CDATA[codin]]></category>
            <category><![CDATA[dev]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Vishakkv]]></dc:creator>
            <pubDate>Sun, 08 Dec 2024 10:34:43 GMT</pubDate>
            <atom:updated>2024-12-08T10:36:14.269Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G3NrLEVG8XpnTCAMQqs2pg.png" /></figure><p>Python-based downloaders typically don’t require a graphical user interface (GUI), making them lightweight and fast. This is ideal for users who prefer command-line tools or need a solution that doesn’t consume unnecessary system resources.</p><h4>1) Setting Up Your Environment:</h4><ul><li>Install the required Python libraries, such as pytube for interacting with YouTube.</li></ul><pre>pip install pytube</pre><h4>2) Build the code:</h4><pre>import pytube<br>video_url = &#39;https://www.youtube.com/w&#39;<br>try:<br>    video = pytube.YouTube(video_url).streams.first()  <br>    video.download(&#39;/Users/vk/Downloads&#39;)  <br>    print(&quot;Success: The file is downloaded.&quot;)<br>except:<br>    print(&quot;Error: There might be an issue with the url provided.&quot;)</pre><p>With Python, you can automate the download process for multiple videos at once using the loop with the list of youtube urls.</p><p><strong>Conclusion</strong><br>Python YouTube downloader offers a lot of flexibility, automation, and customization for downloading videos or playlists. It is an ideal choice for developers, content creators, or anyone looking to streamline the video downloading process without relying on third-party software. The ability to control video quality, automate downloads, and integrate into larger workflows makes Python a powerful choice for YouTube video downloading needs.</p><p>Keep Learning🧑‍💻🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7e260fe8b45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create a simple Text-Audio converter using Python]]></title>
            <link>https://medium.com/@vishakkv954/create-a-simple-text-audio-converter-using-python-4b269a67baa0?source=rss-4afe31b95e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b269a67baa0</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Vishakkv]]></dc:creator>
            <pubDate>Sat, 18 May 2024 06:26:49 GMT</pubDate>
            <atom:updated>2024-05-18T06:26:49.745Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*liTRMfsfzcL5grMEvBg3kw.png" /></figure><p>We are using pyttsx3 to convert the text to speech, its an text-to-speech conversion library in Python.</p><p><strong>Prerequisites:</strong></p><ol><li>Python3</li><li>pyttsx3 library</li></ol><p><strong>Let’s start coding!</strong></p><ol><li>Create a python file called speak.py and copy the below code,</li></ol><pre>import pyttsx3  //importing the pyttsx3 library<br>talk = pyttsx3.init()  // creating the object<br>speech = input(&quot;write: &quot;)  //input method<br>rate = talk.getProperty(&#39;rate&#39;) <br>print(rate) <br>talk.setProperty(&#39;rate&#39;, 140) <br>voices = talk.getProperty(&#39;voices&#39;)<br>talk.setProperty(&#39;voice&#39;, voices[0].id) // The voice can be changed , &quot;0&quot; for male and &quot;1&quot; for female <br>talk.say(speech)<br>talk.runAndWait()</pre><p>2. Run the code</p><pre>python3 speak.py<br><br>//it will ask for the input, provide the text which needs to convert to speech.</pre><p>If you want to save the voice to a mp3 file run the below code,</p><pre><br> engine.save_to_file(&#39;Type the text you want to convert&#39;, &#39;test.mp3&#39;)<br> engine.runAndWait()</pre><p><strong>NB</strong>: On linux make sure that ‘espeak’ and ‘ffmpeg’ are installed</p><p>Happy learning🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b269a67baa0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Curious about Kubenetes cost?]]></title>
            <link>https://medium.com/@vishakkv954/curious-about-kubenetes-cost-c1c7bb68d8ac?source=rss-4afe31b95e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1c7bb68d8ac</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cost]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Vishakkv]]></dc:creator>
            <pubDate>Tue, 14 May 2024 16:01:07 GMT</pubDate>
            <atom:updated>2024-05-14T16:01:07.278Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4muxWTvs6lOzP4e1g6x97w.png" /><figcaption>Kubecost dashboard</figcaption></figure><p>While cloud platforms like AWS, Azure and other cloud providers will provide cost information, but it’s challenging to obtain the complete kubernetes cost. To get the complete kubernetes cost, there will be some manual effort to calculate the kubernetes service cost + loadbalancer cost + instance cost + networking cost so on.</p><h4><strong>What is Kubecost?</strong></h4><p>Kubecost is a powerful tool designed specifically to address the challenge of managing costs associated with running containerized applications on Kubernetes clusters.</p><h4><strong>Advantages of kubecost:</strong></h4><ol><li><strong>Cost Allocation</strong></li></ol><p>Kubecost provides detailed breakdowns of your Kubernetes cluster’s resource consumption and the corresponding costs. It delves into costs by namespaces, deployments, pods, and container types, helping you pinpoint areas where you can potentially save.</p><p>2. <strong>Unified cost monitoring</strong></p><p>See all of your Kubernetes and out-of-cluster spend in one place, with full cloud service billing integration</p><p><strong>3. Optimization Insights</strong></p><p>Get customized recommendations based on your own environment and behavior patterns</p><p><strong>4. Alerts and governance</strong></p><p>Achieve peak application performance and improve reliability with customizable alerts, configurable Availability Tiers, and real-time updates.</p><p><strong>5. Purpose-built for teams running Kubernetes</strong></p><p>Running containers on Kubernetes requires a new approach for visualizing and optimizing spend. Kubecost is designed from the ground up for Kubernetes and the Cloud Native ecosystem.</p><p><strong>6. Own &amp; control all of your own data</strong></p><p>Kubecost is fully deployed in your infrastructure — we don’t require you to egress any data to a remote service. It’s deeply important to us that users are able to retain and control access to their own private information, e.g. sensitive cloud spend data.</p><p><strong>7. Built on open source</strong></p><p>Kubecost began as an open source project with a goal of giving small engineering teams access to great cost visibility. As a result, our solution is tightly integrated with the open source cloud native ecosystem, e.g. Kubernetes, Prometheus, and Grafana.</p><h4>Install Kubecost</h4><p>Kubecost installation is pretty simple, we just need to run a helm command and if you have any custom alterations then make the required changes in the <em>values.yml </em>and append that with the helm command.</p><ol><li>Install kubecost using helm</li></ol><pre>helm install kubecost cost-analyzer --repo https://kubecost.github.io/cost-analyzer --namespace kubecost --create-namespace </pre><p>2. Enable port forward</p><pre>kubectl port-forward --namespace kubecost deployment/kubecost-cost-analyzer 9090</pre><p>2.1 If you are using ingress controller(Optional)</p><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: kubecost<br>  namespace: kubecost<br>  annotations:<br>    //your nginx ingress annotations<br>spec:<br>  rules:<br>  - host: your-kubecost-url<br>    http:<br>      paths:<br>      - path: /<br>        pathType: Prefix<br>        backend:<br>          service:<br>            name: kubecost-cost-analyzer<br>            port:<br>              number: 9090</pre><p>3. See the data</p><pre>http://localhost:9090<br>2.1 ---&gt; curl </pre><p>Kubecost also provides enterprise version where we can integrate kubecost with cloud providers and can bind all the kubernets cluster cost in a single UI.</p><p><em>Checkout more about kubecost in the below link</em></p><p><a href="http://kubecost.com/">Kubecost | Kubernetes cost monitoring and management</a></p><p>Happy learning🥂🐧</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1c7bb68d8ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best books for programmers]]></title>
            <link>https://medium.com/@vishakkv954/best-books-for-programmers-8bd93f5cab7c?source=rss-4afe31b95e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bd93f5cab7c</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <dc:creator><![CDATA[Vishakkv]]></dc:creator>
            <pubDate>Fri, 22 Dec 2023 17:26:12 GMT</pubDate>
            <atom:updated>2023-12-22T17:26:12.262Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQ0sog8XyZ31W0TOe8pvUw.jpeg" /></figure><h3>Python</h3><p>Python is a high-level, interpreted programming language with a clean and expressive syntax. It supports multiple programming paradigms, including object-oriented and functional programming. Python’s dynamic typing and automatic memory management simplify development, while its extensive standard library and large ecosystem of third-party packages make it versatile for various applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/1*Gr5zco64dDRIY169aWCtwA.png" /></figure><p>Books📘:</p><ol><li>Fluent Python</li><li>Python Crash Course</li><li>Head First Python</li><li>Learn Python3 the hard way</li><li>Python Cookbook</li><li>Learning Python</li><li>Think Python</li></ol><h3>Java</h3><p>Java is a class-based, object-oriented programming language designed for platform independence. It utilizes a bytecode compilation model, where source code is compiled into an intermediate bytecode executed on the Java Virtual Machine (JVM). Java features strong typing, automatic garbage collection, and multithreading capabilities, making it suitable for building scalable and concurrent applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*P1q_2UJQuFKdF_WmkOGKvQ.png" /></figure><p>Books📘:</p><ol><li>Java</li><li>Thinking In Java</li><li>Code Java</li><li>Head First Java</li><li>Java: The Complete Reference</li></ol><h3>Javascript</h3><p>JavaScript is a high-level, interpreted programming language primarily used for client-side web development. It is dynamically typed and supports object-oriented, imperative, and functional programming paradigms. JavaScript code is executed in web browsers, enhancing user interactivity and providing dynamic content. Asynchronous programming is facilitated through features like callbacks and Promises, allowing efficient handling of concurrent tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*rq352RqaoLrOxbKW60Dw8A.png" /></figure><p>Books📘:</p><ol><li>Javascript: The Good Parts</li><li>Objected Oriented Javascript</li><li>Head First Javascript</li><li>Javascript: The Definitive Guide</li><li>Elonquent Javascript</li></ol><h3>C</h3><p>C is a low-level, procedural programming language known for its efficiency and direct access to memory. It features a simple and concise syntax, making it a powerful choice for system programming and embedded systems. C supports structured programming with functions and modular code, and it provides low-level manipulation through pointers. Its standard library includes essential functions for I/O, string manipulation, and mathematical operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/229/1*9iGU4Md-pSH9Nsvbe_fSiA.png" /></figure><p>Books📘:</p><ol><li>C: The Complete Reference</li><li>C Programming Language</li><li>Head First C</li><li>Expert C Programming</li><li>C Programming in easy steps</li></ol><h3>C++</h3><p>C++ is an object-oriented programming language derived from C, adding features like classes, inheritance, and polymorphism for enhanced code organization and reusability. It supports both procedural and object-oriented paradigms, providing a balance between performance and abstraction. C++ introduces features like templates for generic programming and exception handling for robust error management. It is widely used in system programming, game development, and high-performance applications, leveraging its efficiency and versatility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/231/1*HPiqqmkVYt2sdwA6DKAewA.png" /></figure><p>Books📘:</p><ol><li>C++: The Complete reference</li><li>C++ Primer</li><li>Starting out with C++</li><li>C++ Pocket Reference</li><li>C++ in One Hour a Day</li><li>The C++ Programming Language</li></ol><h3>C#</h3><p>C# (pronounced C sharp) is a statically typed, object-oriented programming language developed by Microsoft. It is designed for building Windows applications, web applications, and enterprise-level software. C# combines the power of low-level programming with modern language features, including automatic memory management through the Common Language Runtime (CLR).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/213/1*0jAJrcD6OZiQrA-BDY8o0A.png" /></figure><p>Books📘:</p><ol><li>C#</li><li>Learn C# in One Day</li><li>C# 5.0 in a Nutshell</li><li>Learn C# Programming</li><li>C# Crush Course</li><li>C# in Depth</li><li>Lean C# in 7 Days</li></ol><h3>Go</h3><p>Go, also known as Golang, is a statically typed, compiled programming language developed by Google. It is designed for simplicity, efficiency, and ease of use. Go features a minimalist syntax, garbage collection, and strong support for concurrent programming through goroutines and channels. It emphasizes readability and productivity, making it suitable for large-scale software development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*-zwqfifAUHDyjalEsuErcQ.png" /></figure><p>Books📘:</p><ol><li>An introduction to programming in Go</li><li>The Go Programming Language</li><li>Go in Action</li><li>Hands on Go Programming</li><li>Mastering Go</li><li>Head First Go</li></ol><h3>Ruby</h3><p>Ruby is a dynamic, object-oriented scripting language with a concise and readable syntax. It supports multiple programming paradigms, including procedural, functional, and object-oriented programming. Ruby features automatic memory management through garbage collection and dynamic typing, promoting flexibility in code development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*-TO-hCRB4TaHwN82mb448g.png" /></figure><p>Books📘:</p><ol><li>Practical Object-Oriented Design in Ruby</li><li>The Ruby on Rails tutorial</li><li>Refactoring Ruby</li><li>The Rails Way</li><li>Rebuilding Rails</li><li>Confident Ruby</li><li>Crafting Rails 4 applications</li></ol><p>Happy Learning📘🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bd93f5cab7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build your first python flask App]]></title>
            <link>https://medium.com/@vishakkv954/build-your-first-python-flask-app-c64efa519d38?source=rss-4afe31b95e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c64efa519d38</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Vishakkv]]></dc:creator>
            <pubDate>Thu, 21 Dec 2023 14:57:29 GMT</pubDate>
            <atom:updated>2023-12-21T14:57:29.891Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*3Yefm5cu57joMIpzT2oDUg.png" /></figure><p>Flask is a popular Python web framework that’s known for its simplicity and ease of use. If you’re new to web development or just getting started with Flask, this blog post is the perfect place to begin. We’ll guide you through the process of creating a basic Flask application from scratch. By the end, you’ll have a working Flask app and a foundational understanding of web development using Python.</p><p><strong>Table of Contents</strong></p><ol><li>Setting Up Your Development Environment</li></ol><p>i) Setting up python virtual environment</p><p>ii) Installing Python and Flask</p><p>2. Creating Your First Flask Application</p><p>3. Building a Simple Web Page</p><p>4. Running Your Flask App</p><p>5. Conclusion</p><h3>1. Setting Up Your Development Environment</h3><p>Before you begin, ensure you have the following prerequisites in place:</p><ul><li>Python: Flask is a Python web framework, so you’ll need Python installed. If you don’t have Python, you can download and install it from the <a href="https://www.python.org/downloads/">official Python website</a></li><li>Text Editor or IDE: Choose a code editor or integrated development environment (IDE) for writing your Flask code. Options include Visual Studio Code, PyCharm, and Sublime Text.</li></ul><h4>ii) Setting up python virtual environment</h4><p>Creating a Python environment is a fundamental step in setting up your development environment, especially when working on Python projects. Python environments allow you to manage dependencies, packages, and libraries specific to your project, ensuring that your project remains isolated from the global Python environment. In this guide, we’ll create a Python environment using the popular tool virtualenv.</p><p>virtualenv is a Python package that helps you create isolated Python environments. To install virtualenv, open your terminal or command prompt and run the following command:</p><pre>pip install virtualenv</pre><p>To use venv in your project, in your terminal, create a new project folder, cd to the project folder in your terminal, and run the following command:</p><pre> $ mkdir project1<br><br> $ cd project1<br>  <br> syntax: python&lt;version&gt; -m venv &lt;virtual-environment-name&gt;<br> <br> $ python3.8 -m venv myenv<br> <br> </pre><p>To activte the virtual environment</p><pre>source myenv/bin/activate</pre><p>This will activate your virtual environment. Immediately, you will notice that your terminal path includes env, signifying an activated virtual environment.</p><h4>Some useful commands</h4><pre>// To list all the packages installed in this env<br>$ pip list<br><br>//To copy all the packages that we have installed in this environment and we can install the entire packages from the file in another environment<br>$ pip freeze &gt; requirements.txt<br><br>// To install dependencies from the file<br>$ pip install -r requirements.txt<br><br>//To deactive the virtual environment<br>$ deactivate</pre><h4>ii) Installing Flask</h4><p>Once you have Python and a code editor ready, it’s time to install Flask. Open your terminal or command prompt and run the following command:</p><pre>pip install Flask</pre><p>This command installs Flask and its dependencies. You’re now ready to create your first Flask application.</p><h3>2. Creating Your First Flask Application</h3><p>Let’s start with a basic Flask application. Create a new Python file (usually with a .py extension) and add the following code(app.py):</p><pre>//import flask module<br>from flask import Flask<br><br>app = Flask(__name__)<br><br>//create hello world print function for the &quot;/&quot; route path<br>@app.route(&#39;/&#39;)<br>def hello():<br>    return &quot;Hello, Flask!&quot;<br><br>if __name__ == &#39;__main__&#39;:<br>    app.run()</pre><p>In this code, we import Flask, create a Flask application, define a route for the root URL (‘/’), and create a function that returns “Hello, Flask!” when you access that URL. Finally, we run the application if the script is executed directly. We can see the “Hello, Flask!” in the browser if we run the above code.</p><h3>3. Building a Simple Web Page</h3><p>Now, let’s create a simple HTML page and render it using Flask. You can add an HTML file to your project directory, name it index.html, and add the following content:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>    &lt;title&gt;FLASK APP&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;h1&gt;Welcome to python Flask&lt;/h1&gt;<br>    &lt;p&gt;This is a simple Flask web application.&lt;/p&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Next, modify your Flask app to render this HTML page:</p><pre>from flask import Flask, render_template<br><br>app = Flask(__name__)<br><br>@app.route(&#39;/&#39;)<br>def hello():<br>    return render_template(&#39;index.html&#39;)<br><br>if __name__ == &#39;__main__&#39;:<br>    app.run()</pre><p>Now, when you access the root URL, Flask will render the HTML page.</p><h3>4. Running Your Flask App</h3><p>To run your Flask app, open a terminal, navigate to the directory where your Python file is located, and run the following command:</p><pre>//python your_app_name.py<br>$ python app.py</pre><p>Your Flask app will start, and you can access it by opening a web browser and navigating to http://localhost:5000/. You&#39;ll see your &quot;Welcome to My Flask App&quot; page.</p><h3>5. Conclusion</h3><p>You’ve just built a simple Flask web application, which is your gateway to Python web development. Flask’s simplicity and ease of use make it an excellent choice for both beginners and experienced developers. As you continue your journey in web development, you can explore more complex features and build web applications with rich functionality.</p><p>Flask provides a solid foundation for creating web applications, and there’s a wealth of resources, extensions, and libraries available to help you build more advanced projects. So, dive into Flask, experiment, and enjoy the world of web development with Python.</p><p>Happy coding!🐧🥂</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c64efa519d38" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Send Email using python]]></title>
            <link>https://medium.com/@vishakkv954/send-email-using-python-934fc4892c76?source=rss-4afe31b95e8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/934fc4892c76</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Vishakkv]]></dc:creator>
            <pubDate>Wed, 20 Dec 2023 17:49:02 GMT</pubDate>
            <atom:updated>2023-12-20T17:49:02.864Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*YsR1sIfUYY05ugmUXGdoCQ.png" /></figure><p>Simple Mail Transfer Protocol (SMTP) is a protocol, which handles sending e-mail and routing e-mail between mail servers.</p><p>Python provides <strong>smtplib</strong> module, which defines an SMTP client session object that can be used to send mail to any Internet machine with an SMTP or ESMTP listener daemon.</p><p><strong>Lets Create the script to send emails.</strong></p><pre>import smtplib //importing the library<br><br>email = smtplib.SMTP(&#39;smtp.gmail.com&#39;, 587) //Mention the server and its port<br><br>email.starttls() <br><br>email.login(&quot;sender-email&quot;, &quot;sender-email-password&quot;) //add sender email credentails for authentication<br><br>msg = &quot;Hi How are you!&quot;   //Msg to send<br><br>email.sendmail(&quot;sender-email&quot;, &quot;receiver-email&quot;, msg) //sending the message<br><br>email.quit() //Exit</pre><h3>UseCase</h3><ol><li><strong>Automation and Scripting:</strong></li></ol><ul><li>Python allows you to automate the process of sending emails, making it suitable for various tasks such as sending notifications, reports, or automated responses.</li></ul><p><strong>2. Integration with Applications:</strong></p><ul><li>Python can be integrated with applications and systems to send emails based on specific events or triggers. For example, sending an email when an error occurs in a system.</li></ul><p><strong>3. Access to External APIs:</strong></p><ul><li>Python libraries like smtplib enable communication with SMTP servers, and additional libraries such as requests allow interaction with external APIs. This is useful for integrating email sending with other web services.</li></ul><p><strong>4. Dynamic Content Generation:</strong></p><ul><li>Python can be used to generate dynamic content for emails, such as HTML emails, attachments, or emails with data retrieved from databases or APIs.</li></ul><p><strong>5.Task Scheduling:</strong></p><ul><li>Python scripts can be scheduled to run at specific times using tools like cron jobs or task schedulers. This allows you to schedule email-related tasks at specified intervals.</li></ul><blockquote>Keep Learning🤖🐧</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=934fc4892c76" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>