Skip to content

Instantly share code, notes, and snippets.

View backerman's full-sized avatar

Brad Ackerman backerman

View GitHub Profile
@backerman
backerman / profile-snippet-sshargcomplete.ps1
Last active December 5, 2024 02:50
Enable tab completion for ssh hostnames in PowerShell
using namespace System.Management.Automation
Register-ArgumentCompleter -CommandName ssh,scp,sftp -Native -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
$knownHosts = Get-Content ${Env:HOMEPATH}\.ssh\known_hosts `
| ForEach-Object { ([string]$_).Split(' ')[0] } `
| ForEach-Object { $_.Split(',') } `
| Sort-Object -Unique
# For now just assume it's a hostname.
@backerman
backerman / bsdinstall
Created October 16, 2022 04:18
bsdinstall script file for zfs root image
# Install FreeBSD into a data disk on Azure.
# The ZFS-specific variables must be exported.
export ZFSBOOT_VDEV_TYPE=stripe
export ZFSBOOT_DISKS=@@DISK@@
export ZFSBOOT_POOL_NAME=zroot
export ZFSBOOT_SWAP_SIZE=0
export nonInteractive="YES"
DISTRIBUTIONS="base.txz kernel.txz src.txz"
@backerman
backerman / parameters.json
Created August 9, 2020 23:39
Sample ARM template to deploy a custom FreeBSD image generated from the Marketplace image
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"subnetName": {
"value": null
},
"virtualNetworkName": {
"value": null
},
@backerman
backerman / debug.log.txt
Created July 21, 2019 23:29
Debug log for Terraform Azure storage container naming bug
2019/07/21 19:27:57 [INFO] Terraform version: 0.12.4
2019/07/21 19:27:57 [INFO] Go runtime version: go1.12.7
2019/07/21 19:27:57 [INFO] CLI args: []string{"/usr/bin/terraform", "validate"}
2019/07/21 19:27:57 [DEBUG] Attempting to open CLI config file: /home/bsa3/.terraformrc
2019/07/21 19:27:57 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/07/21 19:27:57 [INFO] CLI command args: []string{"validate"}
2019/07/21 19:27:57 [DEBUG] checking for provider in "."
2019/07/21 19:27:57 [DEBUG] checking for provider in "/usr/bin"
2019/07/21 19:27:57 [DEBUG] checking for provider in ".terraform/plugins/linux_amd64"
2019/07/21 19:27:57 [DEBUG] found provider "terraform-provider-azurerm_v1.31.0_x4"

Keybase proof

I hereby claim:

  • I am backerman on github.
  • I am bsa (https://keybase.io/bsa) on keybase.
  • I have a public key ASDJunAEZ_nVRc5-mR201_9slf0QXpEmVTB5DuZyYMDiJQo

To claim this, I am signing this object:

diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
index 027e245..a633744 100644
--- a/src/vmware/vmware_conf.c
+++ b/src/vmware/vmware_conf.c
@@ -271,17 +271,17 @@ vmwareExtractVersion(struct vmware_driver *driver)
switch (driver->type) {
case VMWARE_DRIVER_PLAYER:
- if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmplayer"))
+ if (virAsprintf(&bin, "%s/%s", vmwarePath, "vmplayer") < 0)
package main
import (
"fmt"
"github.com/spf13/pflag"
"github.com/spf13/viper"
)
type config struct {
@backerman
backerman / login_info.py
Created November 23, 2011 20:57
Display extra info on login screen
#!/usr/bin/python
import gtkhtml2
import gtk
import sys
import os
import atexit
import socket
from jinja2 import Template
get "/foo/:bar" do
puts params.inspect
"ok"
end
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Self-contained test case for couchdbkit issue #9
from couchdbkit import *
SERVER_URI="http://localhost:5984/"
DATABASE_NAME="kanji"