Friday, April 19, 2013

Remove a git sub-module (How to)

How to remove a submodule (Excerpt from https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial#Removal)
1. Delete the relevant line from the .gitmodules file.
2. Delete the relevant section from .git/config.
3. Run git rm --cached path_to_submodule (no trailing slash).
4. Commit the superproject.
5. Delete the now untracked submodule files.

Saturday, March 9, 2013

TCP vs UDP, First Opsschool Curriculum Pull Request

This is my first contribution to the Opsschool Curriculum, my pull request is currently queued for review. Please comment on it through GitHub's utilities if you think the sub-section can be improved. The following is the sub-section submitted if you would just like to read about TCP vs UDP.

TCP vs UDP

Both TCP :rfc:`793` and UDP :rfc:`768` provide data transfer between processes through ports. Those process ports can be on the same computer or separate computers connected by a network. TCP provides the following: reliability, flow control, and connections. (UDP does not)  This means TCP will be sending more header data, more packets between ports and doing more processing to provide its capabilities. UDP requires less header data in the individual packets and requires less packets on the network to do its work. However, because UDP does not guarantee reliability, UDP allows for packets not getting communicated end to end after leaving the sender.  The choice of protocols to use is often based on whether the risk of losing packets in real-time without immediate alerting is acceptable. In some cases UDP  may be acceptable, such as video or audio streaming where programs can interpolate over missing packets. However, TCP will be required because of its guarantees in systems that support banking or healthcare.

An example of the difference between the two protocols that will help us understand the tradeoffs is a comparison of what it takes to send the first data byte. TCP requires an initial "three way handshake" in order to begin sending data. That amounts to one initial packet sent between ports from initiator of the communication to the receiver, then another packet sent back, and then a final packet sent from the initiator to the receiver again. All that happens before sending the first byte of data. In UDP the first packet sent contains the first byte of data.

Another example of the difference between the protocols is the size of the headers of the two protocols. The TCP header is 20 bytes and the UDP header 8 bytes.

Friday, December 28, 2012

Vim Plugin Management with Vundle

Vundle is a open source package management utility that aims to be a one stop tool for searching, trying and installing plugins. “Vundle is short for Vim bundle…” as documented in the about section of the project homepage at github. The project can be found at [gmarik/vundle]. The quick start requires git to clone vundle and then subsequently you will need to configure the .vimrc file, this file is usually found in a users home folder. The dot at the front of the .vimrc file indicates it is a hidden file. Each operating system has a different way to make hidden files visible, however usage of .vimrc file in vim is a common practice, further information can be found in the vim wiki about .vimrc file page. Completing the installation will enable the following commands in vim.

:BundleInstall – Required to initially install the tool.
:BundleSearch – Allows for searching for plugins. You can install them inline within the search to try them out, however the .vimrc file is not modified by the installation.

Plugin List

  • Xml.Vim – Editing xml with this plugin is made easier with shortcuts, automatic tag completion, and functionality to keep the xml syntactically correct. (REMEMBER: file being edited must be “.xml”)
  • XmlPretty – Formats the xml in a file. (REMEMBER: file being edited must have be “.xml”)
  • fugitive.vim – Git integration with vim, a lot of features.
  • gitv – builds on fugitive to allow browsing all diffs in the history of commits within a git repo.
  • NERDTree – File Browser integration allowing for easy navigation and opening of files from within vim.