Skip to content

Instantly share code, notes, and snippets.

View rdapaz's full-sized avatar

ricdeez rdapaz

View GitHub Profile
@rdapaz
rdapaz / ThreeRouters.txt
Created April 12, 2023 17:59
GraphViz for 3 routers
digraph G {
node[style=filled, fillcolor=red, landscape=True, width=2.5, height=1.25]
R1 -> R2 [label="192.168.12.1/24", fontsize="12pt", arrowsize=0]
R1 -> R3 [label="192.168.13.1/24", fontsize="12pt", arrowsize=0]
R2 -> R3 [label="192.168.23.1/24", fontsize="12pt", arrowsize=0]
R1 -> R1 [label="lo1: 10.1.1.1 ", fontsize="12pt"]
R2 -> R2 [label="lo1: 10.2.2.2 ", fontsize="12pt"]
R3 -> R3 [label="lo1: 10.3.3.3 ", fontsize="12pt"]
@rdapaz
rdapaz / passphrase.md
Last active February 28, 2023 08:57
Generate Secure Passphrases

Steps for generating a secure passphrase

  1. Go to https://xkpasswd.net/s/
  2. Use the following settings:
{
"num_words": 3,
"word_length_min": 4,
"word_length_max": 8,
"case_transform": "ALTERNATE",
@rdapaz
rdapaz / visiohacks.md
Created February 8, 2023 03:01
Visio hacks for drawings

Visio hacks

A3 Page Dimensions

width: 420mm
height: 297mm

Visio Shapesheet Info

@rdapaz
rdapaz / temp.sql.md
Created September 21, 2022 03:36
List all column names in sqlite3 database

This is the sql query that does the trick

select * from pragma_table_info('<table_name>') as tblInfo

Don't forget the quotes!

@rdapaz
rdapaz / Instructions.md
Last active June 11, 2022 14:18
Generate Cisco secret with salt

This is the Linux command to precompute a secret for a Cisco switch / router

username cisco privilege 15 secret 5 $1$6527$WiNuPN8KMuraxwrpieZhK1

The salt is specified where the dots are $1$....$

$ openssl passwd -1 -salt pdQG -table foobar
foobar $1$pdQG$0WzLBXV98voWIUEdIiLm11
@rdapaz
rdapaz / disa_stig_viewer.py
Created May 4, 2022 06:24
DISA STIG Viewer
### DISA STIGS standards are distributed in XML and XSLT file pairs. Under IE, it was possible to open the XSLT and then open the XML, where the latter
### would be properly formatted. With IE no longer in use, this script can generate the html from a pair.
### TODO: Automate so that it generates for all entries in the archived zip (zip of zips)
### -----------------------------------------------------------------------------------------------------
from lxml import etree
path_xml = 'U_MS_Windows_10_STIG_V2R3_Manual-xccdf.xml'
path_xslt = 'STIG_unclass.xsl'
dom = etree.parse(path_xml)
xslt =etree.parse(path_xslt)
@rdapaz
rdapaz / how-to-add-image-to-gist.md
Created April 26, 2022 15:53 — forked from mroderick/how-to-add-image-to-gist.md
How to add an image to a gist

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone [email protected]:<hash>.git     # or with ssh
@rdapaz
rdapaz / fix-eve-NG-webadmin.md
Created April 26, 2022 15:29
Restore web admin username and password on eve-NG

Eve-NG

Problem

Trying to reset admin password on eve-ng according to FAQs. However, FAQs seem to be cutting short the bit instructing users on how to repopulate the users table after deleting its contents:

For Professional Edition (if you have EVE Pro Version 2.0.4-97 and higher), type the next 2 command lines in EVE NG CLI as Root user:

@rdapaz
rdapaz / ip.py
Created April 20, 2022 09:35 — forked from ChrisTM/ip.py
Convert IPv4 addresses to and from integers
"""
Convert between various representations of an IPv4 address.
`ip` refers to a dotted string, like: `'127.0.0.1'`.
`octets` are indexables, like `(127, 0, 0, 1)`.
`int` is the integer representation, like `2130706433`.
Written for Python 2.7.
"""
@rdapaz
rdapaz / VisioAutomation.py
Created March 30, 2022 18:35
VisioAutomation
import os
import win32com.client
import re
import pprint
def pretty_print(o):
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(o)