Skip to content

Instantly share code, notes, and snippets.

@l0ll098
l0ll098 / bc.py
Created April 21, 2022 15:33
A Windows script written in Python 3.6+ to control brightness of connected monitors
"""
A Windows script written in Python 3.6+ to control brightness of connected monitors.
Potentially this works only with Display Port connected monitors.
Other type of cables could be supported as long as they use the DDC/CI protocol.
Author: Lorenzo Montanari
"""
from ctypes import windll, byref, Structure, WinError, POINTER, WINFUNCTYPE
from ctypes.wintypes import BOOL, HMONITOR, HDC, RECT, LPARAM, DWORD, BYTE, WCHAR, HANDLE
@l0ll098
l0ll098 / web.config
Created January 11, 2018 09:07
Hide the .html extension Azure/IIS websites
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="RemoveDotHtml" enabled="true" stopProcessing="true">
<match url="(.*)\.html" />
<action type="Redirect" url="{R:1}" />
</rule>
<rule name="AddDotHtml" enabled="true">
@l0ll098
l0ll098 / web.config
Created January 11, 2018 09:04
Force HTTPS on Azure/IIS websites. This file will rewrite every HTTP request to HTTPS. Works on Azure & IIS
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect to https" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="off" />
<add input="{HTTP_HOST}" pattern="localhost" negate="true" />
@l0ll098
l0ll098 / web.config
Last active May 8, 2023 00:56
Serve JSON files Azure WebSites
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".json"/>
<mimeMap fileExtension=".json" mimeType="application/json"/>
</staticContent>
</system.webServer>
</configuration>