| FROM python:3 | |
| WORKDIR /usr/src/app | |
| # Copy over the drivers | |
| # MySQL ODBC Ansi | |
| COPY drivers/mysql-connector-odbc-5.3.9-linux-ubuntu16.04-x86-64bit.tar.gz . | |
| # Oracle 11.2 | |
| COPY drivers/oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm . | |
| COPY drivers/oracle-instantclient11.2-odbc-11.2.0.4.0-1.x86_64.rpm . |
| # One liner | |
| wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
| # Explained | |
| wget \ | |
| --recursive \ # Download the whole site. | |
| --page-requisites \ # Get all assets/elements (CSS/JS/images). | |
| --adjust-extension \ # Save files with .html on the end. | |
| --span-hosts \ # Include necessary assets from offsite as well. | |
| --convert-links \ # Update links to still work in the static version. |
| DROP DATABASE IF EXISTS 📚; | |
| CREATE DATABASE 📚; | |
| USE 📚; | |
| CREATE TABLE 👤( | |
| 🔑 INTEGER PRIMARY KEY, | |
| 🗣 varchar(64), -- name | |
| 🗓 DATE -- date of registration |
| #!/bin/sh | |
| # Git proxy settings | |
| echo "Configuring Git for compatibility with ZScaler..." | |
| git config --global http.proxy http://gateway.zscaler.net:80/ | |
| git config --system http.proxy http://gateway.zscaler.net:80/ |
Tip
Microsoft active directory servers by default provide LDAP connections over unencrypted connections (boo!).
The steps below will create a new self signed certificate appropriate for use with and thus enabling LDAPS for an AD server. Of course the "self-signed" portion of this guide can be swapped out with a real vendor purchased certificate if required.
Steps have been tested successfully with Windows Server 2012R2, but should work with Windows Server 2008 without modification. Requires a working OpenSSL install (ideally Linux/OSX) and (obviously) a Windows Active Directory server.
| -- Permanent copy of schema extended properties | |
| -- In a format suitable for easy source control and hand-editing. | |
| -- All the properties are prefixed and only those will be added/updated/deleted by this script | |
| -- At the bottom you'll find a commented-out `select` for generating the | |
| -- insert block from an existing schema's extended properties. |
| //list available DMVs | |
| Select * from $SYSTEM.DBSCHEMA_TABLES where table_type = 'Schema' order by table_name | |
| //Useful DMVs for 2016 SSAS Tabular Models | |
| Select * from $SYSTEM.TMSCHEMA_ATTRIBUTE_HIERARCHY_STORAGES //distinct data count for each column | |
| Select * from $SYSTEM.TMSCHEMA_ATTRIBUTE_HIERARCHIES //ties hierarchy id to column | |
| SELECT * from $SYSTEM.TMSCHEMA_COLUMN_STORAGES //has order by column, row count is inaccurate | |
| Select * from $SYSTEM.TMSCHEMA_COLUMNS //column name, ID for table, data type, category, hidden, iskey, isunique, is nullable, summarize by, expression for calc columns, hierarchy id, refresh time, modify time. source provider type, display folder | |
| SELECT * from $SYSTEM.TMSCHEMA_DATA_SOURCES //connection string, account, impersonation mode, name | |
| Select * from $SYSTEM.TMSCHEMA_HIERARCHIES //hierarchy name, display folder |
| #!/usr/bin/env bash | |
| # When will my Lenovo order arrive? | |
| # | |
| # I grew impatient while waiting for my Thinkpad to ship, and the arrival date | |
| # kept changing, so I wrote this script to scrape their order details page. | |
| # | |
| # Might not work on all platforms, and it's parsing HTML with sed, so there be | |
| # plenty of dragons within this script. |
Using py.test is great and the support for test fixtures is pretty awesome. However, in order to share your fixtures across your entire module, py.test suggests you define all your fixtures within one single conftest.py file. This is impractical if you have a large quantity of fixtures -- for better organization and readibility, you would much rather define your fixtures across multiple, well-named files. But how do you do that? ...No one on the internet seemed to know.
Turns out, however, you can define fixtures in individual files like this:
tests/fixtures/add.py
import pytest
@pytest.fixture