Skip to content

Instantly share code, notes, and snippets.

View espoelstra's full-sized avatar

Ethan Spoelstra espoelstra

View GitHub Profile
@ig0774
ig0774 / gist:1068598
Created July 6, 2011 23:35
Manage Windows Advanced Firewall with PowerShell
Set-StrictMode -Version Latest
# Constants
if (!(Test-Path variable:\NET_FW_DISABLED)) { Set-Variable NET_FW_DISABLED $False }
if (!(Test-Path variable:\NET_FW_ENABLED)) { Set-Variable NET_FW_ENABLED $True }
if (!(Test-Path variable:\NET_FW_IP_PROTOCOL_TCP)) { Set-Variable NET_FW_IP_PROTOCOL_TCP 6 }
if (!(Test-Path variable:\NET_FW_IP_PROTOCOL_UDP)) { Set-Variable NET_FW_IP_PROTOCOL_UDP 17 }
if (!(Test-Path variable:\NET_FW_PROFILE_DOMAIN)) { Set-Variable NET_FW_PROFILE_DOMAIN 0x1 }
if (!(Test-Path variable:\NET_FW_PROFILE_PRIVATE)) { Set-Variable NET_FW_PROFILE_PRIVATE 0x2 }
if (!(Test-Path variable:\NET_FW_PROFILE_PUBLIC)) { Set-Variable NET_FW_PROFILE_PUBLIC 0x2 }
@ecampidoglio
ecampidoglio / Out-Diff.ps1
Created January 18, 2012 21:48
A PowerShell function to colorize a sequence of text lines that represent an Universal Diff. For more information, see http://megakemp.com/2012/01/19/better-diffs-with-powershell/
function Out-Diff {
<#
.Synopsis
Redirects a Universal DIFF encoded text from the pipeline to the host using colors to highlight the differences.
.Description
Helper function to highlight the differences in a Universal DIFF text using color coding.
.Parameter InputObject
The text to display as Universal DIFF.
#>
[CmdletBinding()]
@ArturDorochowicz
ArturDorochowicz / installing-teamcity-on-windows.md
Last active December 20, 2016 23:06
Installing a TeamCity server on Windows.
@davidroberts63
davidroberts63 / Install-OctopusServer.ps1
Last active June 19, 2018 01:59
Automate Octopus Deploy Server Install and Configuration
$commandArgs = "/i Octopus-Server.msi /quiet INSTALLLOCATION=C:\OctopusServer /lv Octopus-Server-Install-Log.txt"
Start-Process "msiexec" $commandArgs -Wait -Verb RunAs
@DamianMac
DamianMac / gist:a944c0fcab6db531e7a5
Created October 30, 2014 02:16
Executing a Script Task via the Octopus API
var server = "http://yourserveraddress:8065/"; //Your server and IP address
var apiKey = "API-XXXXXXXXXXXXXXXXXXXXXXXXX"; // Get this from your 'profile' page in the Octopus web portal
var endpoint = new OctopusServerEndpoint(server, apiKey);
var repository = new OctopusRepository(endpoint);
var task = new Octopus.Client.Model.TaskResource();
task.Name = "AdHocScript";
task.Description = "Script invoked via API";
@cben
cben / dodgetocat_v2.png
Last active April 1, 2023 13:16 — forked from alienlebarge/dodgetocat_v2.png
Is there an easy way to link image in a GIST ?
dodgetocat_v2.png
@stuaxo
stuaxo / fix-desktop-launcher.sh
Last active February 6, 2019 21:25
Launch desktop files instead of opening them in gedit.
$ sudo apt-get install dex
$ /usr/bin/dex -c /usr/bin/dex -t ~/.local/share/applications/

How To - Upload and add Images to markdown files in Gist

Markdown files allow embedding images in it. However it requires the image to be hosted at some location and we can add the url of the image to embed it.

Example: ![Alternate image text](https://someurl/imagelocation/image.png)

We can use services like imgur or other services to host the images and use the hosted URL.

@frntn
frntn / gpg-key-validity.sh
Created June 21, 2017 01:59
GnuPG web of trust : automate multiple scenarii to help the understanding of https://www.gnupg.org/gph/en/manual/x334.html
#!/bin/bash
# Author: Matthieu Fronton <m@tthieu.fr>
# Profile: github.com/frntn
# Description: GnuPG web of trust : automate multiple scenarii to help the understanding of https://www.gnupg.org/gph/en/manual/x334.html
WAIT=4
if [ -t 1 ]; then
cya="$(tput setaf 6)"
@ntamvl
ntamvl / install-multiple-jdk-on-macos-high-sierra.md
Last active February 21, 2024 11:12
Install Multiple Java Versions on macOS High Sierra

Install Multiple Java Versions on macOS High Sierra

Install Homebrew Cask

On Mac, Homebrew is the de-facto package manager, and Homebrew Cask is the app manager. I’m going to use Cask to install Java 7 and 8.

Install Homebrew Cask first if you haven’t:

brew update
brew tap caskroom/cask