Skip to content

Instantly share code, notes, and snippets.

@covertgeek
covertgeek / README
Created February 28, 2021 07:44 — forked from xbb/README
IDRAC6 Virtual Console Launcher
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface.
You can use the user and password that you use for the web interface.
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS.
You don't need to install it, just extract it or copy the files in "jre" folder.
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor.
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture.
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs.
@covertgeek
covertgeek / py2-good.py
Created August 27, 2020 13:29
Bad python example
# TODO: This doesn't work in python 3
def my_function(start_value):
try:
print 'I work fine in python 2'
x = 10 / start_value
except TypeError, e:
print 'e'
if __name__ == "__main__":
my_function("1")
@covertgeek
covertgeek / playbook.yml
Created August 27, 2020 13:23
Bad registry example
# TODO: set this to use the right ansible module
- name: Set dummy registry key
win_shell: New-ItemProperty -Path "HKCU:\dummy\NetwrixKey" -Name "NetwrixParam" -Value ”NetwrixValue” -PropertyType "String"

#Flask-admin Many-to-Many Search

Many-to-Many searches are not easily supported by Flask-admin. Read Here for more info

##Solution

  • Add the association tables to the list of join tables so that the join between the two tables can be made through the association table.
  • Reverse the tables to ensure that the association tables are processed before the other join table.

Tested on Flask-Admin 1.1.0

// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext import admin, wtf
from flask.ext.admin.contrib import sqlamodel
app = Flask(__name__)
app.config['SECRET_KEY'] = '123456790'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.sqlite'
db = SQLAlchemy(app)