Wednesday, October 16, 2019

p4 shelve equivalent in Git with an example

The equivalent of p4 shelve on GIT is stashing.

Say I have modified the file on my repository and I see the following:
techmuser@gw2:~/repositories/softlockup_repo/scripts$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
        modified:   vimrc
no changes added to commit (use "git add" and/or "git commit -a")
Now to shelve these changes, 
techmuser@gw2:~/repositories/softlockup_repo/scripts$ git stash
Saved working directory and index state WIP on master: 80e892a Track git aliases.       modified:   generic_aliases
HEAD is now at 80e892a Track git aliases.

Tuesday, October 15, 2019

Windows: Creating a disk catalog for your external hard drive

On my windows machine, I wanted to create a disk catalog that I could use to see the movies I already had watched or downloaded from my provider.
  1. I found that the easiest way to do this is by creating a text file which has a list of all files on the external drive from that directory and saving that info to a file.
  2. When needed, search the text file which is used as a catalog.

Creation of the catalog is very easy. For your destination path (on the external drive),  do the following:
  1. From the windows start menu, type and search for "cmd"
  2. This will launch the command window.
  3. In the command window run the following command:
DIR "F:\path\to\dir" /s > "C:\List.txt"
This command assumes that F:\path\to\dir is the directory which you are planning to list. The catalog file is the C:\List.txt file which can be read and searched like a normal text file.

For making a catalog from any directory use something like this in a .bat file:
DIR /s > "Catalog.txt"

Sunday, October 13, 2019

Thought Experiment: Why not have multiple woofers for each channel

Ever wondered why there is a single subwoofer and multiple small speakers for higher frequencies?
Because the human hear can only distinguish the higher frequencies spatially. Why?
Because of the wavelength. The base (subwoofer) is the lower frequency sound which is usually a few HZ which would typically have a wavelength of the order of 10s of feet. Hence in this case, the two human ears which are placed less than a feet apart on our head cant differentiate between base sound  from different channels. Hence we only have one subwoofer for the base sounds and multiple smaller  speakers (5.1 or 2.1 stereo) for the higher frequency sounds.

Wednesday, September 4, 2019

Linux: How to check the IO address space on your Linux machine

The parallel port is at address 0x0378?
This is the IO address space and this information is provided under the /proc file system as:

$> cat /proc/ioports

Sample output is as follows:

Tuesday, September 3, 2019

Linux: Implementing tftpboot with Linux u-boot

If your u-boot is not running tftpboot, for any reason as is the case with my board, you can always fool it into doing tftpboot for you by leveraging the run support in the u-boot bootloader.

U-boot is a very popular bootloader and you can learn more about it here: http://www.denx.de/wiki/U-Boot

Here is the trick to implement it:
setenv bootcmd 'dhcp; run cmd'
setenv cmd 'tftp LOADADDR PATH_TO_TFTPIMAGE'

 In the above set of commands you will have to replace LOADADDR with the correct address in memory where you want to load the image. The PATH_TO_TFTPIMAGE is the path to the image on the tftpserver.