Skip to content

Instantly share code, notes, and snippets.

View MorningLightMountain713's full-sized avatar

David White MorningLightMountain713

View GitHub Profile
@MorningLightMountain713
MorningLightMountain713 / dhcpparse.awk
Created November 29, 2018 23:20 — forked from mattpascoe/dhcpparse.awk
An AWK script to parse ISC dhcpd configuration files into dcm.pl output to load into OpenNetAdmin
#!/usr/bin/awk -f
#
# Author: Matt Pascoe - [email protected]
#
# This awk script is used to extract relavant information from a dhcpd.conf
# config file and build dcm.pl output with appropriate fields. This can be
# used to bootstrap a new database from existing site data.
# As usual, inspect the output for accuracy.
# Also you will get three types of output, subnet,pool,host. You must
# add the subnet information first, then pool, then host.
@MorningLightMountain713
MorningLightMountain713 / checkFirmware.js
Created October 22, 2019 19:51
Genieacs extension script to return how many times provision has been run per day.
// Genieacs provision usage
// let ts = new Date().getTime() / 1000; // unix timestamp
// let serial = declare("InternetGatewayDevice.DeviceInfo.SerialNumber", {value:null}).value[0];
// let unique_ts = serial + "_" + parseInt(ts, 10);
// let limit = ext("checkFirmware","counter", unique_ts);
// limit is boolean. If the limit has been reached or this provision has been run already (idempotency) limit will be true.
// script resets at midnight.
var redis = require('redis');
/*
Start upgrading x routers per day, double that number until max router upgrades reached.
Eg: With starting upgrade number of 200 routers, total of 5000 and max per day of 1000:
Day 1 upgrade 200 routers,
Day 2 uprade 400 routers,
Day 3 upgrade 800 routers,
Day 4 upgrade 1000 routers
Day 5 upgrade 1000 routers
Day 6 upgrade 1000 routers
@MorningLightMountain713
MorningLightMountain713 / junos.py
Created June 22, 2022 23:02 — forked from jobec/junos.py
Junos config parsing with pyparsing
import textwrap
from collections import OrderedDict
import pyparsing as pp
class Statement(str):
def __str__(self):
return super().__str__() + ";"
@MorningLightMountain713
MorningLightMountain713 / nc-proxy-readme.md
Created December 1, 2022 05:49 — forked from m1tk4/nc-proxy-readme.md
netcat tcp proxy, for mapping ports on a remote machine to a local machine

Helper script to map ports to other servers.

Use Case

had a database that was only accesible in the VPC on aws, so i created an dev intance and did a ssh tunnel to that dev instance with netcat mapping the port to the database

Sample Usage

Forward all request from local 5432 to remote host google.com port 80

./nc-proxy.sh 5432 google.com 80

How To Install OpenSSL 1.1.1 on CentOS 7

This tutorial goes through how to install openssl 1.1.1 on CentOS 7, since the yum repo only installs up to openssl 1.0.

Requirements

Upgrade the system

yum -y update
#!/usr/bin/env python
"""
Roughly based on: http://code.activestate.com/recipes/576980-authenticated-encryption-with-pycrypto/
"""
import hashlib
import hmac
from Crypto.Cipher import AES
from Crypto.Random import random
@MorningLightMountain713
MorningLightMountain713 / README.md
Created February 20, 2024 09:54 — forked from etiennetremel/README.md
Simple Wireguard setup as VPN server and multiple clients

Simple WireGuard configuration

1 server, 2 clients

Getting started

Install Wireguard on all machines.

Generate all keys

@MorningLightMountain713
MorningLightMountain713 / deploy.py
Created March 6, 2024 21:32
Sandbox code to register flux app (needs refactor and httpx)
import time
import hashlib
import json
from rich.pretty import pprint
from Cryptodome.Random import get_random_bytes
from bitcoin.wallet import CBitcoinSecret, P2PKHBitcoinAddress
import requests
from bitcoin.signmessage import BitcoinMessage, VerifyMessage, SignMessage
@MorningLightMountain713
MorningLightMountain713 / gist:7cd8fd28000069d0f036410bbe8bdd02
Created May 4, 2024 22:00 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: