Skip to content

Instantly share code, notes, and snippets.

@rendoaw
rendoaw / ssh_jump.py
Created May 12, 2020 16:28 — forked from tintoy/ssh_jump.py
SSH via jump-hosts using Paramiko
#!/usr/bin/env python3
import os
import paramiko
ssh_key_filename = os.getenv('HOME') + '/.ssh/id_rsa'
jumpbox_public_addr = '168.128.52.199'
jumpbox_private_addr = '10.0.5.10'
target_addr = '10.0.5.20'
frr version 4.1-devyes
frr defaults traditional
hostname linux-93
username cumulus nopassword
!
service integrated-vtysh-config
!
log syslog informational
!
vrf vrf-110
#!/usr/bin/env python
import os
import json
import datetime
from elasticsearch import Elasticsearch,helpers
import sys
import time
ip netns add ce-3-1
ip link set eth2 netns ce-3-1
ip netns exec ce-3-1 ip a
ip netns exec ce-3-1 vconfig add eth2 100
ip netns exec ce-3-1 ifconfig eth2 up
ip netns exec ce-3-1 ifconfig eth2.100 inet 10.11.12.3 netmask 255.255.255.0 up
ip netns exec ce-3-1 ifconfig eth2.100 up
ip netns exec ce-3-1 ip route add default via 10.11.12.103
ip netns exec ce-3-1 ip link set dev lo up
rw@r1# show routing-options bmp
traceoptions {
file bmp.log size 10m;
flag all;
}
station ubuntu {
connection-mode active;
monitor enable;
station-address 192.168.153.74;
station-port 5555;
@rendoaw
rendoaw / Ansible-Vault how-to.md
Created March 23, 2017 19:43 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

##Working with ansible-vault

I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

Keybase proof

I hereby claim:

  • I am rendoaw on github.
  • I am rendoaw (https://keybase.io/rendoaw) on keybase.
  • I have a public key ASCHC3NEi1Elw8Wn2EbZXenkVUEKhLGws6ozhHGsKeLgPgo

To claim this, I am signing this object:

@rendoaw
rendoaw / new_gist_file_0
Created August 23, 2016 13:34
northstar junosvm sample config
system {
host-name northstar_junosvm;
root-authentication {
encrypted-password <encrypted password>; ## SECRET-DATA
}
login {
user northstar {
uid 2000;
class super-user;
authentication {
# Option to add static routes with netmask
# RFC3442 routes: overrides routers option
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
# MS routes: adds extras to supplement routers option
option ms-classless-static-routes code 249 = array of unsigned integer 8;
# Local subnet
subnet 172.16.0.0 netmask 255.255.255.0 {
range 172.16.0.151 172.16.0.199;
option routers 172.16.0.1;
@rendoaw
rendoaw / junos.netconf.text.format.md
Last active August 29, 2015 14:22
Junos netconf - send standard config and get standard show output

Send standard juniper stanza inside netconf

<rpc> 
    <edit-config> 
        <target> 
            <candidate/> 
        </target> 
        <config-text>
            <configuration-text>