Code

Python3 and plotly.express : if it fails to import...

AS me if you want to use plotly.express module and you fail with somethink like :

ImportError: Plotly express requires pandas to be installed.

It seems obvious : “pip3 install pandas”. But it can fail with :

>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/root/src/tango-batch/venv/lib/python3.9/site-packages/pandas/__init__.py", line 48, in <module>
from pandas.core.api import (
File "/root/src/tango-batch/venv/lib/python3.9/site-packages/pandas/core/api.py", line 47, in <module>
from pandas.core.groupby import (
File "/root/src/tango-batch/venv/lib/python3.9/site-packages/pandas/core/groupby/__init__.py", line 1, in <module>
from pandas.core.groupby.generic import (
File "/root/src/tango-batch/venv/lib/python3.9/site-packages/pandas/core/groupby/generic.py", line 77, in <module>
from pandas.core.frame import DataFrame
File "/root/src/tango-batch/venv/lib/python3.9/site-packages/pandas/core/frame.py", line 171, in <module>
from pandas.core.generic import NDFrame
File "/root/src/tango-batch/venv/lib/python3.9/site-packages/pandas/core/generic.py", line 148, in <module>
from pandas.core.describe import describe_ndframe
File "/root/src/tango-batch/venv/lib/python3.9/site-packages/pandas/core/describe.py", line 43, in <module>
from pandas.io.formats.format import format_percentiles
File "/root/src/tango-batch/venv/lib/python3.9/site-packages/pandas/io/formats/format.py", line 105, in <module>
from pandas.io.common import (
File "/root/src/tango-batch/venv/lib/python3.9/site-packages/pandas/io/common.py", line 8, in <module>
import bz2
File "/usr/local/lib/python3.9/bz2.py", line 18, in <module>
from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'

the way to correct it (if as me you have compiled your version of Python) :

Some bashblog tests.

For now I will not move from this blog motor, but I have tested bashblog because I have made some search of my really old blog post and it make me think about nanoblogger which is not ever maintained now. So I search only for curiosity if there is now this kind of project. Bashblog is this kind of work. Only some bash and a quick result.

It is simple, just configure EDITOR variable and let’s go :

FRR Routing v8.0 is out and happy to see SR

Hey,

For (perhaps) futur projet I read different documentations around Bird, FRR Routing, … and I am really happy to see in FRR Routing v8.0 the new ‘pathd’ daemon, which implement SR (Segment Routing). It is really cool to see this.

There is others new feature which have been implemented in this release and are major IMHO.

  • TI-LFA for OSPF and IS-IS (great too for SR) ;
  • VRF for OSPFv3 ;
  • EVPN full-implementation.

It is really great work !!!

bwping patch (catching signals)

diff -urpN bwping/bwping.c bwping-patched/bwping.c
--- bwping/bwping.c     2012-10-11 19:23:17.000000000 +0200
+++ bwping-patched/bwping.c     2017-04-20 09:06:23.449540033 +0200
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef __CYGWIN__
 #include "cygwin.h"
@@ -224,21 +225,39 @@ static int recv_ping (int sock, int iden
         return 0;
     }
 }
+unsigned int   transmitted_number, received_number;
+unsigned long  int received_volume;
+struct timeval begin, end;
+
+void sig_handler(int signo)
+{
+       if (signo == SIGUSR1) {
+                printf("Total: pkts sent/rcvd: %u/%u, volume rcvd: %lu bytes, time: %d sec, speed: %lu kbps, rtt min/max/average: %llu/%llu/%llu ms\n",
+                               transmitted_number, received_number, received_volume, (int)(end.tv_sec - begin.tv_sec),
+                               end.tv_sec - begin.tv_sec?((received_volume / (end.tv_sec - begin.tv_sec)) * 8) / 1000:(received_volume * 8) / 1000,
+                               min_rtt==DEF_MIN_RTT?0:min_rtt, max_rtt, average_rtt);
+               exit(255);
+       }
+}
 
 int main (int argc, char **argv)
 {
     int                    sock, exitval, ch, ident, finish, pktburst, i, n;
- unsigned int           bufsize, tos, transmitted_number, received_number;
- unsigned long int      kbps, pktsize, volume, rperiod, received_volume;
+    unsigned int           bufsize, tos;
+    unsigned long int      kbps, pktsize, volume, rperiod;
     unsigned long long int min_interval, interval, current_interval, integral_error;
     char                   *ep, *bind_addr, *target;
     fd_set                 fds;
     struct sockaddr_in     bind_to, to;
     struct hostent         *hp;
- struct timeval         begin, end, report, start, now, seltimeout;
+    struct timeval         report, start, now, seltimeout;
 
     sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
 
+       if (signal(SIGUSR1, sig_handler) == SIG_ERR)
+               printf("\ncan't catch SIGUSR1\n");
+
+
     if (sock==-1) {
         perror("bwping: socket(AF_INET, SOCK_RAW, IPPROTO_ICMP) failed");

Download : patch-bwping-sig.diff

Dia and OSX Yosemite

For those of you whom are using this excellent opensource diagram software, since OS X Yosemite it seems it lacks one line to work correctly. You must edit : ‘/Applications/Dia.app/Contents/Ressources/bin/dia’ and add at line 39 : “export DISPLAY=:O” such as :


[…]

 

fi fi export DISPLAY=:0 osascript -e ’tell app “XQuartz” to launch’ for i in `seq 1 30`; do

[…]


 

Now it must work correctly :)

Source : http://navkirats.blogspot.fr/2014/10/dia-diagram-mac-osx-yosemite-fix-i-use.html

After WEB-IOU : UNetLab. An amazing project ...

For those of you who know the excellent web-iou, you will not be surprised that this new project from Andrea is really exciting and amazing.

Please see all the platform you can simulate with :

  • A10 vThunder
  • Aruba ClearPass
  • Alcatel 7750 SR
  • Arista vEOS
  • Brocade vADX
  • CheckPoint Security Gateway VE
  • Cisco ASA (porting)
  • Cisco ASAv
  • Cisco CSR 1000V
  • Cisco IPS (porting)
  • Cisco IOS 1710 (dynamips, ethernet only)
  • Cisco IOS 3725 (dynamips, ethernet only)
  • Cisco IOS 7206VXR (dynamips, ethernet only)
  • Cisco IOL (for Cisco internal use only)
  • Cisco Titanium (for VIRL customers only)
  • Cisco vIOS (for VIRL customers only)
  • Cisco vIOS L2 (for VIRL customers only)
  • Cisco Virtual Wireless Lan Controller (vWLC)
  • Cisco Web Security Appliance (IronPort)
  • Cisco XRv
  • Citrix NetScaler
  • ExtremeXOS
  • F5 BIG-IP LTM VE
  • Fortinet FortiGate (new)
  • HP VSR1000
  • Juniper Olive (porting)
  • Juniper vMX
  • Juniper vSRX
  • Palo Alto VM-100 Firewall
  • VMware ESXi
  • VyOS
  • Windows host

jquery - jqgrid : Custom delete handler

It may possible you are face off the problem to synchronize some other items in your GUI when you delete a row in your jqgrid.

You can use this tip to do it :

var myDelOptions = {
    onclickSubmit: function(options, rowid) {
          var grid_id = $.jgrid.jqID($( "#tip" )[0].id),
             grid_p = $( "#tip" )[0].p,
             newPage = grid_p.page;

          // reset the value of processing option which could be modified
          options.processing = true;

          // delete the row
          $( "#tip" ).delRowData(rowid);
          $.ajax({
                url: 'backend/ip.php',
                type: 'POST',
                data : 'oper=del&id=' + rowid,
                dataType: "text",
                success: function(data, status, xr) {
                         $( "#troute" ).trigger("reloadGrid");
                         $( "#tip" ).trigger("reloadGrid");
                },
                error: function(e) {
                         //called when there is an error
                         //console.log(e.message);
                }
           });
           
           $.jgrid.hideModal("#delmod"+grid_id,
                             {gb:"#gbox_"+grid_id,
                              jqm:options.jqModal,onClose:options.onClose});

           if (grid_p.lastpage > 1) {// on the multipage grid reload the grid
                    if (grid_p.reccount === 0 && newPage === grid_p.lastpage) {
                        // if after deliting there are no rows on the current page
                        // which is the last page of the grid
                        newPage--; // go to the previous page
                     }
                     // reload grid to make the row from the next page visable.
                     $( "#tip" ).trigger("reloadGrid", [{page:newPage}]);
            }

            return true;
     },
     processing:true
}; // fin variable

 $("#tip").jqGrid({
     url: "backend/ip.php",
     datatype: "xml",
     mtype: "GET",
     colNames: [" ", "Prefix", "Longueur", "Device"],
     colModel: [
                { name: 'myac', width:80, fixed:true, sortable:false, resize:false,
                  formatter:'actions', formatoptions:{editbutton: false, onedit:null,
                  delbutton:true, delOptions: myDelOptions}},
                { name: "prefix", width: 125, align: "center" },
                { name: "longueur", width: 100, align: "center" },
                { name: "device", width: 75, align: "center" }
      ],
      [...]
      caption: "Affectation IP / Intf"
});

[...]

The great thing is that you are able to make some data / gui treatment. Here I make a data update by means of a jquery ajax call and update jqgrids by means of two trigger(“reloadGrid”) calls.

Etherate : the beginning of an Open Aurora Tango test (L2 tester)...

For those of you which perform some Aurora Tango tests (BERT, RFC 2544) you may know that a couple of these testers are really expensive ! The principle of these test is to place a tester in loopback and another is test mode. By means of this, you are able to qualify an Ethernet link (direct, Q-in-Q, VPLS, Xconnect).

During my readings of mailing-lists such as cisco-nsp or others, someone posts an URL to a really awesome Linux program : etherate. With modern CPU platform you are able to supply a throughput until 1G, and this program give you the possibility to test your L2 circuits.