Skip to content

Instantly share code, notes, and snippets.

@Deracination
Deracination / .gitignore
Last active October 11, 2017 23:46
Gitignore for Perl projects
!Build/
/META.yml
/META.json
/MYMETA.*
*.o
*.pm.tdy
*.bs
# Devel::Cover
cover_db/
@Deracination
Deracination / vagrant_cleanup.ps1
Created December 8, 2017 01:33
Delete vagrant SMB shares
#
# Get the ID and security principal of the current user account
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID)
# Get the security principal for the Administrator role
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
if ($myWindowsPrincipal.IsInRole($adminRole)) {
# We are running "as Administrator" - so change the title and background color to indicate this
@Deracination
Deracination / vagrant_up.ps1
Created December 8, 2017 01:35
Run 'vagrant up' from elevated powershell which can create SMB shares
#
# Get the ID and security principal of the current user account
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID)
# Get the security principal for the Administrator role
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
if ($myWindowsPrincipal.IsInRole($adminRole)) {
# We are running "as Administrator" - so change the title and background color to indicate this

Keybase proof

I hereby claim:

  • I am deracination on github.
  • I am cdhutch (https://keybase.io/cdhutch) on keybase.
  • I have a public key ASDvLlvS-qKit6UU8w9eubZ6I0XJtNniBCOR0Z-BWi8HPQo

To claim this, I am signing this object:

@Deracination
Deracination / .gitignore
Last active February 13, 2018 02:56
PHP gitignore
.DS_Store
Thumbs.db
npm-debug.log
bower_components
node_modules
tmp
@Deracination
Deracination / azure-ad-connect.php
Created January 12, 2023 00:23 — forked from DragonBe/azure-ad-connect.php
A simple PoC to access Azure AD for authentication
<?php
declare(strict_types=1);
use League\OAuth2\Client\Provider\GenericProvider;
use Microsoft\Graph\Graph;
use Microsoft\Graph\Model;
const APP_SESS_ID = 'AZPHPSID';
const OAUTH_APP_ID = '';