Skip to content

Instantly share code, notes, and snippets.

@plembo
plembo / DisableMFAForAADUser.md
Last active April 16, 2024 12:17
Disable MFA for an individual Azure AD User

Disabling MFA for an Azure AD User

Azure AD MFA is not enabled by default for AAD and Microsoft 365 users, but it will be if during setup an admin chooses to Enable Security Defaults on Azure AD (as most will when prompted to do so: after all, who in their right mind wouldn't require MFA?).

However, there are situations where being able to toggle MFA on or off for a particular user can be useful. For example, in a development or test tenant when working with sample code from Microsoft that doesn't account for MFA (like a simple Microsoft Graph console app). This procedure involves disabling Security Defaults on AAD.

@gaieges
gaieges / docker-compose.yml
Created March 8, 2020 16:14
Homeassistant with traefik 2.2 for TLS in docker-compose in network_mode: host
version: '2.1'
services:
homeassistant:
restart: always
image: homeassistant/raspberrypi3-homeassistant
expose:
- 8123
ports:
- "8123:8123"
@mlabouardy
mlabouardy / Jenkinsfile
Created November 4, 2018 12:54
CI/CD for Serverless apps with Jenkins
def bucket = 'deployment-packages-mlabouardy'
def functionName = 'Fibonacci'
def region = 'eu-west-3'
node('slaves'){
stage('Checkout'){
checkout scm
}
stage('Test'){
@chusiang
chusiang / teams-chat-post-for-workflows.sh
Last active July 25, 2024 14:02
Post a message to Microsoft Teams with bash script.
#!/bin/bash
# =============================================================================
# Author: Chu-Siang Lai / chusiang (at) drx.tw
# Filename: teams-chat-post-for-workflows.sh
# Modified: 2024-07-22 11:44 (UTC+08:00)
# Description: Post a message to Microsoft Teams via "Post to a chat when a webhook request is received" workflows.
# Reference:
#
# - https://gist.github.com/chusiang/895f6406fbf9285c58ad0a3ace13d025
# - https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/
@ShepardToTheStars
ShepardToTheStars / Install-TeamCityBuildAgents.ps1
Last active September 21, 2022 13:19
TeamCity Build Agent Automated Install
#https://vanessa.louwagie.io/2017/09/08/automated-teamcity-build-agent-install-for-windows-server/
#Agent requires Java to be installed, and have the java bin directory exist in the path directory.
Param(
#The parent installation directory. Will create [$NumberOfBuildAgents] directories, one for each build agent.
[Parameter(Mandatory=$true)]
$InstallationDiskDrive = "C:\",
#The path to the Java Runtime Environment which the build agent runs on top of.
[Parameter(Mandatory=$true)]
$JavaPath = "C:\JRE",
@berkayunal
berkayunal / ._ Loading variables from .env files in Ansible.md
Created January 16, 2018 20:42
Loading variables from .env files in Ansible

Loading variables from .env files in Ansible

Ansible has various ways of looking up data from outside sources, including plain text password files, CSV files and INI files. But it doesn't seem to have a lookup for .env files, as used in Laravel projects, also available for PHP, Ruby, Node.js, Python and others.

One option is to launch Ansible with the Ruby dotenv command line script... But that requires Ruby, which seems like overkill to me.

So here is a simpler solution that I use. It consists of:

  1. The .env file itself
  2. A small shell script that loads the .env file into environment variables - ansible-playbook.sh
@shortjared
shortjared / list.txt
Last active July 19, 2024 21:20
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
# Set administrator password
net user Administrator SuperS3cr3t!
wmic useraccount where "name='Administrator'" set PasswordExpires=FALSE
# Turn off PowerShell execution policy restrictions
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine
# First, make sure WinRM can't be connected to
netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" new enable=yes action=block
@DanHam
DanHam / SetupWinRM.ps1
Last active February 11, 2018 21:39
WinRM set up script for Packer. Used with Windows 2012R2 and Windows 2016.
# Configure WinRM settings
Write-Host 'Configuring WinRM'
# Make 100% sure we prevent Packer from connecting to WinRM while we
# attempt to configure everything
Disable-NetFirewallRule -DisplayGroup 'Windows Remote Management'
Write-Host '* Setting the WinRM Service start up type to Automatic'
Set-Service -Name WinRM -StartupType Automatic
@tuannvm
tuannvm / 0.12.tf
Last active December 3, 2022 18:50
#terraform #hashicorp #cheatsheet #0.12
#### first class expresssion
variable "ami" {}
resource "aws_instance" "example" {
ami = var.ami
}
#### list & map
resource "aws_instance" "example" {
vpc_security_group_ids = var.security_group_id != "" ? [var.security_group_id] : []
}