Skip to content

Instantly share code, notes, and snippets.

View daBONDi's full-sized avatar

David Baumann daBONDi

View GitHub Profile
@kimus
kimus / ufw.md
Created March 2, 2014 22:46
NAT and FORWARD with Ubuntu’s ufw firewall

UFW

I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.

Install UFW

if ufw is not installed by default be sure to install it first.

@timbutler
timbutler / fortigate52.pattern
Last active April 29, 2024 13:01
Fortigate FortiOS 5.2 (and 5.2.2) Logstash Grok patterns
FORTIDATE %{YEAR:year}\-%{MONTHNUM:month}\-%{MONTHDAY:day}
FORTIGATE_52BASE <%{NUMBER:syslog_index}>date=%{FORTIDATE:date} time=%{TIME:time} devname=%{HOST:hostname} devid=%{HOST:devid} logid=%{NUMBER:logid} type=%{WORD:type} subtype=%{WORD:subtype} eventtype=%{WORD:eventtype} level=%{WORD:level} vd=\"%{WORD:vdom}\"
FORTIGATE_52BASEV2 <%{NUMBER:syslog_index}>date=%{FORTIDATE:date} time=%{TIME:time} devname=%{HOST:hostname} devid=%{HOST:devid} logid=%{NUMBER:logid} type=%{WORD:type} subtype=%{WORD:subtype} level=%{WORD:level} vd=\"%{WORD:vdom}\"
FORTIGATE_52IPS severity=%{WORD:severity} srcip=%{IP:srcip} dstip=%{IP:dstip} sessionid=%{NUMBER:sessionid} action=%{DATA:action} proto=%{NUMBER:proto} service=%{DATA:service} attack="%{DATA:attack}" srcport=%{NUMBER:srcport} dstport=%{NUMBER:dstport} direction=%{NUMBER:direction} attackid=%{NUMBER:attackid} profile=\"%{DATA:profile}\" ref=\"%{DATA:ref}\";? incidentserialno=%{NUMBER:incidentserialno} msg=\"%{GREEDYDATA:msg}\"
FORTIGATE_52DOS severity=%{WORD:severity} s
@sebz
sebz / grunt-hugo-lunrjs.md
Last active June 28, 2024 18:41
hugo + gruntjs + lunrjs = <3 search
@ianschenck
ianschenck / new_app.py
Last active July 30, 2023 03:00
Run your flask app under twisted wsgi, ALWAYS.
if __name__ == "__main__":
reactor_args = {}
def run_twisted_wsgi():
from twisted.internet import reactor
from twisted.web.server import Site
from twisted.web.wsgi import WSGIResource
resource = WSGIResource(reactor, reactor.getThreadPool(), app)
site = Site(resource)
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@PatrickLang
PatrickLang / iis_auth_allsteps.md
Last active March 2, 2024 20:18
Setting up IIS with User Authorization in Windows Server containers

Create a resource group

Create a resource group in Azure to hold all of the resources you'll be creating:

  • Virtual Network
  • Virtual Machines

Create a VNet

  • Don't use 172.* IPs. I used 10.3.0.0/24
@PatrickLang
PatrickLang / server2016_slipstream.md
Last active July 20, 2023 07:52
Automated deployments of Windows Server 2016

This is a draft that will ultimately be blogged later. If you're seeing this after April 2017 it's probably out of date.

Making a pre-updated Windows Server 2016 ISO

Prerequisites

  1. Install the Windows Assessment and Deployment Toolkit
  2. Download a Windows Server 2016 ISO such as the trial here - TODO
  3. Download the latest cumulative update
@bender-the-greatest
bender-the-greatest / Configure-SecureWinRM.ps1
Created July 20, 2017 15:55
Configure WinRM to listen over SSL (port 5986) and use the web certificate generated by a certificate templated called 'WinRM'. Highly recommend reading Synopsis, Description, and Examples.
<#
.SYNOPSIS
Configures a secure WinRM listener over HTTPS to enable
SSL-based WinRM communications. This script has not been
tested on Windows Server 2003R2 or earier, and may not
work on these OSes for a variety of reasons.
If Windows Remote Management is disabled (e.g. service
stopped, GPO Policy, etc.), this script will likely fail.
.DESCRIPTION
@Deepakkothandan
Deepakkothandan / ansible_debug_vscode.md
Last active September 2, 2020 22:33
Debug ansible with vscode

Ansible VSCode Debugging

  1. VSCode version 1.23.1
  2. Create launch.json for python attach
  3. Make sure ptvsd version is 3.0.0 pip install ptvsd==3.0.0
{
    "name": "Python: Attach",
 "type": "python",
@daBONDi
daBONDi / win_lineinfile - Disable Default AJP Connector Port - cve20201938
Created March 2, 2020 12:33
Ansible - win_lineinfile - Comment line in XML - Disable File Tomcat AJP Port
- name: "Ensure Tomcat AJP Connector on Port 8009 is Disabled"
win_lineinfile:
path: "c:/temp/server.xml"
regex: '^(\s*)(<Connector port="8009" protocol="AJP\/1\.3" redirectPort="8443" \/>)'
backrefs: true
line: '$1<!-- $2 -->'