Skip to content

Instantly share code, notes, and snippets.

Enable-PSRemoting -Force;
Set-WSManQuickConfig -Force;
Set-Item "WSMAN:\LocalHost\MaxTimeoutms" -Value "1800000";
Set-Item "WSMAN:\LocalHost\Client\AllowUnencrypted" -Value $true;
Set-Item "WSMAN:\LocalHost\Client\Auth\Basic" -Value $true;
Set-Item "WSMAN:\LocalHost\Client\Auth\Digest" -Value $true;
Set-Item "WSMAN:\LocalHost\Client\Auth\Kerberos" -Value $true;
Set-Item "WSMAN:\LocalHost\Client\Auth\Negotiate" -Value $true;
Set-Item "WSMAN:\LocalHost\Client\Auth\Certificate" -Value $true;
$FormatEnumerationLimit = 10000;
$os = Get-WmiObject Win32_OperatingSystem;
$dotNetInstalled = @{};
$dotNetVersions = @();
$hotFixInstalled = @();
$installedProducts = @{};
$dotNetInstalledString = "[";
powershell -command "& {set-executionpolicy -force unrestricted; $wget = New-Object System.Net.WebClient; New-Item -ItemType directory -Path 'c:/post_install'; $wget.DownloadFile('https://gist.github.com/ju2wheels/074eaf81e40ed8ffe106/raw/a49cebe0d63768c55e4fa6b998a84d5e3bd0d92d/windows_os_info_collect.ps1','c:/post_install/post_install.ps1'); c:\post_install\post_install.ps1}"
@ju2wheels
ju2wheels / sudoers_disable_requiretty.sh
Created October 2, 2014 01:50
sudoers_disable_requiretty.sh
#!/bin/bash
/bin/sed -i 's/requiretty/!requiretty/' /etc/sudoers;
@ju2wheels
ju2wheels / sl_prod_pkg_list.rb
Last active August 29, 2015 14:08
SoftLayer Product Package Listing
require 'softlayer_api'
sl_client = SoftLayer::Client.new(:api_key => ENV["SL_API_KEY"], :username => ENV["SL_API_USERNAME"], :timeout => 240)
pkgs = [SoftLayer::ProductPackage.bare_metal_instance_package(sl_client),SoftLayer::ProductPackage.virtual_server_package(sl_client),SoftLayer::ProductPackage.additional_products_package(sl_client)].concat(SoftLayer::ProductPackage.bare_metal_server_packages(sl_client))
File.open("/tmp/sl_product_package_catagories.txt", "w") do |fout|
pkgs.each do |pkg|
fout.write "================#{pkg.name}===================\n"
pkg.categories.each do |item_cat|
fout.write "#{item_cat.categoryCode}\n"
@ju2wheels
ju2wheels / winrm_quickconfig_test.bat
Created February 16, 2015 18:42
WinRM QuickConfig post install script
powershell -command "& {set-executionpolicy -force unrestricted; $wget = New-Object System.Net.WebClient; New-Item -ItemType directory -Path 'c:/post_install'; $wget.DownloadFile('https://gist.githubusercontent.com/ju2wheels/6c231004f09ef232ea73/raw/4bd93da9f3db3700721583a9bbf015b452d8c941/winrm_quickconfig_test.ps1','c:/post_install/post_install.ps1'); c:\post_install\post_install.ps1}"
@ju2wheels
ju2wheels / setup.py
Last active August 29, 2015 14:21
Python 2.6 or greater setuptools template
"""
Python setup.py setuptools template for Python 2.6 or greater.
Python Packaging Guide: https://packaging.python.org/en/latest/index.html
"""
# pylint: disable=line-too-long
from __future__ import print_function
import os
@ju2wheels
ju2wheels / template.gemspec
Last active August 29, 2015 14:21
Rubygems gemspec template
#!/usr/bin/env gem build
# -*- coding: utf-8 -*-
module Gem::Specification::SpecificationHelpers
def self.find_executables(executable_dir = 'bin', options = {})
raise ArgumentError, "options must be a Hash" unless options.kind_of?(Hash)
exclude_executables = options['exclude_executables'] || []
executable_files = []
@ju2wheels
ju2wheels / package.json
Created June 4, 2015 03:49
npm package.json template for quickly creating a Node.js package with all options visible at a glance with comments
{
// WARNING: This file needs to be pure JSON, be sure to remove all comments
//
//====================================
// The "author" is one person. A "person" is an object with a "name" field and optionally
// "url" and "email" (both email and url are optional).
//
// This field can also be shortened to a single string that npm will parse.
//
//"author": "FirstName LastName <[email protected]> (http://www.company.com)",
@ju2wheels
ju2wheels / docker-compose.yml
Created June 10, 2015 20:11
docker-compose reference YAML file with comments
# https://docs.docker.com/compose/yml/
# Each service defined in docker-compose.yml must specify exactly one of
# image or build. Other keys are optional, and are analogous to their
# docker run command-line counterparts.
#
# As with docker run, options specified in the Dockerfile (e.g., CMD,
# EXPOSE, VOLUME, ENV) are respected by default - you don't need to
# specify them again in docker-compose.yml.
#
service_name: