Git checkout tags

While trying to build the GNS3 network emulator from sources, this project works with git tags instead of branches. GNS3 project makes git tags releases. I have never worked with tags in git repositories until now, but tags are well known in telecommunication sector. A tag that is prepended to an IP packet, the properitary Tag Switching, nowadays better known as Multi Protocol Label Switching which is the core part of the MPLS functionality. A tag or label is prepended to an IP packet, to not handle touch the IP header information, instead to deal with label information that describes locally the information inside the IP packet. Much like a nickname everyone of us has, like my uncle his name is Josef but everyone is refering to him as boguś.

In terms of git, a git tag is a nickname to a git version name. It is a label, that different development stages a memorable name.

Back to tig in git. List all tags in a git repository:

user@host % git tag"
...
v2.2.4
v2.2.5
v2.2.6
v2.2.7
lines 99-146/146 (END)

Change the current branch and checkout the appropriate tag, in this example this is v2.2.7

user@host % git checkout tags/v2.2.7

switching to 'tags/v2.2.7'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at b1ec9d53 Release v2.2.7

And now it's done.

IOS-XR reload in 10

Network engineers not working on site where use the "reload in" command on IOS routers and switches to prevent accidental lockout. If configuring critical commands that would lead to losing connection to the control plane of the router, the reload in feature is the favoured command to prevent accidental lock out. In the worst case this reload the router and cause an outage, but after the network converged the configuration is as it has been before and nothing changed. It's cheap, but it works.

This is for example the case if configuring AAA commands. for RADIUS, TACACS+ or LDAP authentication and authorisation, or if configuring the interface via the vty session is currently running. This applies to switches to if configuring the trunk link and the switch is on the stick, much like a router on the stick.

In the IOS and IOS-XR operating system the reload command looks like in example depicted. Note its usage in the privileged EXEC mode which is (#), and the not saving the configuration before a reload:

R1# 
R1#reload in 10 reason I_took_an_arrow_in_the_knee
System configuration has been modified. Save? [yes/no]: no
Reload scheduled in 10 minutes by console
Reload reason: I_took_an_arrow_in_the_knee
Proceed with reload? [confirm]
R1#
*May 25 11:53:44.963: %SYS-5-SCHEDULED_RELOAD: Reload requested for 12:03:40 UTC Mon May 25 2020 at 11:53:40 UTC Mon May 25 2020 by console. Reload Reason: I_took_an_arrow_in_the_knee.

Verfication of the reload command:

R1#show reload
Reload scheduled in 9 minutes by console
Reload reason: I_took_an_arrow_in_the_knee
R1#

... 3 minutes have passed 

R1#show reload
Reload scheduled in 6 minutes by console
Reload reason: I_took_an_arrow_in_the_knee
R1#

Aborting the reload using IOS-XE and IOS-XE, after the work is successfully finished.

R1#
R1#reload cancel
R1#

***
*** --- SHUTDOWN ABORTED ---
***

R1#
*May 25 11:58:22.611: %SYS-5-SCHEDULED_RELOAD_CANCELLED:  Scheduled reload cancelled at 11:58:22 UTC Mon May 25 2020 

Using IOS-XR this works almost the same but IOS-XR is using different syntax. It is configured in the (config) mode. Overview of available options:

RP/0/RSP0/CPU0:R2(config)#comm
commit  community-set  
RP/0/RSP0/CPU0:border1-gw(config)#commit confirmed ?
  <30-65535>  Seconds until rollback unless there is a confirming commit
  minutes     Specify the rollback timer in the minutes
  show-error  Displays commit failures immediately
  <cr>        Commit the configuration changes via pseudo-atomic operation

Syntax example:

RP/0/0/CPU0:R2#show running-config interface loopback 1
Mon May 25 13:04:24.840 UTC
interface Loopback1
 ipv4 address 7.7.7.7 255.255.255.255
!

RP/0/0/CPU0:R2#config
Mon May 25 13:04:26.260 UTC
RP/0/0/CPU0:R2(config)#no interface loopback 1
RP/0/0/CPU0:R2(config)#commit confirmed minutes ?
  <1-1024>  Minutes until rollback unless there is a confirming commit
RP/0/0/CPU0:R2(config)#commit confirmed minutes 10
Mon May 25 13:04:39.319 UTC
RP/0/0/CPU0:R2(config)#

In case the configuration session gets disconnected due to invalid configuration or similar, the IOS-XR router starts the rollback process and applies rollback configuration. This is only true for the current active management session, either on the console/vty or management-port. It is not intended using IOS-XR to commit confirm changes from another management session.

Batch rename file suffix

Time for some gentoo portage local overlay cleanup operation. Following ebuild files are obsolete and should not be displayed in portage:

user@host % eix gns3
* net-misc/gns3-gui
    Available versions:  (~)2.1.11-r1^t[1] (~)2.1.12-r1^t[1] (~)2.1.14-r1^t[1] (~)2.1.15-r1^t[1] (~)2.1.16-r1^t[1] (~)2.2.8 {PYTHON_TARGETS="python3_6 python3_7 python3_8"}
    Homepage:            https://www.gns3.net/
    Description:         Graphical Network Simulator

* net-misc/gns3-server
    Available versions:  (~)2.1.11-r1^t[1] (~)2.1.12-r1^t[1] (~)2.1.14-r1^t[1] (~)2.1.14-r2^t[1] (~)2.1.15-r1^t[1] (~)2.1.16-r1^t[1] (~)2.2.8 {PYTHON_TARGETS="python3_6 python3_7 python3_8"}
    Homepage:            https://www.gns3.net/
        Description:         GNS3 server to asynchronously manage emulators

[1] "testing" /usr/local/portage

GNS3 2.2.8 version has been released with python3_7 and python3_8 support. Time to get rid of gns3 2.1 version located in local gentoo overlay named testing. Files overview in the local overlay:

user % ls

Manifest gns3-gui-2.1.12-r1.ebuild gns3-gui-2.1.15-r1.ebuild gns3-gui-2.1.11-r1.ebuild gns3-gui-2.1.14-r1.ebuild gns3-gui-2.1.16-r1.ebuild

The goal is to rename all .ebuild files to .old suffix. That way ebuilds do not get indexed in portage, while remaining still preserved in the directory. Using a for loop and matching the filname suffix, each file in gets moved to the .old suffix. This is done on top of the current directory: /usr/local/portage/net-misc/gns3-gui.

for FILE in *.ebuild; do mv $FILE $FILE.old; done

Verify the result:

host # ls
gns3-gui-2.1.11-r1.ebuild.old  gns3-gui-2.1.14-r1.ebuild.old  gns3-gui-2.1.16-r1.ebuild.old
gns3-gui-2.1.12-r1.ebuild.old  gns3-gui-2.1.15-r1.ebuild.old  Manifest

Update portage index:

root@host # eix-update 
Reading Portage settings...
Building database (/var/cache/eix/portage.eix)...
[0] "gentoo" /usr/portage/ (cache: metadata-md5-or-flat)
     Reading category 168|168 (100) Finished             
[1] "testing" /usr/local/portage (cache: parse|ebuild*#metadata-md5#metadata-flat#assign)
     Reading category 168|168 (100) Finished         
Applying masks...
Calculating hash tables...
Writing database file /var/cache/eix/portage.eix...
Database contains 18914 packages in 168 categories

Search for the gns3 package using eix:

alpha ~ # eix gns3
* net-misc/gns3-gui
     Available versions:  (~)2.2.8 {PYTHON_TARGETS="python3_7 python3_8"}
     Homepage:            https://www.gns3.net/
     Description:         Graphical Network Simulator

* net-misc/gns3-server
     Available versions:  (~)2.2.8 {PYTHON_TARGETS="python3_7 python3_8"}
     Homepage:            https://www.gns3.net/
     Description:         GNS3 server to asynchronously manage emulators

Found 2 matches

Goal accomplished, only the gentoo ebuild in the newest available version is now found.