[{"content":"","date":"November 15, 2022","permalink":"/categories/blog/","section":"Categories","summary":"","title":"blog"},{"content":" Warning! This post is still lame will update soon. After much procrastination i have moved the previous blog running in jekyll to hugo. I will document the steps I took to move the content to diff blog engine , but predominately used the git branch strategy to host static pages using hugo framework and migrating my content from jekyll to here.\ngraph LR; A[Blog]--\u003eB[Jekyll]; B--\u003eC[Hugo] ","date":"November 15, 2022","permalink":"/posts/hugo_blog/","section":"posts","summary":"Warning!","title":"build your own blog for free"},{"content":"","date":"November 15, 2022","permalink":"/categories/","section":"Categories","summary":"","title":"Categories"},{"content":"","date":"November 15, 2022","permalink":"/categories/documentation/","section":"Categories","summary":"","title":"documentation"},{"content":"","date":"November 15, 2022","permalink":"/tags/hugo/","section":"tags","summary":"","title":"hugo"},{"content":"","date":"November 15, 2022","permalink":"/tags/","section":"tags","summary":"","title":"tags"},{"content":"","date":"November 15, 2022","permalink":"/","section":"","summary":"","title":""},{"content":"","date":"November 15, 2022","permalink":"/posts/","section":"posts","summary":"","title":"posts"},{"content":"I’m a Software tinkerer believing in building software thats simple , easy and adaptable.\nI believe programming is an art that needs to be crafted beautifully. The idea behind this blog is to document my findings, experiments \u0026 know how tales to my digital catalogue.\n","date":"November 15, 2022","permalink":"/about/","section":"","summary":"I’m a Software tinkerer believing in building software thats simple , easy and adaptable.","title":"about"},{"content":"vagrant # action command create vagrant file vagrant init boxname bringing vm up vagrant up reloading vagrant config vagrant reload shutting down the vm vagrant halt destroy the vm vagrant destory git # action command to clone the git repository git clone url commits new files to your repository git add * commits git repository changes git commit -m \u0026ldquo;message\u0026rdquo; pushing changes to git repository git push origin master refreshing git repository git pull origin master overwrite git repository git reset \u0026mdash;hard master , git pull (or) git stash , git pull clean repository of untracked files \u0026amp; folders git clean -dfx creating a new branch git branch branchname switching branch git checkout branchname deleting branch git branch -rd origin/branchname (or) git push origin \u0026ndash;delete branchname refreshing deleted file git checkout filename creating a branch of an existing branch git checkout -b newbranchname oldbranchname merging two branches git checkout branchnametobemergedwith , git merge \u0026ndash;no-ff branchnametobemerged deleting remote branch git push origin \u0026ndash;delete branchname deleting local branch git branch -d branchname docker # action command removing docker image docker rmi imagename list docker images docker images creating docker image docker build -t imagename . removing a container docker rm containername starting a container docker start containername stoping a container docker stop containername restarting a container docker restart containername starting a container with port exposed and data volume mounted docker run -d \u0026ndash;name containername -p hostport:contport imagename renaming an existing image docker tag imagename:latest newname listing current running containers docker ps listing all containers running \u0026amp; exited docker ps -a removing all containers which exited docker rm $(docker ps -a -q) removing all images docker rmi $(docker images -q) k8s # action command create a namespace object kubectl create ns namespacename create a pod object kubectl run podname \u0026ndash;image=imagename \u0026ndash;port=portnumber \u0026ndash;restart=Never create a deployment object kubectl create deploy deployname \u0026ndash;image=imagename \u0026ndash;port=portnumber create a job object kubectl create job jobname \u0026ndash;image=imagename create a cronjob object kubectl create cj cronjobname \u0026ndash;image=imagename \u0026ndash;schedule=\u0026quot;*/1 * * * *\u0026quot; create a ingress object kubectl create ing ingressname \u0026ndash;rule=\u0026quot;domainname/path*=servicename:portnumber\u0026quot; delete a namespace object kubectl delete namespace namespacename delete a pod object kubectl delete po podname delete a deployment object kubectl delete deploy deployname delete a job object kubectl delete job jobname delete a cron job object kubectl delete cj cronjobname delete a ingress object kubectl delete ing ingressname ","date":"November 9, 2015","permalink":"/posts/development/cheatsheet/","section":"posts","summary":"vagrant # action command create vagrant file vagrant init boxname bringing vm up vagrant up reloading vagrant config vagrant reload shutting down the vm vagrant halt destroy the vm vagrant destory git # action command to clone the git repository git clone url commits new files to your repository git add * commits git repository changes git commit -m \u0026ldquo;message\u0026rdquo; pushing changes to git repository git push origin master refreshing git repository git pull origin master overwrite git repository git reset \u0026mdash;hard master , git pull (or) git stash , git pull clean repository of untracked files \u0026amp; folders git clean -dfx creating a new branch git branch branchname switching branch git checkout branchname deleting branch git branch -rd origin/branchname (or) git push origin \u0026ndash;delete branchname refreshing deleted file git checkout filename creating a branch of an existing branch git checkout -b newbranchname oldbranchname merging two branches git checkout branchnametobemergedwith , git merge \u0026ndash;no-ff branchnametobemerged deleting remote branch git push origin \u0026ndash;delete branchname deleting local branch git branch -d branchname docker # action command removing docker image docker rmi imagename list docker images docker images creating docker image docker build -t imagename .","title":"cheatsheet"},{"content":"","date":"November 9, 2015","permalink":"/tags/development/","section":"tags","summary":"","title":"development"},{"content":"","date":"November 9, 2015","permalink":"/tags/productivity/","section":"tags","summary":"","title":"productivity"},{"content":"","date":"April 15, 2015","permalink":"/tags/concepts/","section":"tags","summary":"","title":"concepts"},{"content":"what # Continuous integration (CI) is the practice in software engineering, of merging all developer working copies into a single integrated Environment several times a day. The main aim of CI is to prevent integration problems, referred to as \u0026ldquo;integration hell\u0026rdquo; \u0026amp; to bring in governance of Software Development Life Cycle (SDLC) practices.\nCI helps in agile adoption/methodology and is considered as an improvement over frequent integration.\nwhy # Any Application that goes through a development phase of SDLC adheres to multiple tools usage irrespective of number of developers in different geographies.Although its a good (or) best practice to adhere to these tools during the projects inception even if there is only one developer in the project.\nVersion Control Repository(VCS) Integrated Development Environment (IDE) Build Script Development Unit Testing Building \u0026amp; Deploying Developers take a copy of repository(base code) on their local machine and start developing , unit testing before the code is checked in the version control system.\nBelow is a typical CI Workflow\n![process]({{ site.baseurl }}/images/01_16_2015_1.jpg)\nTypically CI Server is scheduled to run nightly builds \u0026amp; deploys to the runtime enviroment ( application server) or any runtime environment hosting the source code artifacts. Apart from the nightly builds it does have feature to initiate a build on the fly once the developer checkin the code into VCS.\nCI Server checks out the project repository(source code, unit test scripts,build scripts) from the VCS \u0026amp; uses the build script to compile the source code and then build the artifact. In the process of CI pipeline it would then deploy to the runtime environment \u0026amp; go ahead with Unit testing the artifact \u0026amp; catalogue the report of success of failure in the CI dashboard.\nWe can configure the CI Server to send out alerts or reports of the build to the email or messaging system of the team responsible for the build. This helps in the local copy of the source code checked in and tested \u0026amp; ready for QA team to exercise overall integrated testing of the application.\nGenerally each developer before checkin the work to VCS, does a complete build and run (and pass) all unit tests. Integration tests are usually run automatically on a CI server when it detects a new commit.\nconclusion # Continuous Integration helps in detecting the broken build scenarios early, also makes sure all local copies are always checked in VCS project repository eliminating any code or data loss. It aids in faster code building and deployment with less human error \u0026amp; avoid \u0026ldquo;integration hell\u0026rdquo;, it reduces the \u0026ldquo;merge hell\u0026rdquo; by detecting early in the cycle than too late and too many files or repositories to merge.\nContinuous Integration involves integrating early and often, so as to avoid the pitfalls of \u0026ldquo;integration hell\u0026rdquo;. The practice aims to reduce rework and thus reduce cost and time.\n","date":"April 15, 2015","permalink":"/posts/devops/continuous-integration/","section":"posts","summary":"what # Continuous integration (CI) is the practice in software engineering, of merging all developer working copies into a single integrated Environment several times a day.","title":"continuous integration"},{"content":"","date":"April 15, 2015","permalink":"/tags/devops/","section":"tags","summary":"","title":"devops"},{"content":"","date":"February 8, 2015","permalink":"/tags/cloud/","section":"tags","summary":"","title":"cloud"},{"content":"what # The concept of cloud computing has existed for 50 years, since the beginning of the Internet.It was devised the idea of time-sharing in computers as a utility in 1957.Since then, the concept’s name has undergone several changes: from service bureau, to application service provider, to the Internet as a service, to cloud computing, and to software-defined datacenters, with each name having different nuances. However, the core concept is the same: providing IT services based on the Internet (the cloud).\ndifferent types # Cloud Computing architecture has three models: infrastructure as a service (IaaS),platform as a service (PaaS) and software as a service (SaaS).\nInfrastucture as a Service (IaaS) - It virtualizes the data center\u0026rsquo;s computing power, storage, loadbalancers , templatized runtime engines and network connectivity. Users can scale these computing resources up and down on demand dynamically and/or based on a given set of rules upon which action would be taken by the cloud engine.\nPlatform as a Service (PaaS) - It provides a development platform with services to assist application design, implementation, testing, deploy­ment, monitoring, and hosting in the cloud. It requires no software download( although not entirely true may need to download IDE to be able to work with Cloud runtimes) or installation and supports geographi­cally distributed collaborative work.\nSoftware as a Service(SaaS) - It includes both software components (for application developers) and applications (for users). An SaaS application is often a service-oriented program so that it is easy to integrate with other SaaS applications.Software that performs various tasks is not on the client machine. Instead, third-party service providers host and manage the software services in the cloud.\nkey attributes # Agility Multi tenancy Scalibility and Elasticity Monitoring \u0026amp; Performance Optimization Enablement Security Maintenancibility deployment models # private cloud - cloud infrastructure operated solely for a single organization, whether managed internally or by a third-party, and hosted either internally or externally. Most Organizations already use virtualization internally to provision environments as it has minimizes their need to go through hardware procurement lifecycle of buy , build and manage hardware systems in their datacenter. Virtualization is indeed some form of private cloud , or you can host applications in cloud providers restricting to only your network.\npublic cloud - cloud infrastructure that renders services over a network that is open for public use.Technically there may be little or no difference between public and private cloud architecture, however, security consideration may be substantially different for services (applications, storage, and other resources) that are made available by a service provider for a public audience and when communication is effected over a non-trusted network.\nhybrid cloud - cloud infrastructure thats a composition of two or more clouds (private and/or public) which are two different entities but are bound together, offering the benefits of multiple deployment models. Hybrid cloud can also mean the ability to connect collocation, managed and/or dedicated services with cloud resources. It could also be public clouds in more than one cloud providers.\ncloud providers # Company Offering Model Amazon Amazon Web Services IaaS , PaaS, SaaS Google Google Cloud Engine IaaS , PaaS, SaaS Microsoft Microsoft Azure IaaS , PaaS , SaaS Rackspace OpenStack IaaS IBM SoftLayer IaaS , PaaS Linode NA IaaS Digital Ocean NA IaaS ","date":"February 8, 2015","permalink":"/posts/cloud/intro-cloud-computing/","section":"posts","summary":"what # The concept of cloud computing has existed for 50 years, since the beginning of the Internet.","title":"cloud computing"},{"content":"","date":"January 16, 2015","permalink":"/tags/httpserver/","section":"tags","summary":"","title":"httpserver"},{"content":"","date":"January 16, 2015","permalink":"/tags/loadbalancing/","section":"tags","summary":"","title":"loadbalancing"},{"content":"introduction # Nginx(pronounced EngineX) is one of the most popular web servers in the world and is responsible for hosting some of the largest and highest-traffic sites on the internet. It is more resource-friendly than Apache in most cases and can be used as a web server or a reverse proxy.\nI am going to create a Virtual Machine which will run Linux OS in our case Ubuntu Linux 64 bit ( Trusty for version 14.04 ) for sake of mimicking an environment as much close to real production system. I have used Vagrant for managing my virtual machine and provisioning it for I can be saved from hastle of downloading a Ubuntu Linux ISO and installing on newly created Virtual Machine.\npre-requisites # vagrant virtualBox If you are not familiar with Vagrant ,Please refer to my article on Vagrant \u0026amp; its use here\nAlthough I am provisioning a Ubuntu box , you are free to choose your preference of OS from the list of available Vagrant boxes\nvagrant init ubuntu/trusty64 vagrant up Once this command is initiated the machine will start booting up and you should see something similar to the below command.\nBringing machine 'default' up with 'virtualbox' provider... ==\u0026gt; default: Checking if box 'ubuntu/trusty64' is up to date... ==\u0026gt; default: Resuming suspended VM... ==\u0026gt; default: Booting VM... ==\u0026gt; default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: Warning: Connection refused. Retrying... ==\u0026gt; default: Machine booted and ready! You can ssh into the Virtual Machine by using the below command.\nvagrant ssh You can run command to check the ipaddress of the machine using\nifconfig Vagrant assigns a ip address by default from your router or DHCP Server , which is dynamic. But for the sake of experimentation we do not need to go through the details of DHCP Configuration , although we can define out own private network for you to access it on the machine you have created your virtual machine.\nYou can edit your Vagrantfile \u0026amp; uncomment the below line and assign a ip address like 192.168.33.10\nconfig.vm.network \u0026quot;private_network\u0026quot;, ip: \u0026quot;192.168.33.10\u0026quot; Once you do that you should load the recent changed by using the below command\nvagrant reload (or) vagrant halt followed by vagrant start You can continue to use vagrant ssh or ssh manually using below command in terminal or putty( in windows).\nssh vagrant@192.168.33.10 (or) vagrant ssh You should see the same result.\ninstall # I have provisioned a ubuntu box using vagrant and i will go over details of installation of nginx in the provisioned ubuntu linux.\nvagrant@vagrant-ubuntu-trusty-64:~$ sudo apt-get upgrade vagrant@vagrant-ubuntu-trusty-64:~$ sudo apt-get update vagrant@vagrant-ubuntu-trusty-64:~$ sudo apt-get install nginx You should see the nginx server running in the box \u0026amp; you can check if its running by using following command below.\nvagrant@vagrant-ubuntu-trusty-64:~$ ps -ef | grep nginx root 1093 1 0 Jan15 ? 00:00:00 nginx: master process /usr/sbin/nginx www-data 1094 1093 0 Jan15 ? 00:00:24 nginx: worker process www-data 1095 1093 0 Jan15 ? 00:00:00 nginx: worker process www-data 1096 1093 0 Jan15 ? 00:00:26 nginx: worker process www-data 1097 1093 0 Jan15 ? 00:00:26 nginx: worker process vagrant 9206 9185 0 21:31 pts/0 00:00:00 grep --color=auto nginx So now should you go to the browser and type this http://192.168.33.10/\nYou should be able to see nginx serving and displaying something on the browser.\n","date":"January 16, 2015","permalink":"/posts/server/http/nginx/","section":"posts","summary":"introduction # Nginx(pronounced EngineX) is one of the most popular web servers in the world and is responsible for hosting some of the largest and highest-traffic sites on the internet.","title":"nginx"},{"content":"what # Vagrant is an amazing dev productivity tool for managing virtual machines using command line which lets run the virtual machine in headless mode. It is template based and can be extended to a standard box and its fast enough to boot the virtual machine using this tool.\nPlease download vagrant here\nwhy # Before vagrant existed i use to provision a vm for a given OS lets say Linux 64 bit Ubuntu version , I will go about downloading the iso image \u0026amp; installed in a virtual machine and then go about installing other softwares to keep the environment ready for code to be deployed for testing purpose. This ensured i had a linux environment hosting application just as much a smaller subset of production kind of environment ofcourse without benefits of clustering as i thought it was overkill to do development in a clustered environment unless the software or application has cluster aware features.\nThis whole process was time consuming \u0026amp; managing was difficult , but once created it had the same benefits of isolated linux enviornment running app servers or servers. I would probably keep a golden copy of virtual machine hard disk installed with os \u0026amp; export and keep it ready to import for next use into another virutal machine though it had its own issues of lot of time in importing and exporting virtual machine hard disk as OVF file.\nVagrant helped in process of providing a readily available box which can be added to vagrant environment which still uses virtual box but its much faster and quicker to add than import export. Also it helped not just provide base boxes for different OS but also help in running the virtual machines seemlessly in a headless fashion.\nbenefits # The main reasoning to use virtual machine during development is to isolate environments in a seperate container than messing up with different versions of jdk or python etc any sdks or multiple application servers creating conflicts etc \u0026amp; having to support different versions in host machine. I have been a big proponent of developing applications mimicing as much as running in typical isolated environments hosted in linux enviroments just as much finally the shipped product will ultimately run on it.\nOfcourse we can maintain isolation in case of python environments using virtualenv \u0026amp; run different version of jdk in case of java but have to constantly update the java home variable in mac or create a bash or cmd script to set the java home based on the version being used. I liked the idea of not having to manage version dependencies and freeze an environment to do development and not to worry about managing different version of software etc to be installed in host machine \u0026amp; also should i migrate the virtual machine to another machine its straight forward and i can avoid going through process of installation of softwares etc \u0026amp; i can replicate the virtual machine using export options.\nSince i am a big proponent of open source I started using Virtual Box , it solved environment isolation problem \u0026amp; dependency issues aiding in keeping the host machine cleaner with no trace of software version installed for runtime , ofcourse it not entirely true as u need jdks or python versions installed for ide to use and compile code to be deployed for runtime container in vm.\nYou can ofcourse use VMWare solution to provision a VM , i thought it was bulky for development environments. Sometimes u will need VMWare licensed software to run on mac which is what i use.\nhow # Vagrant provides set of already created boxes referred as base boxes.Please feel free to download the vagrant base box here\nYou can download these bases boxes or few vagrant boxes are also provisioned in github projects.\nI will create a vagant box and host in my github to try downloading at some point for reference.\nOnce the base box is downloaded , we go about initializing the vagant file to use the box.\nvagrant init baseboxurl This should create a Vagrant File for you to edit and use to your needs.\nCustomizing the vagrant file for usage\nconfig.vm.box = \u0026quot;\u0026lt;http://baseboxurl\u0026gt;\u0026quot; config.vm.network \u0026quot;private_network\u0026quot;, ip: \u0026quot;192.168.66.66\u0026quot; config.vm.synced_folder \u0026quot;data\u0026quot;, \u0026quot;/data/\u0026quot; This is made part of private network to access the virtual machine using the given ip address \u0026amp; then we create a sync folder between host and virtual machine. So we can transfer any code , downloadables or code artifacts in shared location using host ide and be able to build and deploy easily in virtual machine if administration console is not an option.\nFurther you can add the base box and use it as reference to create another vagrant based virtual machine , the idea of base box is to be used like standard template.\nvagrant add box ubuntubasebox Once the box is avaiable in vagrant we can modify the Vagrant file to start using it directly from vagrant repository than looking up the reference from basebox url.\nconfig.vm.box = \u0026quot;\u0026lt;box name\u0026gt;\u0026quot; Starting the virtual machine using vagrant\nvagrant up Stopping the virtual machine using vagrant\nvagrant halt Once the virtual machine is up and running you can ssh into the ipaddress mentioned above and login to the linux machine.\nusername/password - vagrant/vagrant - root/vagrant Once the container is ready you are free to install the software required and you can export a environment with database , app server , http servers etc and export them into a template \u0026amp; distribute for easy usage.\n","date":"September 19, 2014","permalink":"/posts/development/vagrant/","section":"posts","summary":"what # Vagrant is an amazing dev productivity tool for managing virtual machines using command line which lets run the virtual machine in headless mode.","title":"vagrant"}]