Skip to content

Instantly share code, notes, and snippets.

View ferventcoder's full-sized avatar
🎯
Focusing

Rob Reynolds ferventcoder

🎯
Focusing
View GitHub Profile
class acl {
acl { 'c:/temp':
owner => 'SYSTEM',
group => 'Administrators',
inherit_parent_permissions => 'false',
permissions => [ { 'identity' => 'BUILTIN\Administrators', 'rights' => ['full'] } ]
}
}
class registry {
@idavis
idavis / gist:c16f117c0f99eb20c49f
Created June 12, 2015 16:46
PowerShell Module Security

I was playing around with dynamic module creation and figured out how to monkey patch modules.

I then thought about how PowerShell is a Last-In-Wins language, and tried replacing private methods.

This led to the "what if" moment of pulling [secure data out of a loaded module][]. In this case, the username and password of a credential set.

This seems like a security issue to me, or am I being over sensitive?

@idavis
idavis / Models.cs
Created July 6, 2011 22:33
Inverse null coalescing 'operator' support. Only properties are allowed.
#region Using Directives
using System.Threading;
#endregion
namespace ObjectExtensions.Tests
{
public class Person
{
@KevM
KevM / Nuget.Config
Created January 19, 2012 23:19
Nuget configuraiton of package sources.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<add key="myrepo" value="\\server\\share\\path" />
</packageSources>
</configuration>
var inputs = new[] { "http://www.google.com", "http://www.yahoo.com", "http://www.aol.com", };
var results = await inputs.AsAsync()
.WhereAsync(async x => await IsPageInTop10WebSitesByTraffic(x))
.SelectAsync(async x => await DownloadPageAsync(x))
.GetResults();
@mseankelly
mseankelly / NuGet.target tweak
Created July 8, 2012 00:07
Subvert NuGet 2.0's insistence that the developer explicitly enable package restore.
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<!--Update the NuGet.target file that is generated when you enable NuGet package restore with the following tweak.-->
<!--This will make it so that everyone pulling the project from source control will automatically pull the requisite NuGet packages the first time they build.-->
<!--While I understand why MS put this in place, it really doesn't make sense in the context of my current team (or any other team I've ever worked on).-->
<SetEnvironmentVariable EnvKey="EnableNuGetPackageRestore" EnvValue="true" Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' " />
<Exec Command="$(RestoreCommand)"
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
@erichexter
erichexter / gist:3717010
Created September 13, 2012 19:35
install chocolatey with windows auth proxy
Set-ExecutionPolicy -ExecutionPolicy Unrestricted;$a=new-object net.webclient;$a.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials;$a.downloadstring('http://bit.ly/OKgXHP')|iex
@Iristyle
Iristyle / gist:1776477
Created February 9, 2012 02:03
CloudInit.NET script for Windows Core 2008 R2 with IIS, .NET 4 and WebDeploy 2.0
#! /powershell/
Set-StrictMode -Version Latest
$log = 'c:\cloudfu.txt'
Add-Content $log -value "Initial Execution Policy: [$(Get-ExecutionPolicy)]"
Set-ExecutionPolicy Unrestricted
Add-Content $log -value "New Execution Policy: [$(Get-ExecutionPolicy)]"
Add-Content $log -value "Path variable [${env:Path}]"
Add-Content $log -value "PSModulePath variable [${env:PSModulePath}]"
@kylog
kylog / gist:5959294
Created July 9, 2013 17:21
This is part of .bash_kylo. The prompt stuff is WIP and there's some old code. The Darwin line is the most recently hacked on prompt. And note the sshk function which I use to carry the .bash_kylo file forward to move the prompt (and other stuff) to new hosts. All kinda hacky but works for now.
# Fun with prompts
# Ideas:
# http://www.maketecheasier.com/8-useful-and-interesting-bash-prompts/2009/09/04
# http://www.termsys.demon.co.uk/vtansi.htm
# http://slashdot.org/comments.pl?sid=108424&cid=9219400
#
RESET="\[\017\]"
NORMAL="\[\e[0m\]"
BRIRED="\[\e[1;31m\]"
@nddrylliog
nddrylliog / winbrew.md
Last active December 20, 2015 16:19
Winbrew