Skip to content

Instantly share code, notes, and snippets.

View hhedman's full-sized avatar

Henrik Hedman hhedman

  • Stockholm, Sweden
View GitHub Profile
@hhedman
hhedman / common.psm1
Created February 11, 2020 14:26
PowerShell module for downloading and installing MSOpenTech Redis (master, slave, sentinel)
function Test-Administrator
{
$user = [Security.Principal.WindowsIdentity]::GetCurrent();
(New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
function Stop-LocalService {
param([string]$serviceName)
Write-Host "Stopping $serviceName"
@hhedman
hhedman / msbuild.ps1
Created August 2, 2018 13:24 — forked from kamsar/msbuild.ps1
PowerShell to resolve MSBuild.exe on VS2017 or VS2015 (or with Build Tools 2015)
function Resolve-MsBuild {
$msb2017 = Resolve-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\*\*\MSBuild\*\bin\msbuild.exe" -ErrorAction SilentlyContinue
if($msb2017) {
Write-Host "Found MSBuild 2017 (or later)."
Write-Host $msb2017
return $msb2017
}
$msBuild2015 = "${env:ProgramFiles(x86)}\MSBuild\14.0\bin\msbuild.exe"
@hhedman
hhedman / git-cheat-list.md
Created February 17, 2017 09:51
Git cheat list

Git cheat list

  • all commits that your branch have that are not yet in master

    git log master..<HERE_COMES_YOUR_BRANCH_NAME>
    
  • setting up a character used for comments

git config core.commentchar

@hhedman
hhedman / README.md
Created October 3, 2016 11:31 — forked from hofmannsven/README.md
My simply Raspberry Pi Cheatsheet
#!/bin/bash
# Default Variable Declarations
DEFAULT="Default.txt"
FILEEXT=".ovpn"
CRT=".crt"
KEY=".3des.key"
CA="ca.crt"
TA="ta.key"