Skip to content

Instantly share code, notes, and snippets.

View pantsmanuk's full-sized avatar

Murray Crane pantsmanuk

  • GGP Systems Ltd
  • London, UK
View GitHub Profile
@pantsmanuk
pantsmanuk / __main__.patch
Created April 1, 2022 12:54
Patch for sc0tfree/updog to add random password support
Index: updog/__main__.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/updog/__main__.py b/updog/__main__.py
--- a/updog/__main__.py (revision 28a1ac16122fe520e29f7b21cffe85744771e216)
+++ b/updog/__main__.py (date 1648817380789)
@@ -1,6 +1,8 @@
import os
@pantsmanuk
pantsmanuk / check_truenas.py
Created November 1, 2019 14:10
check_truenas.py updated to Python 3
#!/usr/bin/env python
# The MIT License (MIT)
# Copyright (c) 2015 Goran Tornqvist
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@pantsmanuk
pantsmanuk / git-deployment.md
Last active April 29, 2019 14:28 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

But here, we add a "bare" git repository that we create on the production server and publish our branch (f.e. master) directly to that server. This repository acts upon the push event using a 'git-hook' to move the files into a deployment directory on your server. No need for a middle man.

@pantsmanuk
pantsmanuk / modify_nat.py
Last active May 31, 2017 15:43 — forked from m-hume/modify_nat.py
I subtly modified m-hume's original python script to "read and modify the configuration of an EdgeMax ubnt router" so that I could pass a parameter to the script to specify which dynamic address to update (we have two branch offices that need to use the corporate internal DNS service). Specifically it updates the source address of a DNAT rule.
#! /usr/bin/python
# This python script is used to read and modify the configuration of an EdgeMax
# ubnt router.
# Specifically it updates the source address of an inbound nat rule that allows
# remote administration from a dynamic IP address tied to a dynamic DNS account.
# Highly reusable is the function get_config_object(). Pass to this the textural
# content of config.boot and it will convert it into an object for querying.
# Feel free to use it and modify it!
# mh 2015 monkeyr.com