Skip to content

Instantly share code, notes, and snippets.

@dylanmei
dylanmei / packer-windows-openssh-5.3
Created October 4, 2013 19:27
Output from Packer building Windows 2012 / VirtualBox with OpenSSH for Windows 5.3
2013/10/02 22:47:47 Packer Version: 0.3.9
2013/10/02 22:47:47 Packer Target OS/Arch: darwin amd64
2013/10/02 22:47:47 Detected home directory from env var: /Users/dylanmei
2013/10/02 22:47:47 Attempting to open config file: /Users/dylanmei/.packerconfig
2013/10/02 22:47:47 File doesn't exist, but doesn't need to. Ignoring.
2013/10/02 22:47:47 Packer config: &{PluginMinPort:0 PluginMaxPort:0 Builders:map[amazon-ebs:packer-builder-amazon-ebs amazon-chroot:packer-builder-amazon-chroot amazon-instance:packer-builder-amazon-instance digitalocean:packer-builder-digitalocean openstack:packer-builder-openstack virtualbox:packer-builder-virtualbox vmware:packer-builder-vmware] Commands:map[build:packer-command-build fix:packer-command-fix inspect:packer-command-inspect validate:packer-command-validate] PostProcessors:map[vagrant:packer-post-processor-vagrant] Provisioners:map[chef-solo:packer-provisioner-chef-solo file:packer-provisioner-file puppet-masterless:packer-provisioner-puppet-masterless shell:packer-provisi
@dylanmei
dylanmei / List Windows hotfixes
Created October 2, 2013 02:29
List Windows hotfixes installed after a specified date
12:35 C:\> Get-HotFix | ? installedon -gt 1/15/2013
Source Description HotFixID InstalledBy InstalledOn
------ ----------- -------- ----------- -----------
EDLT Update KB2803748 NT AUTHORITY\SYSTEM 1/22/2013 12:00...
@dylanmei
dylanmei / extract ms packages
Last active October 10, 2022 00:04
How to extract msu/msp/msi/exe files from the command line
http://www.windowswiki.info/2009/02/19/how-to-extract-msumspmsiexe-files-from-the-command-line/
I find these commands quite helpful — maybe you know them already — if not, here you go:
Microsoft Hotfix Installer (.exe)
setup.exe /t:C:<target_dir> /c
Microsoft Update Standalone Package (.msu)
expand -F:* update.msu C:<target_dir>
cd <target_dir>
@dylanmei
dylanmei / sublime-notepad-replacement
Created September 13, 2013 19:02
Windows Notepad replacement, in this case, sublime
1. Create an executable
using System.Collections.Generic;
using System.Diagnostics;
namespace Sublime_ifeo
{
class Program
{
static void Main(string[] args)
{
Process.Start(@"C:\Program Files\Sublime Text 2\sublime_text.exe",
@dylanmei
dylanmei / gist:6511294
Created September 10, 2013 15:41
ASPX Server Variables
<%@ Page language="C#" %>
<html>
<body>
<table border="1">
<tr>
<td><b>Server Variable</b></td>
<td><b>Value</b></td>
</tr>
<% foreach (string strKey in Request.ServerVariables) { %>
@dylanmei
dylanmei / gist:6026331
Last active December 19, 2015 22:19
my git-ps1-bash-prompt
# Reset
Color_Off="\[\033[0m\]"
# Regular Colors
Black="\[\033[0;30m\]"
Red="\[\033[0;31m\]"
LightRed="\[\033[1;31m\]"
Green="\[\033[0;32m\]"
LightGreen="\[\033[1;32m\]"
Brown="\[\033[0;33m\]"
Yellow="\[\033[1;33m\]"
@dylanmei
dylanmei / gist:5271001
Created March 29, 2013 13:53
overwrite author/commiter on commit history
#!/bin/bash
git filter-branch --env-filter '
if [ "$GIT_AUTHOR_NAME" = "old author" ];
then
GIT_AUTHOR_NAME="new author";
GIT_AUTHOR_EMAIL="<youmail@somehost.ext>";
fi
if [ "$GIT_COMMITTER_NAME" = "old committer" ];
then
@dylanmei
dylanmei / beanshell scrape
Created March 25, 2013 14:54
Reading a page with java/beanshell
import java.io;
url = new URL("http://www.yahoo.com");
stream = new InputStreamReader(url.openStream());
reader = new BufferedReader(stream);
buffer = new StringBuilder();
while ((line = reader.readLine()) != null) {
buffer.append(line + '\n');
}
@dylanmei
dylanmei / Getty Images CONTRIBUTING template.md
Created September 19, 2012 17:30
Getty Images CONTRIBUTING template

We love pull requests. Here's a quick guide:

  1. Fork the repo.
  2. Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate:
  3. Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, we need a test!
  4. Make the test pass.
  5. Push to your fork and submit a pull request.
@dylanmei
dylanmei / gist:1689845
Created January 27, 2012 17:11
Chrome disable security for development
open -a Google\ Chrome --args --disable-web-security -–allow-file-access-from-files