diff --git a/README.md b/README.md index 71221b37abb9a08e7193cde4bdd3c253d490ed06..bd9a21247ae45c0dab4192159eb830f6dfe2c1f9 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,19 @@ When you are in the docker you have to do: kinit $YOUR_NICE_LOGIN_NAME ``` +### To connect to NXCALS + +Open a terminal on your laptop and copy the `run_sshuttle.sh` file from the container home to your local_host_home (we assume is `~`). + +From the local_host run then the `~/run_sshuttle.sh connect`. + +Open a new tab in your terminal and launch the container. +In the container do +``` +kinit sterbini +~/local_host_home/run_sshuttle.sh connect +python test_pytimber.py +``` # To make the docker To build the docker diff --git a/run_sshuttle.sh b/run_sshuttle.sh index 0551322ecf0310516059cb79d38c625e7fe7ea71..17facd813717afe6c767814773869bf92a5eee95 100755 --- a/run_sshuttle.sh +++ b/run_sshuttle.sh @@ -1,10 +1,38 @@ #!/bin/sh - # From https://codimd.web.cern.ch/vjC8BHbTS7etHwJve-K2Uw - case $1 in connect) - sshuttle --dns -vr sterbini@lxplus.cern.ch 188.0.0.0/8 137.138.0.0/16 172.18.0.0/16 128.141.0.0/16 128.142.0.0/16 188.184.0.0/15 --daemon --pidfile /tmp/sshuttle.pid + sshuttle --dns -v --remote sterbini@lxplus.cern.ch \ + 10.0.0.0/16 128.141.0.0/16 128.142.0.0/16 137.138.0.0/16 172.18.0.0/16 185.249.56.0/22 188.0.0.0/8 192.65.196.0/23 192.91.242.0/24 194.12.128.0/18 2001:1458::/32 2001:1459::/32 \ + 10.0.0.0/8 \ + 100.64.0.0/10 \ + 10.100.0.0/16 \ + 10.254.0.0/16 \ + 10.76.0.0/15 \ + 128.141.0.0/16 \ + 128.142.0.0/16 \ + 137.138.0.0/16 \ + 172.16.0.0/12 \ + 185.249.56.0/22 \ + 188.184.0.0/15 \ + 188.184.0.0/16 \ + 188.185.0.0/15 \ + 188.185.0.0/16 \ + 192.16.155.0/24 \ + 192.16.156.0/22 \ + 192.16.160.0/22 \ + 192.16.164.0/23 \ + 192.16.166.0/24 \ + 192.65.183.0/24 \ + 192.65.184.0/21 \ + 192.65.192.0/22 \ + 192.65.196.0/23 \ + 192.91.236.0/22 \ + 192.91.240.0/22 \ + 192.91.242.0/24 \ + 192.91.244.0/23 \ + 192.91.246.0/24 \ + 194.12.128.0/18 --daemon --pidfile /tmp/sshuttle.pid shift ;; disconnect) @@ -16,5 +44,5 @@ case $1 in echo "Unknown option\nUsage:" echo "\t $0 connect : to start VPN-like connection to CERN" echo "\t $0 disconnect : to stop it" - ;; +;; esac diff --git a/test_pytimber.py b/test_pytimber.py new file mode 100644 index 0000000000000000000000000000000000000000..a16f9a02faed87675f76fa222decf12b880ed10d --- /dev/null +++ b/test_pytimber.py @@ -0,0 +1,11 @@ +import pytimber +print("pytimber imported.") +ldb=pytimber.LoggingDB(source='nxcals') # Backport API +print("LoggiggDB connected.") +print('Query: getLHCFillData(7334)...') +a=ldb.getLHCFillData(7334) +print(a) +print('Exiting...') +import jpype as jp +System = jp.JClass("java.lang.System") +System.exit(0)