Skip to content

Instantly share code, notes, and snippets.

View fredrik-jansson-se's full-sized avatar

Fredrik Jansson fredrik-jansson-se

View GitHub Profile
@fredrik-jansson-se
fredrik-jansson-se / ssh_device.py
Created September 19, 2017 00:45
SSH to a device in NSO's device list
#!/usr/bin/env python
import socket
import sys
import tty
import termios
import paramiko
from paramiko.py3compat import u
import ncs
from _ncs import decrypt
@fredrik-jansson-se
fredrik-jansson-se / main.rs
Last active April 19, 2020 07:01
Quick XML extra Text
use quick_xml::{events::Event, Reader};
fn main() {
const BASE1_1: &str = "urn:ietf:params:netconf:base:1.1";
let xml = format!("<capability>{}</capability>", BASE1_1);
let mut r = Reader::from_str(&xml);
let mut buf = Vec::new();
loop {