Tag Archives: history

Archaeology in Sobell’s “Unix System V – A Practical Guide”

Clearing some boxes recently, and pulled up an old gem that I used to carry around university. Mark Sobell’s Unix System V – A Practical Guide A lot of it is still relevant today for linux and even OSX users, with basic guides to shells, redirections, awk, sed and vi. Some of it is however (predictably) dated. Chapter 7 has some lovely spots to dig for buried treasure.

finger

Does my current machine even have finger? hehe, wow, it does.

karlp@teros:~$ finger
Login     Name           Tty      Idle  Login Time   Office     Office Phone   Host
karlp     Karl Palsson  *:0             Sep  7 10:09                           (:0)
karlp     Karl Palsson   pts/0      23  Sep  7 10:09                           (:0)
karlp     Karl Palsson   pts/1      29  Sep  7 11:35                           (:0)
karlp     Karl Palsson   pts/2          Sep  7 11:35                           (:0)
karlp@teros:~$

Ok, cool, let’s try the example from the book!

karlp@teros:~$ finger quake@gldfs.cr.usgs.gov
finger: unknown host: gldfs.cr.usgs.gov
karlp@teros:~$ 

Oh well, somewhat predictable. No live earthquake list for me.

telnet services

We’ll skip over all the descriptions of FDDI, XNS, rlogin and hosts files, proceed straight to the library of congress information system.

karlp@teros:~$ telnet locis.loc.gov
telnet: locis.loc.gov: Name or service not known
locis.loc.gov: Unknown host
karlp@teros:~$

Or not.

archie and gopher

wow, archie, I’d forgotten about archie and gopher. can’t even try these, no archie in current fedora, and no package for it either :)

Oh well. it was fun to skim over the chapter again :)

Combining two git repositories into one

I went down some dead ends trying this, but it was pretty easy in the end. Here’s how I did it, because my search keywords didn’t turn up what I was looking for first.

I have two repositories, AAA and BBB, and I want them to end up looking like below. Also, I don’t want to keep using the old repositories, but I do most definitely want to see the full history of each file.

    AAA   
    AAA/aaa-oldAAA
    AAA/bbb-oldBBB

Or something along those lines anyway. I chose AAA to be the new final parent, so I started by moving all the original AAA files down a level. This was straightforward

    cd AAA
    mkdir aaa-oldAAA
    git mv x y z aaa-oldAAA
    git commit

I then did the same thing in the BBB repository.

Now, the fun, adding the other repository as a remote in this repository.

    cd AAA
    git remote add bbb-upstream /full/path/to/old/BBB
    git fetch bbb-upstream
    git checkout -b bbb-u-branch bbb-upstream/master

This is pretty neat. Right here, you’re only looking at the code from the BBB repository! If you git checkout master again, you’re back looking at your AAA/aaa-oldAAA repository. This makes sense when you think about it, nothing says that branches have to have the same or even related code in them.

Now, we just merge the bbb-u-branch into our local master!

   git checkout master
   git merge bbb-u-branch
   git remote rm bbb-upstream # no longer needed

Presto! Finito! The only problem I had was a merge conflict in the .gitignore files.

Note: to see the logs of files that have been moved, you need to use git log --follow filename.blah This has nothing to do with the dual merge however.