Skip to content

Instantly share code, notes, and snippets.

@da9l
da9l / Install-Chocoaltey
Last active February 6, 2017 13:40
Install chocolatey behind proxy with system settings in Internet Explorer.
$wc=new-object net.webclient
$wp=[system.net.WebProxy]::GetDefaultProxy()
$wp.UseDefaultCredentials=$true
$wc.Proxy=$wp
iex ($wc.DownloadString('https://chocolatey.org/install.ps1'))
# watch a file changes in the current directory,
# execute all tests when a file is changed or renamed
$watcher = New-Object System.IO.FileSystemWatcher
$watcher.Path = get-location
$watcher.IncludeSubdirectories = $true
$watcher.EnableRaisingEvents = $false
$watcher.NotifyFilter = [System.IO.NotifyFilters]::LastWrite -bor [System.IO.NotifyFilters]::FileName
while($TRUE){
@da9l
da9l / MinecraftServerInstall.ps1
Last active January 4, 2016 00:29
Minecraft server installation
CINST Bukkit
Install-WindowsUpdate –AcceptEula
New-NetFirewallRule -DisplayName "Minecraft" -Direction Inbound -LocalPort 25565 -Protocol TCP
-Action Allow
Invoke-WmiMethod Win32_Process Create -Args "$env:systemdrive\tools\bukkit\Bukkit.bat"
@da9l
da9l / paketpsbootstrap_github
Last active January 18, 2021 17:36
paket bootstrap in powershell
#Downloads latest paket.bootstrapper.exe from github
$urlbase = "https://github.com"
$latestPage="$urlbase/fsprojects/Paket/releases/latest"
Write-Host "Parsing latest release page: $latestPage"
$page=Invoke-Webrequest -uri $latestPage
$latestBootStrapper=($page.Links | Where-Object { $_.href -match "bootstrapper" }).href
$dlurl="$urlbase$latestBootStrapper"
Write-Host "Downloading paket.bootstrapper.exe from $dlurl"
@da9l
da9l / git-color-prompt
Last active May 14, 2016 21:35
Git-prompt-color
source /etc/bash_completion.d/git-prompt
GIT_PS1_SHOWCOLORHINTS=true
GIT_PS1_SHOWDIRTYSTATE=true
PROMPT_COMMAND='__git_ps1 "${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w" "\$\[\033[00m\] "'
@da9l
da9l / FsharpDevW10.txt
Last active December 9, 2016 13:53
F# on Windows10
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
cinst visualstudiocode
cinst windows-sdk-10
cinst microsoft-build-tools
choco install visualfsharptools
choco list -lo | % {if($_ -match "(.+) (.+)") {"choco install $($matches[1])"}} > gist.txt
#This script relies on that ..\.paket\paket.bootstrapper.exe exists.
& {
if(!(Test-Path $PSScriptRoot\..\.paket\paket.exe)) {
& $PSScriptRoot\..\.paket\paket.bootstrapper.exe "--force-nuget", "--nuget-source=https://nuget.org/api/v2"
}
& $PSScriptRoot\..\.paket\paket.exe install
Write-Host -ForegroundColor Yellow @"
=========================================================================
New super power equipped!
Now you have access to paket - the nuget package manager on steroids!
$wc=new-object net.webclient
$wp=[system.net.WebProxy]::GetDefaultProxy()
$wp.UseDefaultCredentials=$true
$wc.Proxy=$wp
Invoke-Expression ($wc.DownloadString("http://boxstarter.org/bootstrapper.ps1"))
get-boxstarter -Force
#. { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "$wc=new-object net.webclient; $wp=[system.net.WebProxy]::GetDefaultProxy(); $wp.UseDefaultCredentials=$true; $wc.Proxy=$wp; iex ($wc.DownloadString('http://boxstarter.org/bootstrapper.ps1')); get-boxstarter -Force"