Skip to content

Instantly share code, notes, and snippets.

@i5okie
i5okie / webhook.py
Created November 19, 2019 18:52
python webhook echo server with coloured formatted output
import json, ast
from flask import Flask, request, abort
from pygments import highlight, lexers, formatters
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def webhook():
if request.method == 'POST':
formatted_json = json.dumps(request.json, indent=2, sort_keys=True)
@i5okie
i5okie / user-data.sh
Last active September 4, 2018 21:16 — forked from codeinthehole/user-data.sh
Get the value of an EC2 instance's tag
#!/usr/bin/env bash
#
# Get the value of a tag for a running EC2 instance.
#
# This can be useful within bootstrapping scripts ("user-data").
#
# Note the EC3 instance needs to have an IAM role that lets it read tags. The policy
# JSON for this looks like:
#
# {
@i5okie
i5okie / beanstalk.tf
Created July 25, 2018 18:45
Using an Elastic Beanstalk - Custom platform with terraform
# I couldn't find any documentation or mention of using a EB platform in Terraform templates.
# solution_stack_name example: arn:aws:elasticbeanstalk:us-west-2:055555555555:platform/eb-elixir/1.0.15
resource "aws_elastic_beanstalk_environment" "main" {
name = "main"
description = "EB Environment with custom platform"
solution_stack_name = "arn:aws:elasticbeanstalk:us-west-2:<account_number>:platform/<platform_name>/<platform_version>"
}
@i5okie
i5okie / ROUTER1
Last active August 19, 2016 23:11
mikrotik_config
# aug/19/2016 16:09:25 by RouterOS 6.36
# software id = Y92J-ABBU
#
/interface bridge
add admin-mac=E4:8D:8C:A8:9B:DB auto-mac=no name=bridge-local
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-Ce \
country=canada disabled=no distance=indoors frequency=auto mode=ap-bridge \
name=WLAN1 ssid=blah wds-default-bridge=bridge-local wds-mode=\
dynamic-mesh wireless-protocol=802.11
@i5okie
i5okie / changes
Created July 7, 2016 20:13
TSD to Typings (Electron with TypeScript, React)
///<package.json>
...
"devDependencies": {
...
"typings": "^1.3.1"
...
///<Makefile>
build: node_modules typings
interface BVI1
description $FW_INSIDE$
ip address 10.1.8.1 255.255.255.0
ip access-group 102 in
no ip redirects
no ip unreachables
no ip proxy-arp
ip nat inside
ip virtual-reassembly in
!
[Fri Jan 15 15:03:02.480160 2016] [suexec:notice] [pid 9534] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Fri Jan 15 15:03:02.499142 2016] [auth_digest:notice] [pid 9534] AH01757: generating secret for digest authentication ...
[Fri Jan 15 15:03:02.499976 2016] [lbmethod_heartbeat:notice] [pid 9534] AH02282: No slotmem from mod_heartmonitor
[Fri Jan 15 15:03:02.507829 2016] [mpm_prefork:notice] [pid 9534] AH00163: Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations
[Fri Jan 15 15:03:02.507877 2016] [core:notice] [pid 9534] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Fri Jan 15 15:03:11.106365 2016] [:error] [pid 9535] [remote {myip}] mod_wsgi (pid=9535): Exception occurred processing WSGI script '/var/www/ecm-site/wsgi/ecm.wsgi'.
[Fri Jan 15 15:03:11.106462 2016] [:error] [pid
@i5okie
i5okie / config
Last active January 6, 2016 19:21
vyos@vyos:~$ show conf
interfaces {
ethernet eth0 {
address 10.1.8.10/24
description OUTSIDE
duplex auto
hw-id 00:15:5d:08:2c:03
smp_affinity auto
speed auto
}
@i5okie
i5okie / gist:2088f13419b60f4bf73f
Last active January 4, 2016 21:02
ibc-servmachine
Set-ExplorerOptions -showHidenFilesFoldersDrives -showFileExtensions
Enable-RemoteDesktop
cinst atom
cinst flashplayerplugin
cinst googlechrome
cinst firefox
cinst ccleaner
cinst powershell
cinst vlc