Skip to content

Instantly share code, notes, and snippets.


Mr. Pacman vinyar

  • Oracle Cloud
  • Seattle
View GitHub Profile
View 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 / Remove-OldAzureRmResourceGroups.ps1
Created Dec 5, 2019 — forked from rcabr/Remove-OldAzureRmResourceGroups.ps1
Delete Azure resource groups that were created n or more days ago
View Remove-OldAzureRmResourceGroups.ps1
$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 / secret.rb
Last active Jun 8, 2017 — forked from sethvargo/secret.rb
updated_by_last_action example - Chef extension to extract secrets from HashiCorp's Vault
View secret.rb
# Please see the following blog post for more information:
resource_name :vault_secret
property :path, String, name_property: true
property :destination, String
vinyar / powershell.ps1
Created Jun 7, 2017
echoing out pem to remote windows workstation
View powershell.ps1
-join $(openssl rand -base64 512) > secret_key
cat secret_key
knife winrm -m <IP> -x <USER> -P <PASS> "echo $(gc .\secret_key)>c:\chef\secret_key"
vinyar / Chef-Shell.rb
Last active May 5, 2017
How to find out where Chef constructs are coming from via Chef-Shell and Test Kitchen through Pry
View Chef-Shell.rb
$ chef-shell [ruby-2.0.0p648]
loading configuration: none (standalone session)
Session type: standalone
chef (12.19.36)> require 'pry'
=> true
chef (12.19.36)> node
vinyar / example
Last active Apr 30, 2017
View example
attribute file
--> default['ms_dsc']['supported_modules'] = %w(mod1 mod5 mod19)
include_recipe 'ms_dsc'
vinyar / gist:d214d8300318f582a371d423bc1b8cd4
Created Apr 25, 2017 — forked from btsai/gist:f0a462ceec17126a5beda5705d323057
Ruby script to parse for large files in git repo
View gist:d214d8300318f582a371d423bc1b8cd4
# gist to create file size list:
# run this in irb in your git folder.
# will output a text file to the parent folder with a listing of each filepath and file size.
# NOTE: nil is added to the end of each line to prevent outputting the result of the iterator blocks.
lines = `git gc && git verify-pack -v .git/objects/pack/pack-*.idx`.split("\n"); nil
objects = lines.find_all{ |line| line.match(/^\w+ blob\W+[0-9]+ [0-9]+ [0-9]+$/) }; nil
shas = `git rev-list --objects --all | sort -k 2`.chomp.split("\n"); nil
map = shas.inject({}){ |hash, line| sha, file = line.split(' '); hash[sha] = file unless file.nil?; hash }; nil
sizes ={ |line| sha, type, size = line.gsub(/\s+/, ' ').split(' '); file = map[sha]; [size.to_i, file] if file }; nil
View output
Note that IP address is added as it should, but then hostname resource removes it.
Recipe: lk_base::via_hostfile
* hostsfile_entry[] action create
Recipe: <Dynamically Defined Resource>
* file[/etc/hosts] action create
- update content in file /etc/hosts from 7e4391 to 6994f8
--- /etc/hosts 2017-04-13 00:12:00.526652000 +0000
+++ /etc/.chef-hosts20170413-20240-1njwh1c 2017-04-13 00:17:10.693658000 +0000
@@ -9,9 +9,9 @@
vinyar / Process improvement notes.yml
Created Jan 31, 2017
Process improvement notes.yml
View Process improvement notes.yml
Personell Checklist:
Any scheduled PTO?
Any on-call rotations
Any mandatory meetings they have to attend.
Is there a deisgnated person to assist with fires?
- can they give someone half time to be in a room, but not on project
- can get creative here, but end result is you need undivided attention
Can we turn off their Mail
Can we turn off their slack/communicator/lync/etc..
Realistically, how long can staff be away from their primary job
vinyar /
Created Dec 13, 2016 — forked from afiune/
Automate LDAP Bulking User Creation

LDAP Bulking User Creation Process

This is temporal automation to create multiple LDAP users in Chef Automate.


The minimum prerequisites to be able to use this automation are:

You can’t perform that action at this time.