Skip to content

Instantly share code, notes, and snippets.

View XioNoX's full-sized avatar

Arzhel Younsi XioNoX

View GitHub Profile
@XioNoX
XioNoX / pan2capi.py
Created February 3, 2017 05:44
Convert PAN policies to Capirca format
#!/usr/bin/python
from pandevice import base
from pandevice import firewall
from pandevice import panorama
from pandevice import policies
from pandevice import objects
from pandevice import network
from pandevice import device
@XioNoX
XioNoX / notify.py
Created November 2, 2017 19:14
Send notifications to BGP peers using our old AS number
from napalm import get_network_driver
from pprint import pprint
from peeringdb import PeeringDB
import twentyc
import smtplib
@XioNoX
XioNoX / netflow sampling
Created February 16, 2018 23:39
netflow sampling on junos
Variable:
set forwarding-options sampling instance pmacct family inet output inline-jflow source-address <routerLO>
set forwarding-options sampling instance pmacct family inet6 output inline-jflow source-address <routerLO>
set protocols bgp group Netflow local-address <routerLO>
set protocols bgp group Netflow peer-as <routerASN> #ibgp, pmacct accepts any AS#
set protocols bgp group Netflow local-as <routerASN>
MX > 104: set chassis fpc X sampling-instance pmacct
MX104 : set chassis afeb slot 0 sampling-instance pmacct
MX80 : set chassis tfeb slot 0 sampling-instance pmacct
@XioNoX
XioNoX / netbox_add_psu.py
Created October 17, 2018 16:12
Script to mass add PSUs to specific servers/sites in Netbox
#!/usr/bin/env python
import pynetbox
netbox_api_token = 'secret'
print('Connecting to Netbox')
netbox = pynetbox.api('https://netbox', token=netbox_api_token)
# Pull list of eqsin dell devices from netbox
@XioNoX
XioNoX / autorsi.py
Last active January 5, 2023 14:10
Generate then download Juniper RSI and logs. Optionally uploads them to the matching JTAC case.
#!/usr/bin/env python3
# usage: autorsi.py [-h] [--username USERNAME] [--sshconf SSHCONF] [--case CASE]
# hostname
#
# Generate then download RSI and logs. Optionally upload them to the matching
# JTAC case.
#
# positional arguments:
# hostname Device to connect to
#
@XioNoX
XioNoX / gist:a4b285eb34634d3c7da1c94dfc8b84c0
Created August 22, 2023 16:54
abstreet - brest import logs
This file has been truncated, but you can view the full file.
xionox@laptop:~/Documents/Projects/github/abstreet/abstreet$ ./import.sh --city=fr/brest --raw --map
Compiling importer v0.1.0 (/home/xionox/Documents/Projects/github/abstreet/abstreet/importer)
Compiling cli v0.1.0 (/home/xionox/Documents/Projects/github/abstreet/abstreet/cli)
Finished release [optimized] target(s) in 19.62s
Running `target/release/cli import --city=fr/brest --raw --map`
import one city...
import brest (fr)...
- Working on all brest (fr) maps
city (in brest (fr))...
- Missing data/input/fr/brest/gtfs/, so downloading https://ratpdev-mosaic-prod-bucket-raw.s3-eu-west-1.amazonaws.com/11/exports/1/gtfs.zip
@XioNoX
XioNoX / gist:7e2cf2d27f83247c645a53062a0bd378
Created August 22, 2023 19:56
abstreet crash thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Ring has repeat non-adjacent points near Pt2D(11564.9776, 9252.0435)', geom/src/ring.rs:72:24
abstreet_linux_v0_3_45$ RUST_BACKTRACE=full ./binaries/game
[2023-08-22T19:52:07Z WARN map_gui::options] Couldn't restore settings, so using defaults. data/player/settings.json
setup widgetry...
[2023-08-22T19:52:07Z WARN widgetry::runner] Monitor scale factor is 1, screen window is 800, but the application requires 1500. Overriding the scale factor to 1.
setup app...
load default texture...
[2023-08-22T19:52:07Z INFO widgetry::backend_glow] img_size: 896x896px (802816 px), sprite_size: 64x64px, sprites: 14x14 (196 sprites)
load default texture took 0.0126s
create blank sim...
create blank sim took 0.0016s