Skip to content

Instantly share code, notes, and snippets.

View gravcat's full-sized avatar

poppoppop gravcat

View GitHub Profile
#Requires -RunAsAdministrator
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
& choco install -y sysinternals googlechrome 7zip teamviewer tightvnc notepadplusplus msiafterburner
Invoke-WebRequest -Uri "https://miner.nicehash.com/installer/windows/setup/nhm_setup_2.0.1.2.exe" -OutFile "$env:USERPROFILE\Downloads\nhm_setup_2.0.1.2.exe"
Write-Output "Heads-up, you need display drivers! On nvidia this is 'geforce-game-ready-driver-win10'"
Start-Transcript "C:\enable-wsl-feature.txt"
Enable-WindowsOptionalFeature -Online -NoRestart -FeatureName Microsoft-Windows-Subsystem-Linux
Restart-Computer
Stop-Transcript
function Create-Shortcut {
param (
[String]
$target,
[String]
$shortcutFile,
[Switch]
$admin,
# @manojampalam - authored initial script
# @friism - Fixed issue with invalid SDDL on Set-Acl
# @manojampalam - removed ntrights.exe dependency
# @bingbing8 - removed secedit.exe dependency
$scriptpath = $MyInvocation.MyCommand.Path
$scriptdir = Split-Path $scriptpath
$sshdpath = Join-Path $scriptdir "sshd.exe"
$sshagentpath = Join-Path $scriptdir "ssh-agent.exe"
param (
[String]
$SSHPort = "22",
[String]
$version = "v0.0.20.0",
[String]
$packageName = "OpenSSH-Win64",
param (
[String]
$SSHPort = "22",
[String]
$version = "v0.0.20.0",
[String]
$packageName = "OpenSSH-Win64",
@gravcat
gravcat / install-sshd.ps1
Last active September 11, 2017 21:58
install-sshd.ps1 from OpenSSH-Win32 0.0.20.0
# @manojampalam - authored initial script
# @friism - Fixed issue with invalid SDDL on Set-Acl
# @manojampalam - removed ntrights.exe dependency
# @bingbing8 - removed secedit.exe dependency
$scriptpath = $MyInvocation.MyCommand.Path
$scriptdir = Split-Path $scriptpath
$sshdpath = Join-Path $scriptdir "sshd.exe"
$sshagentpath = Join-Path $scriptdir "ssh-agent.exe"
@gravcat
gravcat / random-dcom-acl.ps1
Created September 11, 2017 05:38
i found this somewhere
function New-DComAccessControlEntry {
param(
[Parameter(Mandatory=$true, Position=0)]
[string]
$Domain,
[Parameter(Mandatory=$true, Position=1)]
[string]
$Name,
@gravcat
gravcat / run-cse.ps1
Last active September 29, 2017 17:47
quickly run cse on an azure vm with a given script, vm name, and resource group name
$ErrorActionPreference = 'SilentlyContinue'
$rg = "gravcat195"
$location = "westus"
$fileName = "install-wsl-nopasswd.ps1"
$fileUri = "https://gist.githubusercontent.com/gravcat/397b330d4154a55f76e03de5b8f7ca18/raw/be0dde4e715cef0a6aa0719f0a29242c3c954402/$fileName"
$cseId = "cse"
Set-AzureRmVMCustomScriptExtension -ResourceGroupName $rg -VMName "$rg-vm" -location 'westus' -FileUri $fileUri -run $fileName -name $cseId -Argument "-username nucleus -password W3ARhkLrdQK8"
Start-Sleep -Seconds 3
@gravcat
gravcat / vm_create_adhoc_machine_cse.ps1
Last active March 19, 2018 18:50
enables you to quickly create a single azure vm with all the basic required supporting infrastructure
<# -----------------------------------------------------------------------------
vm_create_and_run_cse.ps1
.Description
Create an adhoc VM completely standalone, and run CSE if you'd like.
Get you some OSes! : https://docs.microsoft.com/en-us/azure/virtual-machines/windows/cli-ps-findimage
Publishers
- MicrosoftWindowsServer