Skip to content

Instantly share code, notes, and snippets.

View vinyar's full-sized avatar

Mr. Pacman vinyar

  • Launch Consulting
  • Seattle
View GitHub Profile
@vinyar
vinyar / presentation.txt
Last active August 17, 2022 23:46
DevOps presentation notes
DevOps
Wrong ways to think about DevOps:
There is no devops.exe - you can't 'install' DevOps
It's not a THING, it's a way of getting things done
You can't ask the team to 'go get some devops'
DevOps is much more than just Developers and Operations. The term has long ago transended dev and ops. Evangelists know this, but not everyone else
DevOps is a transformational process
@vinyar
vinyar / README.md
Created April 8, 2021 18:05 — forked from johnie/README.md
Filter Phish – This Google Apps Scripts filter will automatically move all future emails with the header `X-PHISHTEST` to trash.

Filter Phish

This Google Apps Scripts filter will automatically move all future emails with the header X-PHISHTEST to trash.

Getting started

  1. Go to Google Apps Script
  2. Add a new script and copy paste the content from the sibling file
  3. Test run the script, go to View in the menu bar and click Logs
  • If there's no errors it should be blank, OR a verbose message that it removed a phishing email.
@vinyar
vinyar / vagrant and kitchen.yml
Created January 11, 2022 18:28
Quick notes on Vagrantfile and Kitchen.yml settings for VPN connectivity
Muhammad chef issues:
How to setup port forwarding:
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "private_network", ip: "172.16.10.101"
config.vm.define "monitor01" do |vm01|
vm01.vm.hostname = "monitor01"
vm01.vm.network "private_network", ip: "192.168.121.101", virtualbox__intnet: "priv"
@vinyar
vinyar / global-protect.sh
Created March 30, 2021 16:58 — forked from kaleksandrov/global-protect.sh
Simple script that starts and stops GlobalProtect.app on Mac OSX.
#!/bin/bash
case $# in
0)
echo "Usage: $0 {start|stop}"
exit 1
;;
1)
case $1 in
start)
<powershell>
#https://gist.github.com/vinyar/6735863
# below two commands are known to fail for arbitrary reasons
try { winrm quickconfig -q }
catch {write-host "winrm quickconfig failed"}
try { Enable-PSRemoting -force}
catch {write-host "Enable-PSRemoting -force failed"}
write-host 'setting up WinRm';
@vinyar
vinyar / Brewfile
Created March 18, 2020 03:10 — forked from charlesjohnson/Brewfile
Brewfile
# Taps
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/core"
tap "sambadevi/powerlevel9k"
# Brew CLI apps
brew "fd"
brew "fzf"
@vinyar
vinyar / Remove-OldAzureRmResourceGroups.ps1
Created December 5, 2019 07:37 — forked from rcabr/Remove-OldAzureRmResourceGroups.ps1
Delete Azure resource groups that were created n or more days ago
$days = 7
$pointInTime = [DateTime]::Now.AddDays(-$days);
$horizon = $pointInTime.AddDays(-$days);
"===Removing resource groups created between $horizon and $pointInTime==="
# Get potential log entries
$logs = @()
$logs += Get-AzureRmLog -StartTime $horizon -EndTime $pointInTime -Status "Succeeded" -ResourceProvider "Microsoft.Resources" -WarningAction "SilentlyContinue" `
| Select-Object ResourceGroupName, ResourceId, @{Name="EventNameValue"; Expression={$_.EventName.Value}}, @{Name="OperationNameValue"; Expression={$_.OperationName.Value}}, EventTimestamp, @{Name="HttpVerb"; Expression={$_.HttpRequest.Method}} `
@vinyar
vinyar / serverspec output.ps1
Created August 8, 2014 21:22
serverspec failing on reg_key numbers
Windows registry key "HKLM\Software\Policies\Microsoft\Power\PowerSettings\3C0BC021-C8A8-4E07-A973-6B14CBCB2B7E" should have property value "ACSettingIndex", :type_dword, "1200"
Failure/Error: it { should have_property_value('ACSettingIndex', :type_dword, '1200')}
$exitCode = 1
$ProgressPreference = "SilentlyContinue"
try {
$success = ((Compare-Object (Get-Item 'Registry::HKLM\Software\Policies\Microsoft\Power\PowerSettings\3C0BC021-C8A8-4E07-A973-6B14CBCB2B7E').GetValue('ACSettingIndex') 4608) -eq $null)
if ($success -is [Boolean] -and $success) { $exitCode = 0 }
} catch {
Write-Output $_.Exception.Message
@vinyar
vinyar / Bootstrapping chef client behind firewall
Created June 25, 2015 18:24
Bootstrapping chef client behind firewall
https://docs.chef.io/knife_bootstrap.html#custom-templates
https://docs.chef.io/install_bootstrap.html
https://docs.chef.io/knife_bootstrap.html
https://github.com/chef/chef/blob/12.2.1/lib/chef/knife/bootstrap/templates/chef-full.erb
https://github.com/chef/chef/blob/11.6.2/lib/chef/knife/bootstrap/chef-full.erb
Blog:
https://www.chef.io/blog/2014/10/28/working-with-chef-behind-your-firewall/
http://www.appneta.com/blog/customizing-chef-bootstrap-templates/
http://www.tomduffield.com/bootstrapping-without-the-internet/
@vinyar
vinyar / secret.rb
Last active June 8, 2017 02:08 — forked from sethvargo/secret.rb
updated_by_last_action example - Chef extension to extract secrets from HashiCorp's Vault
# Please see the following blog post for more information:
#
# https://www.hashicorp.com/blog/using-hashicorp-vault-with-chef.html
#
resource_name :vault_secret
property :path, String, name_property: true
property :destination, String