Skip to main content

Posts

My Git crash course

Git is a distributed version control system. In simple words, it tracks changes in your code and lets you collaborate safely. Install Git from the official website. Once installed, verify: git --version To initialize a new repository: git init To add files to staging: git add . To commit changes: git commit -m "Initial commit" To check status: git status To view commit history: git log To create a new branch: git branch feature-branch To switch to it: git checkout feature-branch To merge back into main: git checkout main git merge feature-branch To connect to a remote repository: git remote add origin To push changes: git push -u origin main Git may seem confusing at first but once you understand staging, committing, and branching, everything becomes logical. Remember, version control is not optional. It is essential. Disclaimer: If you follow the information here, there is no warranty , I am not liable if it deletes your data, gets ...

My Docker crash course

Docker has taken the container world by storm. If you understood LXC from the previous post, Docker will feel like a polished toolkit built on similar ideas. This post gives you a quick start so you can begin running containers in minutes. First, install Docker on your system. On Linux you can install it via your distribution’s package manager. On Windows and macOS you can download Docker Desktop from the official Docker website. Once installed, verify it works: docker --version If you see version information, you are ready. Run your first container: docker run hello-world Docker will pull the image if it does not exist locally and then execute it. Congratulations. You just ran your first container. To see running containers: docker ps To see all containers including stopped ones: docker ps -a To run an interactive Ubuntu container: docker run -it ubuntu /bin/bash You are now inside the container shell. To exit: exit To stop a running container: docker stop...

My AWS S3 crash course

This post aims to be your quick start guide to AWS S3, ie. Amazon Web Services. Follow along and you'll feel like you just had a roller coaster ride in AWS S3 world. First of all, get a free AWS account. AWS includes many services and as mentioned above I will only cover S3 here. You may be wondering what is S3. In simple words S3 is Amazon's cloud backup service. Their Free tier is limited, and any usage beyond the limit will incur charges. So make sure you read through the pricing structure and understand it. Charges can accumulate fast if you don't pay attention or are not careful of your usage. You have been warned. You and only you are responsible for your bills. See disclaimer at the end of this post. Your reading of this post implies your understanding and agreement to the disclaimer. Once you are equipped with an AWS account, login to it and launch AWS management console. Create a Bucket In S3's terminology, a bucket is a collection of files or objects t...

Using XPerf

XPerf comes with Windows SDK. You can get it from MSFT website. During installation there is an option to install just the performance tools should you want only perf tools and not the whole SDK. To collect a trace from administrator command line: Begin your workload. xperf -on base+cswitch+power -stackwalk Profile -f c:\kernel.etl  Let the workload execute for a while. xperf -stop  If you have previously created c:\merged.etl, delete it. xperf -merge c:\kernel.etl c:\merged.etl  Now, before you can view your trace in UI, setup your symbol path: set _NT_SYMBOL_PATH=<path to PDB files>  You should now be all set to launch the viewer: xperf c:\merged.etl (this launches the viewer)  On the UI, there are several different type of graphs for various measurements. From inside the Graph menu, you can enable these views: CPU Usage by Process. CPU Sampling by CPU. Stack Counts by type. Happy XPerf-ing!

My LXC crash course:

Remember chroot? Container is far beyond a chrooted environment. Think of it as an isolated subsystem in a host OS, which allows running processes in complete isolation - even the hardware visible to the container is virtualized. Containers typically take much less resources than a full virtual machine because containers leverage features in host OS to facilitate isolation. LXC is one such user interface that leverages containment features in Linux kernel and allows creation and management of containers. Each container running on the same Linux host can run a separate linux distribution. Amazing isn't it? Containers come in very handy to create isolated environments which do not take up as much resources as running separate virtual machines do. You can use containers to host multiple web services in isolation on a single system. Another good use could be to create multiple development environments. To create a container in LXC, you first need to have LXC installed on your Lin...

Backup and Restore SVN Repository

SVN provides a simple way to backup or export SVN repository along with modification history. To export repository located at /mnt/svn/branches to a file "dump_file", you would write: svnadmin dump --incremental --deltas /mnt/svn/branches >~/dump_file On the other SVN server, you can restore the entire repository along with the modification history by doing this: svnadmin create --pre-1.6-compatible /mnt/svn/branches svnadmin load /mnt/svn/branches <~/dump_file The first line will create a new empty repository. You can remove --pre-1.6-compatible flag if you like. It's needed only if you want to make your repository compatible with previous versions of SVN. The second line restores your repository from "dump_file". Hurray! Now you can move your SVN repository to the other server without loosing your change history.

Recovery: Your PC/Device needs to be repaired

If you see this message when you boot your Windows 10, there is something you can do to fix. Read below. "Recovery Your PC/Device needs to be repaired Error code: 0xc0000225" All it is saying is that system startup boot information is somehow messed up. But it is an easy fix. You need a Windows 10 installation media or Recovery media. Boot from the media you have. Then navigate to Troubleshoot, and then choose Advanced, and then Command Prompt. At prompt, change current directory to: cd c:\ Then run these commands one by one to repair your boot sequence: bootrec /fixboot bootrec /fixmbr bootrec /rebuildbcd During these steps it may ask you if a particular Windows partition is the right one to boot into, choose yes if it is. Remove your recovery media, and reboot your computer. It should boot fine.