Skip to content

Instantly share code, notes, and snippets.

View wictorwilen's full-sized avatar
😀

Wictor Wilén wictorwilen

😀
View GitHub Profile
@wictorwilen
wictorwilen / install-microsoft-edge-in-wsl.sh
Created November 2, 2021 20:55
Install Microsoft Edge in WSL
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
sudo apt update
sudo apt install microsoft-edge-stable
@wictorwilen
wictorwilen / teamsemail.ps1
Created February 11, 2020 10:06
List all Microsoft Teams members e-mail
Install-Module -Name MicrosoftTeams -Force
Connect-MicrosoftTeams
Get-Team -User <username>
Get-TeamUser -GroupId <id> | ft User
var url = "https://contoso.sharepoint.com/sites/classic/SiteAssets/test"
var context = SP.ClientContext.get_current()
var site = context.get_site()
var actions = site.get_userCustomActions();
context.load(site)
context.load(actions)
context.executeQueryAsync(
function () {
var newAction = actions.add();
newAction.set_description('abc123')
@wictorwilen
wictorwilen / flow-bot-azure-function.js
Last active June 2, 2021 04:10
Microsoft Teams Outgoing Webhook Proxy for Microsoft Flow
const crypto = require('crypto');
const request = require('request');
const bufSecret = Buffer('OUTGOING-WEBHOOK-SECRET', "base64");
const flowWebhook = 'MICROSOFT-FLOW-URL';
module.exports = function (context, req) {
var auth = req.headers['authorization'];
// HMAC security validation
@wictorwilen
wictorwilen / .env
Created October 15, 2018 15:58
Import and env files
DATA=From env file
@wictorwilen
wictorwilen / get-site-info.js
Last active October 16, 2018 10:52
Client side updates of SharePoint stuff
fetch('/_api/site', {headers:{accept:'application/json'}}).then( x => x.json().then( y => console.log(y)))
@wictorwilen
wictorwilen / powerline_prompt_ww.lua
Created February 28, 2018 16:45
cmder custom prompt with git and npm support
-- Source: https://github.com/AmrEldib/cmder-powerline-prompt
--- promptValue is whether the displayed prompt is the full path or only the folder name
-- Use:
-- "full" for full path like C:\Windows\System32
local promptValueFull = "full"
-- "folder" for folder name only like System32
local promptValueFolder = "folder"
-- default is promptValueFull
local promptValue = promptValueFull
@wictorwilen
wictorwilen / manifest.json
Last active May 19, 2021 08:50
Homeassistant Sector Alarm integration
{
"domain": "sector_alarm",
"name": "Sector Alarm",
"documentation": "https://void.null",
"dependencies": [],
"codeowners": [],
"requirements": []
}
@wictorwilen
wictorwilen / azureiot.md
Last active October 19, 2022 19:21
Azure IoT integration for Home Assistant

layout: page title: "Azure IoT" description: "Offers support for Azure IoT integration with Homeassistant." date: 2017-10-22 14:18 sidebar: true comments: false sharing: true footer: true logo: home-assistant.png

@wictorwilen
wictorwilen / wutrouble.ps1
Created August 27, 2017 19:00
Windows Update troubleshooter
## https://support.microsoft.com/en-us/help/971058/how-do-i-reset-windows-update-components
cleanmgr /sageset
cleanmgr /sagerun
$path = "c:\windows\SoftwareDistribution"