Skip to content

Instantly share code, notes, and snippets.

View yooakim's full-sized avatar
⌨️
Focusing

Joakim Westin yooakim

⌨️
Focusing
View GitHub Profile
@yooakim
yooakim / update-azcopy.sh
Last active February 4, 2020 12:19
Update AzCopy to latest version
#!/bin/bash
#
# Simple bash script for downloading and updating AzCopy to the latest available version.
#
# Go home
cd $HOME
# Download AzCopy
wget https://aka.ms/downloadazcopy-v10-linux --no-verbose
$Installer = "GoogleChromeStandaloneEnterprise64.msi"; Invoke-WebRequest "https://dl.google.com/edgedl/chrome/install/GoogleChromeStandaloneEnterprise64.msi" -OutFile $env:TEMP\$Installer; Start-Process -FilePath msiexec -ArgumentList "/quiet /package $env:TEMP\$Installer" -Verb RunAs -Wait; Remove-Item $env:TEMP\$Installer
{
"builders": [
{
"type": "hyperv-iso",
"output_directory": "./output-win2016-base/",
"vm_name": "win2016-base",
"iso_url": "{{ user `iso_url` }}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"disk_size": "60000",
@yooakim
yooakim / template-step-2.json
Last active October 23, 2018 09:13
Template using hyperv-vmcx builder
{
"builders": [
{
"type": "hyperv-vmcx",
"clone_from_vmcx_path": "C:\\Users\\yooak\\source\\Basefarm\\packer-templates\\output-base\\Virtual Machines\\983A3EDE-0624-4A5C-A0BE-91FA050F68A5.vmcx",
"output_directory": "./output-updates/",
"communicator": "winrm",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout": "12h",
@yooakim
yooakim / Extensions.cs
Created February 1, 2016 11:19
Add timestamp to filename
public static class Extensions
{
/// <summary>
/// Add a timestamp to the filename, before the extension.
/// </summary>
/// <param name="fileName">any filename for which you want to add a timestamp, including file extension.</param>
/// <returns>filename with added timestamp</returns>
/// <example>
/// <c>var file = "myfile.txt".AddTimeStamp();</c>