This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### Save this file as "install-software.ps1" | |
### | |
# check for elevated powershell | |
write-host -nonewline -fore cyan "Info: Verifying user is elevated:" | |
If (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
write-host -fore Red "NO" | |
return write-error "You must run this script elevated." | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### Save this file as "install-software.ps1" | |
### | |
# check for elevated powershell | |
write-host -nonewline -fore cyan "Info: Verifying user is elevated:" | |
If (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
write-host -fore Red "NO" | |
return write-error "You must run this script elevated." | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# do some upgrades | |
sudo apt-get install libstdc++6 | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get dist-upgrade | |
# install dotnet RTM and Preview 2 bits | |
sudo apt-get install curl libunwind8 gettext | |
curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=809130 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Net; | |
using System.Security.Cryptography.X509Certificates; | |
using VCSJones.FiddlerCertGen; | |
namespace MkCert | |
{ | |
internal class Program | |
{ | |
private static void Main(string[] args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public unsafe X509Certificate2 GenerateSelfSignedCertificate(PrivateKey privateKey, X500DistinguishedName dn, HashAlgorithm signatureAlgorithm, string[] dnsNames, IPAddress[] ipAddresses = null, DateTime? notBefore = null, DateTime? notAfter = null) | |
{ | |
fixed (byte* dnPtr = dn.RawData) | |
{ | |
var blob = new NATIVE_CRYPTOAPI_BLOB | |
{ | |
cbData = (uint)dn.RawData.Length, | |
pbData = dnPtr | |
}; | |
var signatureAlgorithmIdentifier = new CRYPT_ALGORITHM_IDENTIFIER |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
namespace MySample | |
{ | |
internal class NativeMethods | |
{ | |
// declare a delegate that fits | |
public delegate int MessageBoxFn(IntPtr hWnd, string text, string caption, int options); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## warning: this is not a generic script, it's tailored to what I'm doing | |
## but I thought I'd post it for fits and giggles. | |
## | |
## This script loads the project.json file and then looks in the nuget feeds | |
## to find updated versions of the packages that for each dependency. | |
## | |
## It tries to keep the packages to ones before RC2 (there are breaking changes | |
## in my code base that I can't move to RC2 yet) | |
## | |
## If there isn't an RC1-final, it looks for the highest RC1 build, then -beta8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Pinvoke.Kernel32.Flags { | |
using System; | |
[Flags] | |
public enum MoveFile { | |
[Reference("MOVEFILE_REPLACE_EXISTING")] | |
ReplaceExisting = 1, | |
CopyAllowed = 2, | |
DelayUntilReboot = 4, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="../node/node.d.ts" /> | |
// bug: shouldn't I be able to reference stream.Writable? | |
// adding the import line here makes it so that the consumer can't see this class. | |
// import * as stream from "stream" | |
declare class BufferedMessagePackEncoder { | |
private tail; | |
private encoder; | |
private stream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Set background back to what it should be | |
// @namespace http://fearthecowboy.com | |
// @description Changes twitter's new image-less background to something I can stand | |
// @include https://twitter.com/* | |
// @grant none | |
// @version 1.0 | |
// ==/UserScript== | |
function addGlobalStyle(css) { |