Skip to content

Instantly share code, notes, and snippets.

@harryyoud
harryyoud / list-user-installed-packages.sh
Created February 8, 2021 15:26 — forked from alfredkrohmer/list-user-installed-packages.sh
List all user-installed packages on OpenWrt / LEDE
#!/bin/sh
FLASH_TIME=$(opkg info busybox | grep '^Installed-Time: ')
for i in $(opkg list-installed | cut -d' ' -f1)
do
if [ "$(opkg info $i | grep '^Installed-Time: ')" != "$FLASH_TIME" ]
then
echo $i
fi
@harryyoud
harryyoud / graph.md
Last active February 8, 2021 14:25 — forked from thyxkris/graph.md
How to Reset Or Update User Passwords In Azure AD with Microsoft Graph API

How to Reset Or Update User Passwords In Azure AD with Microsoft Graph API

Background and Reason

There are two ways of using Microsoft Graph to read and write resources

  • Delegated permissions: can have delegated permissons, such as Directory.AsUser, but it must go through an interactive sign-in
  • Application permissions: doesn’t need an interactive sign-in, perfect for backend service to use. However, cannot have some delegated permission as it’s not a real user, so it’s unable to be delegated.

So, if we build a service or app to access the Microsoft graph, we have to use the application permission mode to avoid the interactive sign-in, which means the access is not triggered by any user. however, When updating the passwordProfile property, the following permission is required: Directory.AccessAsUser.All, which is only a delegated permission. and that’s why the update of the password profile will fail regardless of what permissions assigned.

Solution

@harryyoud
harryyoud / README.MD
Last active December 24, 2018 09:30 — forked from giordanocardillo/README.MD
Remove Office 2016 Product Key
  1. Open a command prompt as Administrator
  2. In the command prompt, type the following:
  • Office 2016 (32-bit) on a 32-bit version of Windows

    cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus

  • Office 2016 (32-bit) on a 64-bit version of Windows

    cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /dstatus

  • Office 2016 (64-bit) on a 64-bit version of Windows