Skip to content

Instantly share code, notes, and snippets.

View dragon788's full-sized avatar

dragon788 dragon788

View GitHub Profile
@dragon788
dragon788 / import-portatour.ps1
Created December 9, 2016 00:56 — forked from weipah/import-portatour.ps1
PowerShell V3 Multipart/formdata example with REST-API (Invoke-RestMethod)
function Import-Portatour {
param (
[parameter(Mandatory=$True,Position=1)] [ValidateScript({ Test-Path -PathType Leaf $_ })] [String] $FilePath,
[parameter(Mandatory=$False,Position=2)] [System.URI] $ResultURL
)
# CONST
$CODEPAGE = "iso-8859-1" # alternatives are ASCII, UTF-8
# We have a REST-Endpoint
$RESTURL = "https://my.portatour.net/a/api/ImportCustomers/"
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@dragon788
dragon788 / chocolatey.repository.build
Last active November 3, 2017 21:08 — forked from RichHopkins/chocolatey.repository.build
Setup Chocolatey.Server simply and easily by getting and configuring the IIS requirements (for IIS7.5 and higher) and replacing the default site.
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Unrestricted is only good for testing, don't use that in production
Update-ExecutionPolicy RemoteSigned
Disable-InternetExplorerESC
Disable-UAC
#Enable-RemoteDesktop
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles
@dragon788
dragon788 / Liberal Regex Pattern for Web URLs
Created September 21, 2016 21:50 — forked from gruber/Liberal Regex Pattern for Web URLs
Liberal, Accurate Regex Pattern for Matching Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "example.com". For a pattern that attempts to
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502
# Single-line version:
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s
@dragon788
dragon788 / git.migrate
Created September 21, 2016 21:14 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@dragon788
dragon788 / Script_Template.ps1
Created September 21, 2016 18:15 — forked from 9to5IT/Script_Template.ps1
PowerShell: Script Template
#requires -version 2
<#
.SYNOPSIS
<Overview of script>
.DESCRIPTION
<Brief description of script>
.PARAMETER <Parameter_Name>
<Brief description of parameter input required. Repeat this attribute if required>
@dragon788
dragon788 / DevOps Workshop.md
Created September 16, 2016 16:46 — forked from ferventcoder/DevOps Workshop.md
DevOps Workshop (Day of DevOps)

ORGANIZER'S NOTE: This is a joint session with me and Paul Stack

Developer. Operations. QA. DevOps. What is DevOps? Whether you are a system administrator, developer, or a QA, we are all moving towards a need to deliver systems and software faster and more reliably.

Come join Paul and Rob as they walk you through what DevOps actually is as well as showing hands on demos in the field of configuration management and provisioning.

Expect to come away from this with a good understanding of DevOps, ideas for how to take your organization to the next level, and hands on experience or awareness of the following:

  • VirtualBox (Virtualization)
  • Vagrant (VM Sandboxing on Steroids)
# -*- mode: ruby -*-
# vi: set ft=ruby :
=begin
ModernIE VMs
config.vm.box = "modernIE/vista-ie7"
config.vm.box = "modernIE/w7-ie8"
config.vm.box = "modernIE/w7-ie9"
config.vm.box = "modernIE/w7-ie10"
@dragon788
dragon788 / boxstarter.txt
Created September 7, 2016 20:39 — forked from DavidBoike/boxstarter.txt
David's Boxstarter Script
#Basic Setup
Install-WindowsUpdate -AcceptEula
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
# Windows Features
choco install Microsoft-Hyper-V-All -source windowsFeatures
choco install IIS-WebServerRole -source windowsfeatures
choco install IIS-HttpCompressionDynamic -source windowsfeatures
@dragon788
dragon788 / pedantically_commented_playbook.yml
Created April 30, 2016 23:09 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.